feat: add withMCtx

This commit is contained in:
Leonardo de Moura 2019-12-02 12:48:34 -08:00
parent 028531ba9b
commit 3eabda1c4d

View file

@ -726,6 +726,11 @@ do mvarDecl ← getMVarDecl mvarId;
else
resettingSynthInstanceCache x
@[inline] def withMCtx {α} (mctx : MetavarContext) (x : MetaM α) : MetaM α :=
do mctx' ← getMCtx;
modify $ fun s => { mctx := mctx, .. s };
finally x (modify $ fun s => { mctx := mctx', .. s })
end Meta
end Lean