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.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs
index f29378122c..784625f3a2 100644
--- a/compiler/GHC/Tc/Module.hs
+++ b/compiler/GHC/Tc/Module.hs
@@ -2589,18 +2589,18 @@ tcRnType hsc_env flexi normalise rdr_type
-- It can have any rank or kind
-- First bring into scope any wildcards
; traceTc "tcRnType" (vcat [ppr wcs, ppr rn_type])
- ; (ty, kind) <- pushTcLevelM_ $
- -- must push level to satisfy level precondition of
- -- kindGeneralize, below
- solveEqualities $
- tcNamedWildCardBinders wcs $ \ wcs' ->
- do { mapM_ emitNamedTypeHole wcs'
- ; tcInferLHsTypeUnsaturated rn_type }
+ ; (_tclvl, wanted, (ty, kind))
+ <- pushLevelAndSolveEqualitiesX "tcRnType" $
+ tcNamedWildCardBinders wcs $ \ wcs' ->
+ do { mapM_ emitNamedTypeHole wcs'
+ ; tcInferLHsTypeUnsaturated rn_type }
+
+ ; checkNoErrs (reportAllUnsolved wanted)
-- Do kind generalisation; see Note [Kind-generalise in tcRnType]
; kvs <- kindGeneralizeAll kind
- ; e <- mkEmptyZonkEnv flexi
+ ; e <- mkEmptyZonkEnv flexi
; ty <- zonkTcTypeToTypeX e ty
-- Do validity checking on type
@@ -2615,6 +2615,7 @@ tcRnType hsc_env flexi normalise rdr_type
; return (ty', mkInfForAllTys kvs (tcTypeKind ty')) }
+
{- Note [TcRnExprMode]
~~~~~~~~~~~~~~~~~~~~~~
How should we infer a type when a user asks for the type of an expression e