summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/typecheck/TcEnv.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/typecheck/TcEnv.hs b/compiler/typecheck/TcEnv.hs
index d32272bfc5..7337345ed0 100644
--- a/compiler/typecheck/TcEnv.hs
+++ b/compiler/typecheck/TcEnv.hs
@@ -378,8 +378,13 @@ tcExtendRecEnv :: [(Name,TyThing)] -> TcM r -> TcM r
-- Just like tcExtendGlobalEnv, except the argument is a list of pairs
tcExtendRecEnv gbl_stuff thing_inside
= do { tcg_env <- getGblEnv
- ; let ge' = extendNameEnvList (tcg_type_env tcg_env) gbl_stuff
- ; tcg_env' <- setGlobalTypeEnv tcg_env ge'
+ ; let ge' = extendNameEnvList (tcg_type_env tcg_env) gbl_stuff
+ tcg_env' = tcg_env { tcg_type_env = ge' }
+ -- No need for setGlobalTypeEnv (which side-effects the
+ -- tcg_type_env_var); tcExtendRecEnv is used just
+ -- when kind-check a group of type/class decls. It would
+ -- in any case be wrong for an interface-file decl to end up
+ -- with a TcTyCon in it!
; setGblEnv tcg_env' thing_inside }
{-