fix: ensure no unassigned mvars at #eval
This commit is contained in:
parent
48ffe674d7
commit
cc520d422c
3 changed files with 23 additions and 0 deletions
|
|
@ -533,6 +533,7 @@ fun stx => do
|
|||
type ← inferType value;
|
||||
let decl := Declaration.defnDecl { name := n, lparams := [], type := type,
|
||||
value := value, hints := ReducibilityHints.opaque, isUnsafe := true };
|
||||
Term.ensureNoUnassignedMVars decl;
|
||||
addAndCompile decl
|
||||
};
|
||||
let elabMetaEval : CommandElabM Unit := runTermElabM (some n) fun _ => do {
|
||||
|
|
|
|||
13
tests/lean/evalWithMVar.lean
Normal file
13
tests/lean/evalWithMVar.lean
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
new_frontend
|
||||
|
||||
def c {α} : Sum α Nat :=
|
||||
Sum.inr 10
|
||||
|
||||
def Sum.someRight {α β} (s : Sum α β) : Option β :=
|
||||
match s with
|
||||
| Sum.inl _ => none
|
||||
| Sum.inr b => some b
|
||||
|
||||
#check Sum.someRight c
|
||||
|
||||
#eval Sum.someRight c
|
||||
9
tests/lean/evalWithMVar.lean.expected.out
Normal file
9
tests/lean/evalWithMVar.lean.expected.out
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Sum.someRight c : Option Nat
|
||||
evalWithMVar.lean:13:6: error: don't know how to synthesize placeholder
|
||||
@Sum.someRight ?m.177 … …
|
||||
context:
|
||||
⊢ Type ?
|
||||
evalWithMVar.lean:13:20: error: don't know how to synthesize placeholder
|
||||
@c ?m.177
|
||||
context:
|
||||
⊢ Type ?
|
||||
Loading…
Add table
Reference in a new issue