diff options
Diffstat (limited to 'compiler/GHC/Tc/Gen/Splice.hs')
-rw-r--r-- | compiler/GHC/Tc/Gen/Splice.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs index a38d6d436f..f307b636ee 100644 --- a/compiler/GHC/Tc/Gen/Splice.hs +++ b/compiler/GHC/Tc/Gen/Splice.hs @@ -679,12 +679,8 @@ tcTopSplice expr res_ty -- See Note [Running typed splices in the zonker] runTopSplice :: DelayedSplice -> TcM (HsExpr GhcTc) runTopSplice (DelayedSplice lcl_env orig_expr res_ty q_expr) - = do - errs_var <- getErrsVar - setLclEnv lcl_env $ setErrsVar errs_var $ do { - -- Set the errs_var to the errs_var from the current context, - -- otherwise error messages can go missing in GHCi (#19470) - zonked_ty <- zonkTcType res_ty + = restoreLclEnv lcl_env $ + do { zonked_ty <- zonkTcType res_ty ; zonked_q_expr <- zonkTopLExpr q_expr -- See Note [Collecting modFinalizers in typed splices]. ; modfinalizers_ref <- newTcRef [] |