fix: ensure no unassigned mvars at #eval

This commit is contained in:
Leonardo de Moura 2020-09-12 07:18:43 -07:00
parent 48ffe674d7
commit cc520d422c
3 changed files with 23 additions and 0 deletions

View file

@ -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 {

View 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

View 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 ?