feat: add withMCtx
This commit is contained in:
parent
028531ba9b
commit
3eabda1c4d
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue