summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Module.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-02-23 14:14:38 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-28 05:39:41 -0500
commit035d983dfa217bf8784b86e78d6024a3ca1a3f4f (patch)
tree7fb0ee9a8a3cf987aca99cf216d94609221aee58 /compiler/GHC/Tc/Module.hs
parent856929a5fa93e9fb13bd9efcb9049054fb1bde72 (diff)
downloadhaskell-035d983dfa217bf8784b86e78d6024a3ca1a3f4f.tar.gz
Fix two places where TcGblEnv was retained
Found with ghc-debug on the ManyConstructors test
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 ,