fix(frontend): Capture local instances in MetaTranslate
#242
|
@ -111,7 +111,7 @@ partial def translateLCtx : MetaTranslateM LocalContext := do
|
||||||
let lctx ← MonadLCtx.getLCtx
|
let lctx ← MonadLCtx.getLCtx
|
||||||
assert! lctx.isEmpty
|
assert! lctx.isEmpty
|
||||||
(← getSourceLCtx).foldlM (λ lctx srcLocalDecl => do
|
(← getSourceLCtx).foldlM (λ lctx srcLocalDecl => do
|
||||||
let localDecl ← Meta.withLCtx lctx #[] do
|
let localDecl ← Meta.withLCtx' lctx do
|
||||||
translateLocalDecl srcLocalDecl
|
translateLocalDecl srcLocalDecl
|
||||||
pure $ lctx.addDecl localDecl
|
pure $ lctx.addDecl localDecl
|
||||||
) lctx
|
) lctx
|
||||||
|
@ -148,7 +148,9 @@ def translateMVarFromTermInfo (termInfo : Elab.TermInfo) (context? : Option Elab
|
||||||
}) do
|
}) do
|
||||||
let type := termInfo.expectedType?.get!
|
let type := termInfo.expectedType?.get!
|
||||||
let lctx' ← translateLCtx
|
let lctx' ← translateLCtx
|
||||||
|
--let localInstances' ← srcDecl.localInstances.mapM translateLocalInstance
|
||||||
let mvar ← Meta.withLCtx lctx' #[] do
|
let mvar ← Meta.withLCtx lctx' #[] do
|
||||||
|
Meta.withLocalInstances (lctx'.decls.toList.filterMap id) do
|
||||||
let type' ← translateExpr type
|
let type' ← translateExpr type
|
||||||
trace[Pantograph.Frontend.MetaTranslate] "Translating from term info {← Meta.ppExpr type'}"
|
trace[Pantograph.Frontend.MetaTranslate] "Translating from term info {← Meta.ppExpr type'}"
|
||||||
Meta.mkFreshExprSyntheticOpaqueMVar type'
|
Meta.mkFreshExprSyntheticOpaqueMVar type'
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import LSpec
|
|
||||||
import Test.Delate
|
import Test.Delate
|
||||||
import Test.Environment
|
import Test.Environment
|
||||||
import Test.Frontend
|
import Test.Frontend
|
||||||
|
@ -9,6 +8,8 @@ import Test.Proofs
|
||||||
import Test.Serial
|
import Test.Serial
|
||||||
import Test.Tactic
|
import Test.Tactic
|
||||||
|
|
||||||
|
import LSpec
|
||||||
|
|
||||||
-- Test running infrastructure
|
-- Test running infrastructure
|
||||||
|
|
||||||
namespace Pantograph.Test
|
namespace Pantograph.Test
|
||||||
|
|
Loading…
Reference in New Issue