fix: Translate fvars in pending context

This commit is contained in:
Leni Aniva 2024-10-08 14:28:35 -07:00
parent 420e863756
commit 0e8c9f890b
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 2 additions and 1 deletions

View File

@ -106,8 +106,9 @@ partial def translateMVarId (srcMVarId: MVarId) : MetaTranslateM MVarId := do
let mvar' ← Meta.mkFreshExprMVar target' srcDecl.kind srcDecl.userName
let mvarId' := mvar'.mvarId!
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 fvars' ← mvarIdPending'.withContext $ fvars.mapM translateExpr
assignDelayedMVar mvarId' fvars' mvarIdPending'
pure mvarId'
addTranslatedMVar srcMVarId mvarId'