diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2022-11-28 15:36:25 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2022-11-29 08:37:50 +0000 |
commit | 3e695c2bfd97095a44f69f03b607e05876bbdc11 (patch) | |
tree | dde8bdf59b91ca0948842e59c1f93dc4b47e5c09 /compiler/GHC/Core/TyCo | |
parent | b5d9558e6dcef2a6f1c315f5058eafd7113f9860 (diff) | |
download | haskell-wip/T22516.tar.gz |
Use mkNakedFunTy in tcPatSynSigwip/T22516
As #22521 showed, in tcPatSynSig we make a "fake type" to
kind-generalise; and that type has unzonked type variables in it. So
we must not use `mkFunTy` (which checks FunTy's invariants) via
`mkPhiTy` when building this type. Instead we need to use
`mkNakedFunTy`.
Easy fix.
Diffstat (limited to 'compiler/GHC/Core/TyCo')
-rw-r--r-- | compiler/GHC/Core/TyCo/Rep.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Core/TyCo/Rep.hs-boot | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs index 9f1267ab56..4247e9f8dd 100644 --- a/compiler/GHC/Core/TyCo/Rep.hs +++ b/compiler/GHC/Core/TyCo/Rep.hs @@ -45,7 +45,7 @@ module GHC.Core.TyCo.Rep ( -- * Functions over types mkNakedTyConTy, mkTyVarTy, mkTyVarTys, mkTyCoVarTy, mkTyCoVarTys, - mkFunTy, mkNakedKindFunTy, + mkFunTy, mkNakedFunTy, mkVisFunTy, mkScaledFunTys, mkInvisFunTy, mkInvisFunTys, tcMkVisFunTy, tcMkInvisFunTy, tcMkScaledFunTys, @@ -799,10 +799,10 @@ mkTyCoVarTys = map mkTyCoVarTy infixr 3 `mkFunTy`, `mkInvisFunTy`, `mkVisFunTyMany` -mkNakedKindFunTy :: FunTyFlag -> Kind -> Kind -> Kind +mkNakedFunTy :: FunTyFlag -> Kind -> Kind -> Kind -- See Note [Naked FunTy] in GHC.Builtin.Types -- Always Many multiplicity; kinds have no linearity -mkNakedKindFunTy af arg res +mkNakedFunTy af arg res = FunTy { ft_af = af, ft_mult = manyDataConTy , ft_arg = arg, ft_res = res } diff --git a/compiler/GHC/Core/TyCo/Rep.hs-boot b/compiler/GHC/Core/TyCo/Rep.hs-boot index c2dd2a63fe..a560e0d608 100644 --- a/compiler/GHC/Core/TyCo/Rep.hs-boot +++ b/compiler/GHC/Core/TyCo/Rep.hs-boot @@ -27,7 +27,7 @@ type MCoercionN = MCoercion mkForAllTy :: VarBndr Var ForAllTyFlag -> Type -> Type mkNakedTyConTy :: TyCon -> Type -mkNakedKindFunTy :: FunTyFlag -> Type -> Type -> Type +mkNakedFunTy :: FunTyFlag -> Type -> Type -> Type -- To support Data instances in GHC.Core.Coercion.Axiom |