fix: Delayed MVars in MetaTranslate #110
|
@ -106,8 +106,9 @@ partial def translateMVarId (srcMVarId: MVarId) : MetaTranslateM MVarId := do
|
||||||
let mvar' ← Meta.mkFreshExprMVar target' srcDecl.kind srcDecl.userName
|
let mvar' ← Meta.mkFreshExprMVar target' srcDecl.kind srcDecl.userName
|
||||||
let mvarId' := mvar'.mvarId!
|
let mvarId' := mvar'.mvarId!
|
||||||
if let .some { fvars, mvarIdPending }:= (← getSourceMCtx).getDelayedMVarAssignmentExp srcMVarId then
|
if let .some { fvars, mvarIdPending }:= (← getSourceMCtx).getDelayedMVarAssignmentExp srcMVarId then
|
||||||
let fvars' ← fvars.mapM translateExpr
|
-- Map the fvars in the pending context.
|
||||||
let mvarIdPending' ← translateMVarId mvarIdPending
|
let mvarIdPending' ← translateMVarId mvarIdPending
|
||||||
|
let fvars' ← mvarIdPending'.withContext $ fvars.mapM translateExpr
|
||||||
assignDelayedMVar mvarId' fvars' mvarIdPending'
|
assignDelayedMVar mvarId' fvars' mvarIdPending'
|
||||||
pure mvarId'
|
pure mvarId'
|
||||||
addTranslatedMVar srcMVarId mvarId'
|
addTranslatedMVar srcMVarId mvarId'
|
||||||
|
|
Loading…
Reference in New Issue