summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Utils/Env.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc/Utils/Env.hs')
-rw-r--r--compiler/GHC/Tc/Utils/Env.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Utils/Env.hs b/compiler/GHC/Tc/Utils/Env.hs
index 1b13d82869..9c0971aa42 100644
--- a/compiler/GHC/Tc/Utils/Env.hs
+++ b/compiler/GHC/Tc/Utils/Env.hs
@@ -692,8 +692,11 @@ tcCheckUsage name id_mult thing_inside
--
-- It works nicely in practice.
(promote_mult, _, _, _) = mapTyCo mapper
- mapper = TyCoMapper { tcm_tyvar = \ () tv -> do { _ <- promoteTyVar tv
- ; zonkTcTyVar tv }
+ mapper = TyCoMapper { tcm_tyvar = \ () tv -> if isMetaTyVar tv
+ then do { tclvl <- getTcLevel
+ ; _ <- promoteMetaTyVarTo tclvl tv
+ ; zonkTcTyVar tv }
+ else return (mkTyVarTy tv)
, tcm_covar = \ () cv -> return (mkCoVarCo cv)
, tcm_hole = \ () h -> return (mkHoleCo h)
, tcm_tycobinder = \ () tcv _flag -> return ((), tcv)