summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Module.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc/Module.hs')
-rw-r--r--compiler/GHC/Tc/Module.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index dfc867c80a..08f7d0f4b1 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -491,9 +491,10 @@ tcRnSrcDecls explicit_mod_hdr decls export_ies
; (bind_env_mf, ev_binds_mf, binds_mf, fords_mf, imp_specs_mf, rules_mf)
<- zonkTcGblEnv emptyBag tcg_env_mf
-
- ; let { final_type_env = plusTypeEnv (tcg_type_env tcg_env)
- (plusTypeEnv bind_env_mf bind_env)
+ -- Force this or we retain an old reference to the previous
+ -- tcg_env
+ ; let { !final_type_env = plusTypeEnv (tcg_type_env tcg_env)
+ (plusTypeEnv bind_env_mf bind_env)
; tcg_env' = tcg_env_mf
{ tcg_binds = binds' `unionBags` binds_mf,
tcg_ev_binds = ev_binds' `unionBags` ev_binds_mf ,