fix: preserve tag

This commit is contained in:
Leonardo de Moura 2020-02-21 19:06:54 -08:00
parent 09f504f376
commit 9abb749663

View file

@ -21,9 +21,10 @@ private def getVarName (stx : Syntax) : Name :=
(stx.getIdAt 4).eraseMacroScopes
private def evalGeneralizeFinalize (mvarId : MVarId) (e : Expr) (target : Expr) : MetaM (List MVarId) := do
tag ← Meta.getMVarTag mvarId;
eType ← Meta.inferType e;
u ← Meta.getLevel eType;
mvar' ← Meta.mkFreshExprSyntheticOpaqueMVar target;
mvar' ← Meta.mkFreshExprSyntheticOpaqueMVar target tag;
let rfl := mkApp2 (Lean.mkConst `Eq.refl [u]) eType e;
let val := mkApp2 mvar' e rfl;
Meta.assignExprMVar mvarId val;