fix: have unsafe term produce an opaqueDecl (#9819)
This PR makes the `unsafe t` term create an auxiliary opaque declaration, rather than an auxiliary definition with opaque reducibility hints.
This commit is contained in:
parent
544f9912b7
commit
cbeef963a9
1 changed files with 2 additions and 3 deletions
|
|
@ -556,13 +556,12 @@ def elabUnsafe : TermElab := fun stx expectedType? =>
|
|||
let .const unsafeFn unsafeLvls .. := t.getAppFn | unreachable!
|
||||
let .defnInfo unsafeDefn ← getConstInfo unsafeFn | unreachable!
|
||||
let implName ← mkAuxName `unsafe_impl
|
||||
addDecl <| Declaration.defnDecl {
|
||||
addDecl <| Declaration.opaqueDecl {
|
||||
name := implName
|
||||
type := unsafeDefn.type
|
||||
levelParams := unsafeDefn.levelParams
|
||||
value := (← mkOfNonempty unsafeDefn.type)
|
||||
hints := .opaque
|
||||
safety := .safe
|
||||
isUnsafe := false
|
||||
}
|
||||
setImplementedBy implName unsafeFn
|
||||
return mkAppN (Lean.mkConst implName unsafeLvls) t.getAppArgs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue