fix: synthesize pending metavariables before expectedType.hasMVar test

This commit is contained in:
Leonardo de Moura 2020-10-20 14:54:57 -07:00
parent 299a89e2c0
commit 50a34bc1fe

View file

@ -162,6 +162,7 @@ if arg.isOfKind `Lean.Parser.Term.hole then
match expectedType? with
| none => throwError "invalid macro, expected type is not available"
| some expectedType =>
synthesizeSyntheticMVars
let expectedType ← instantiateMVars expectedType
if expectedType.hasFVar || expectedType.hasMVar then
throwError! "expected type must not contain free or meta variables{indentExpr expectedType}"