Commit 9359dbcc authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

TcRnMonad: Backport pushLevelAndCaptureConstraints

parent d3e069a3
......@@ -1170,6 +1170,17 @@ captureTcLevel thing_inside
thing_inside
; return (res, tclvl') }
pushLevelAndCaptureConstraints :: TcM a -> TcM (a, TcLevel, WantedConstraints)
pushLevelAndCaptureConstraints thing_inside
= do { env <- getLclEnv
; lie_var <- newTcRef emptyWC ;
; let tclvl' = pushTcLevel (tcl_tclvl env)
; res <- setLclEnv (env { tcl_tclvl = tclvl'
, tcl_lie = lie_var })
thing_inside
; lie <- readTcRef lie_var
; return (res, tclvl', lie) }
pushTcLevelM :: TcM a -> TcM a
pushTcLevelM thing_inside
= do { env <- getLclEnv
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment