diff options
author | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-01-12 23:08:07 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-13 16:52:07 -0500 |
commit | 496607fdb77baf12e2fe263104ba5d0d700eee3b (patch) | |
tree | 6b37b3ab1bf9375f61be2517ccaae54ada3c0ae0 /compiler/GHC/Tc/Gen/Bind.hs | |
parent | b6eb9bccd56a11b5e8c208bb5490309317fd5275 (diff) | |
download | haskell-496607fdb77baf12e2fe263104ba5d0d700eee3b.tar.gz |
Add a missing checkEscapingKind
Ticket #22743 pointed out that there is a missing check,
for type-inferred bindings, that the inferred type doesn't
have an escaping kind.
The fix is easy.
Diffstat (limited to 'compiler/GHC/Tc/Gen/Bind.hs')
-rw-r--r-- | compiler/GHC/Tc/Gen/Bind.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Gen/Bind.hs b/compiler/GHC/Tc/Gen/Bind.hs index 6441fe991a..c4269c984d 100644 --- a/compiler/GHC/Tc/Gen/Bind.hs +++ b/compiler/GHC/Tc/Gen/Bind.hs @@ -49,7 +49,7 @@ import GHC.Tc.Gen.Pat import GHC.Tc.Utils.TcMType import GHC.Tc.Instance.Family( tcGetFamInstEnvs ) import GHC.Tc.Utils.TcType -import GHC.Tc.Validity (checkValidType) +import GHC.Tc.Validity (checkValidType, checkEscapingKind) import GHC.Core.Predicate import GHC.Core.Reduction ( Reduction(..) ) @@ -906,7 +906,8 @@ mkInferredPolyId residual insoluble qtvs inferred_theta poly_name mb_sig_inst mo , ppr inferred_poly_ty]) ; unless insoluble $ addErrCtxtM (mk_inf_msg poly_name inferred_poly_ty) $ - checkValidType (InfSigCtxt poly_name) inferred_poly_ty + do { checkEscapingKind inferred_poly_ty + ; checkValidType (InfSigCtxt poly_name) inferred_poly_ty } -- See Note [Validity of inferred types] -- If we found an insoluble error in the function definition, don't -- do this check; otherwise (#14000) we may report an ambiguity |