diff options
author | Artyom Kuznetsov <hi@wzrd.ht> | 2021-07-29 12:10:29 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-10 15:00:42 -0400 |
commit | 130f94dbd3536bd409621cbaac4659ababf613b3 (patch) | |
tree | 55809a2f6f91bfecadcc6a1ef7d4f3895cc6c253 /compiler/GHC/Tc/Module.hs | |
parent | 741fdf0e4f371afbd8ef36f81bbb90a2049b005c (diff) | |
download | haskell-130f94dbd3536bd409621cbaac4659ababf613b3.tar.gz |
Refactor HsStmtContext and remove HsDoRn
Parts of HsStmtContext were split into a separate data structure
HsDoFlavour. Before this change HsDo used to have HsStmtContext
inside, but in reality only parts of HsStmtContext were used and other
cases were invariants handled with panics. Separating those parts
into its own data structure helps us to get rid of those panics as
well as HsDoRn type family.
Diffstat (limited to 'compiler/GHC/Tc/Module.hs')
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index f458605c14..5be998e07a 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -2391,7 +2391,7 @@ But for naked expressions, you will have tcUserStmt rdr_stmt@(L loc _) = do { (([rn_stmt], fix_env), fvs) <- checkNoErrs $ - rnStmts GhciStmtCtxt rnExpr [rdr_stmt] $ \_ -> do + rnStmts (HsDoStmt GhciStmtCtxt) rnExpr [rdr_stmt] $ \_ -> do fix_env <- getFixityEnv return (fix_env, emptyFVs) -- Don't try to typecheck if the renamer fails! @@ -2456,7 +2456,7 @@ tcGhciStmts stmts ; ret_id <- tcLookupId returnIOName -- return @ IO ; let ret_ty = mkListTy unitTy io_ret_ty = mkTyConApp ioTyCon [ret_ty] - tc_io_stmts = tcStmtsAndThen GhciStmtCtxt tcDoStmt stmts + tc_io_stmts = tcStmtsAndThen (HsDoStmt GhciStmtCtxt) tcDoStmt stmts (mkCheckExpType io_ret_ty) names = collectLStmtsBinders CollNoDictBinders stmts |