diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-01-12 17:22:11 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-17 05:58:12 -0500 |
commit | 2ac28e4cbaee482d71182fe831cd30d36226c57a (patch) | |
tree | 3b4f05691ca154e7d5dbe3cd4bec1469530d158f /compiler/GHC/Tc | |
parent | e516ef7eb73ae19cc07c4f1da5270783b54a17f1 (diff) | |
download | haskell-2ac28e4cbaee482d71182fe831cd30d36226c57a.tar.gz |
Use captureTopConstraints at top level
Missing this caused #19197. Easily fixed.
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 819740c341..a77f9fe71a 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -60,7 +60,6 @@ import GHC.Tc.Gen.Match import GHC.Tc.Utils.Unify( checkConstraints ) import GHC.Tc.Utils.Zonk import GHC.Tc.Gen.Expr -import GHC.Tc.Errors( reportAllUnsolved ) import GHC.Tc.Gen.App( tcInferSigma ) import GHC.Tc.Utils.Monad import GHC.Tc.Gen.Export @@ -2610,13 +2609,16 @@ 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]) - ; (_tclvl, wanted, (ty, kind)) - <- pushLevelAndSolveEqualitiesX "tcRnType" $ + ; ((ty, kind), wanted) + <- captureTopConstraints $ + pushTcLevelM_ $ bindNamedWildCardBinders wcs $ \ wcs' -> do { mapM_ emitNamedTypeHole wcs' ; tcInferLHsTypeUnsaturated rn_type } - ; checkNoErrs (reportAllUnsolved wanted) + -- Since all the wanteds are equalities, the returned bindings will be empty + ; empty_binds <- simplifyTop wanted + ; MASSERT2( isEmptyBag empty_binds, ppr empty_binds ) -- Do kind generalisation; see Note [Kind-generalise in tcRnType] ; kvs <- kindGeneralizeAll kind |