diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2022-11-09 10:33:22 +0000 |
---|---|---|
committer | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2022-11-11 23:40:10 +0000 |
commit | 778c6adca2c995cd8a1b84394d4d5ca26b915dac (patch) | |
tree | 17350cc63ae04a5b15461771304d195c30ada2f7 /testsuite/tests | |
parent | 154c70f6c589aa6531cbeea4aa3ec06e0acaf690 (diff) | |
download | haskell-778c6adca2c995cd8a1b84394d4d5ca26b915dac.tar.gz |
Type vs Constraint: finally nailed
This big patch addresses the rats-nest of issues that have plagued
us for years, about the relationship between Type and Constraint.
See #11715/#21623.
The main payload of the patch is:
* To introduce CONSTRAINT :: RuntimeRep -> Type
* To make TYPE and CONSTRAINT distinct throughout the compiler
Two overview Notes in GHC.Builtin.Types.Prim
* Note [TYPE and CONSTRAINT]
* Note [Type and Constraint are not apart]
This is the main complication.
The specifics
* New primitive types (GHC.Builtin.Types.Prim)
- CONSTRAINT
- ctArrowTyCon (=>)
- tcArrowTyCon (-=>)
- ccArrowTyCon (==>)
- funTyCon FUN -- Not new
See Note [Function type constructors and FunTy]
and Note [TYPE and CONSTRAINT]
* GHC.Builtin.Types:
- New type Constraint = CONSTRAINT LiftedRep
- I also stopped nonEmptyTyCon being built-in; it only needs to be wired-in
* Exploit the fact that Type and Constraint are distinct throughout GHC
- Get rid of tcView in favour of coreView.
- Many tcXX functions become XX functions.
e.g. tcGetCastedTyVar --> getCastedTyVar
* Kill off Note [ForAllTy and typechecker equality], in (old)
GHC.Tc.Solver.Canonical. It said that typechecker-equality should ignore
the specified/inferred distinction when comparein two ForAllTys. But
that wsa only weakly supported and (worse) implies that we need a separate
typechecker equality, different from core equality. No no no.
* GHC.Core.TyCon: kill off FunTyCon in data TyCon. There was no need for it,
and anyway now we have four of them!
* GHC.Core.TyCo.Rep: add two FunTyFlags to FunCo
See Note [FunCo] in that module.
* GHC.Core.Type. Lots and lots of changes driven by adding CONSTRAINT.
The key new function is sORTKind_maybe; most other changes are built
on top of that.
See also `funTyConAppTy_maybe` and `tyConAppFun_maybe`.
* Fix a longstanding bug in GHC.Core.Type.typeKind, and Core Lint, in
kinding ForAllTys. See new tules (FORALL1) and (FORALL2) in GHC.Core.Type.
(The bug was that before (forall (cv::t1 ~# t2). blah), where
blah::TYPE IntRep, would get kind (TYPE IntRep), but it should be
(TYPE LiftedRep). See Note [Kinding rules for types] in GHC.Core.Type.
* GHC.Core.TyCo.Compare is a new module in which we do eqType and cmpType.
Of course, no tcEqType any more.
* GHC.Core.TyCo.FVs. I moved some free-var-like function into this module:
tyConsOfType, visVarsOfType, and occCheckExpand. Refactoring only.
* GHC.Builtin.Types. Compiletely re-engineer boxingDataCon_maybe to
have one for each /RuntimeRep/, rather than one for each /Type/.
This dramatically widens the range of types we can auto-box.
See Note [Boxing constructors] in GHC.Builtin.Types
The boxing types themselves are declared in library ghc-prim:GHC.Types.
GHC.Core.Make. Re-engineer the treatment of "big" tuples (mkBigCoreVarTup
etc) GHC.Core.Make, so that it auto-boxes unboxed values and (crucially)
types of kind Constraint. That allows the desugaring for arrows to work;
it gathers up free variables (including dictionaries) into tuples.
See Note [Big tuples] in GHC.Core.Make.
There is still work to do here: #22336. But things are better than
before.
* GHC.Core.Make. We need two absent-error Ids, aBSENT_ERROR_ID for types of
kind Type, and aBSENT_CONSTRAINT_ERROR_ID for vaues of kind Constraint.
Ditto noInlineId vs noInlieConstraintId in GHC.Types.Id.Make;
see Note [inlineId magic].
* GHC.Core.TyCo.Rep. Completely refactor the NthCo coercion. It is now called
SelCo, and its fields are much more descriptive than the single Int we used to
have. A great improvement. See Note [SelCo] in GHC.Core.TyCo.Rep.
* GHC.Core.RoughMap.roughMatchTyConName. Collapse TYPE and CONSTRAINT to
a single TyCon, so that the rough-map does not distinguish them.
* GHC.Core.DataCon
- Mainly just improve documentation
* Some significant renamings:
GHC.Core.Multiplicity: Many --> ManyTy (easier to grep for)
One --> OneTy
GHC.Core.TyCo.Rep TyCoBinder --> GHC.Core.Var.PiTyBinder
GHC.Core.Var TyCoVarBinder --> ForAllTyBinder
AnonArgFlag --> FunTyFlag
ArgFlag --> ForAllTyFlag
GHC.Core.TyCon TyConTyCoBinder --> TyConPiTyBinder
Many functions are renamed in consequence
e.g. isinvisibleArgFlag becomes isInvisibleForAllTyFlag, etc
* I refactored FunTyFlag (was AnonArgFlag) into a simple, flat data type
data FunTyFlag
= FTF_T_T -- (->) Type -> Type
| FTF_T_C -- (-=>) Type -> Constraint
| FTF_C_T -- (=>) Constraint -> Type
| FTF_C_C -- (==>) Constraint -> Constraint
* GHC.Tc.Errors.Ppr. Some significant refactoring in the TypeEqMisMatch case
of pprMismatchMsg.
* I made the tyConUnique field of TyCon strict, because I
saw code with lots of silly eval's. That revealed that
GHC.Settings.Constants.mAX_SUM_SIZE can only be 63, because
we pack the sum tag into a 6-bit field. (Lurking bug squashed.)
Fixes
* #21530
Updates haddock submodule slightly.
Performance changes
~~~~~~~~~~~~~~~~~~~
I was worried that compile times would get worse, but after
some careful profiling we are down to a geometric mean 0.1%
increase in allocation (in perf/compiler). That seems fine.
There is a big runtime improvement in T10359
Metric Decrease:
LargeRecord
MultiLayerModulesTH_OneShot
T13386
T13719
Metric Increase:
T8095
Diffstat (limited to 'testsuite/tests')
88 files changed, 284 insertions, 279 deletions
diff --git a/testsuite/tests/callarity/unittest/CallArity1.hs b/testsuite/tests/callarity/unittest/CallArity1.hs index 462bdd144d..6390048bb2 100644 --- a/testsuite/tests/callarity/unittest/CallArity1.hs +++ b/testsuite/tests/callarity/unittest/CallArity1.hs @@ -3,7 +3,7 @@ import GHC.Core import GHC.Core.Utils import GHC.Types.Id import GHC.Core.Type -import GHC.Core.Multiplicity ( pattern Many ) +import GHC.Core.Multiplicity ( pattern ManyTy ) import GHC.Core.Make import GHC.Core.Opt.CallArity (callArityRHS) import GHC.Types.Id.Make @@ -192,7 +192,7 @@ mkLApps v = mkApps (Var v) . map mkLit mkACase = mkIfThenElse (mkVarApps (Var scrutf) [scruta]) mkTestId :: Int -> String -> Type -> Id -mkTestId i s ty = mkSysLocal (mkFastString s) (mkBuiltinUnique i) Many ty +mkTestId i s ty = mkSysLocal (mkFastString s) (mkBuiltinUnique i) ManyTy ty mkTestIds :: [String] -> [Type] -> [Id] mkTestIds ns tys = zipWith3 mkTestId [0..] ns tys diff --git a/testsuite/tests/count-deps/CountDepsAst.stdout b/testsuite/tests/count-deps/CountDepsAst.stdout index 5cc408a593..8db15009b1 100644 --- a/testsuite/tests/count-deps/CountDepsAst.stdout +++ b/testsuite/tests/count-deps/CountDepsAst.stdout @@ -61,6 +61,7 @@ GHC.Core.SimpleOpt GHC.Core.Stats GHC.Core.Subst GHC.Core.Tidy +GHC.Core.TyCo.Compare GHC.Core.TyCo.FVs GHC.Core.TyCo.Ppr GHC.Core.TyCo.Rep diff --git a/testsuite/tests/count-deps/CountDepsParser.stdout b/testsuite/tests/count-deps/CountDepsParser.stdout index 8b66535737..8e41f78ac5 100644 --- a/testsuite/tests/count-deps/CountDepsParser.stdout +++ b/testsuite/tests/count-deps/CountDepsParser.stdout @@ -61,6 +61,7 @@ GHC.Core.SimpleOpt GHC.Core.Stats GHC.Core.Subst GHC.Core.Tidy +GHC.Core.TyCo.Compare GHC.Core.TyCo.FVs GHC.Core.TyCo.Ppr GHC.Core.TyCo.Rep diff --git a/testsuite/tests/dependent/should_fail/T13601.stderr b/testsuite/tests/dependent/should_fail/T13601.stderr index 695463c080..a8c6fcae84 100644 --- a/testsuite/tests/dependent/should_fail/T13601.stderr +++ b/testsuite/tests/dependent/should_fail/T13601.stderr @@ -1,5 +1,6 @@ T13601.hs:19:16: error: [GHC-83865] - • Expected a type, but ‘Logic a’ has kind ‘TYPE (Rep rep)’ + • Couldn't match kind ‘Rep rep’ with ‘LiftedRep’ + Expected kind ‘*’, but ‘Logic a’ has kind ‘TYPE (Rep rep)’ • In the first argument of ‘Boolean’, namely ‘(Logic a)’ In the class declaration for ‘Eq’ diff --git a/testsuite/tests/dependent/should_fail/T16391b.stderr b/testsuite/tests/dependent/should_fail/T16391b.stderr index 201adffc25..958960a2a7 100644 --- a/testsuite/tests/dependent/should_fail/T16391b.stderr +++ b/testsuite/tests/dependent/should_fail/T16391b.stderr @@ -1,6 +1,7 @@ T16391b.hs:10:8: error: [GHC-25897] - • Expected a type, but ‘T r’ has kind ‘TYPE r’ + • Couldn't match kind ‘r’ with ‘LiftedRep’ + Expected kind ‘*’, but ‘T r’ has kind ‘TYPE r’ ‘r’ is a rigid type variable bound by the type signature for ‘foo’ at T16391b.hs:10:1-10 diff --git a/testsuite/tests/ghci/scripts/T16575.stdout b/testsuite/tests/ghci/scripts/T16575.stdout index b907a52653..49f6cc2555 100644 --- a/testsuite/tests/ghci/scripts/T16575.stdout +++ b/testsuite/tests/ghci/scripts/T16575.stdout @@ -5,15 +5,15 @@ T16575.hs:(4,15)-(4,18): [Ghost.X] -> GHC.Show.ShowS T16575.hs:(7,7)-(7,8): Ghost.X -> Ghost.X -> GHC.Types.Bool T16575.hs:(6,10)-(6,13): Ghost.X -> Ghost.X -> GHC.Types.Bool T16575.hs:(4,15)-(4,18): GHC.Show.Show Ghost.X -T16575.hs:(4,15)-(4,18): ([Ghost.X] -> GHC.Show.ShowS) -> GHC.Show.Show Ghost.X -T16575.hs:(4,15)-(4,18): (Ghost.X -> GHC.Base.String) -> ([Ghost.X] -> GHC.Show.ShowS) -> GHC.Show.Show Ghost.X -T16575.hs:(4,15)-(4,18): (GHC.Types.Int -> Ghost.X -> GHC.Show.ShowS) -> (Ghost.X -> GHC.Base.String) -> ([Ghost.X] -> GHC.Show.ShowS) -> GHC.Show.Show Ghost.X +T16575.hs:(4,15)-(4,18): ([Ghost.X] -> GHC.Show.ShowS) -=> GHC.Show.Show Ghost.X +T16575.hs:(4,15)-(4,18): (Ghost.X -> GHC.Base.String) -=> ([Ghost.X] -> GHC.Show.ShowS) -=> GHC.Show.Show Ghost.X +T16575.hs:(4,15)-(4,18): (GHC.Types.Int -> Ghost.X -> GHC.Show.ShowS) -=> (Ghost.X -> GHC.Base.String) -=> ([Ghost.X] -> GHC.Show.ShowS) -=> GHC.Show.Show Ghost.X T16575.hs:(4,15)-(4,18): GHC.Types.Int -> Ghost.X -> GHC.Show.ShowS T16575.hs:(4,15)-(4,18): Ghost.X -> GHC.Base.String T16575.hs:(4,15)-(4,18): [Ghost.X] -> GHC.Show.ShowS T16575.hs:(6,10)-(6,13): GHC.Classes.Eq Ghost.X -T16575.hs:(6,10)-(6,13): (Ghost.X -> Ghost.X -> GHC.Types.Bool) -> GHC.Classes.Eq Ghost.X -T16575.hs:(6,10)-(6,13): (Ghost.X -> Ghost.X -> GHC.Types.Bool) -> (Ghost.X -> Ghost.X -> GHC.Types.Bool) -> GHC.Classes.Eq Ghost.X +T16575.hs:(6,10)-(6,13): (Ghost.X -> Ghost.X -> GHC.Types.Bool) -=> GHC.Classes.Eq Ghost.X +T16575.hs:(6,10)-(6,13): (Ghost.X -> Ghost.X -> GHC.Types.Bool) -=> (Ghost.X -> Ghost.X -> GHC.Types.Bool) -=> GHC.Classes.Eq Ghost.X T16575.hs:(6,10)-(6,13): Ghost.X -> Ghost.X -> GHC.Types.Bool T16575.hs:(6,10)-(6,13): Ghost.X -> Ghost.X -> GHC.Types.Bool T16575.hs:(7,14)-(7,17): GHC.Types.Bool diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 0ad107c4e4..e64debbb49 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -294,7 +294,7 @@ test('T15325', normal, ghci_script, ['T15325.script']) test('T15591', normal, ghci_script, ['T15591.script']) test('T15743b', normal, ghci_script, ['T15743b.script']) test('T15827', normal, ghci_script, ['T15827.script']) -test('T15872', normal, ghci_script, ['T15872.script']) +test('T15872', expect_broken(22298), ghci_script, ['T15872.script']) test('T15898', normal, ghci_script, ['T15898.script']) test('T15941', normal, ghci_script, ['T15941.script']) test('T16030', normal, ghci_script, ['T16030.script']) diff --git a/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr b/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr index 3f5d7ec570..bafcbe1eec 100644 --- a/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr +++ b/testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr @@ -1,6 +1,6 @@ SimpleFail14.hs:5:15: error: [GHC-83865] - • Expected a type, but ‘a ~ a’ has kind ‘Constraint’ + • Expected a type, but ‘a ~ a’ is a constraint • In the type ‘(a ~ a)’ In the definition of data constructor ‘T’ In the data declaration for ‘T’ diff --git a/testsuite/tests/linear/should_fail/LinearPartialSig.stderr b/testsuite/tests/linear/should_fail/LinearPartialSig.stderr index 405e6df2be..175462f917 100644 --- a/testsuite/tests/linear/should_fail/LinearPartialSig.stderr +++ b/testsuite/tests/linear/should_fail/LinearPartialSig.stderr @@ -3,5 +3,4 @@ LinearPartialSig.hs:5:9: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘'Many :: GHC.Types.Multiplicity’ To use the inferred type, enable PartialTypeSignatures - • In the type ‘a %_ -> a’ - In the type signature: f :: a %_ -> a + • In the type signature: f :: a %_ -> a diff --git a/testsuite/tests/parser/should_fail/T14740.stderr b/testsuite/tests/parser/should_fail/T14740.stderr index 5a047c03ba..d2fe9a73a2 100644 --- a/testsuite/tests/parser/should_fail/T14740.stderr +++ b/testsuite/tests/parser/should_fail/T14740.stderr @@ -1,4 +1,4 @@ T14740.hs:5:7: error: [GHC-83865] - • Expecting a lifted type, but ‘(# #)’ is unlifted + • Expected a constraint, but ‘(# #)’ is a type • In the type signature: x :: ((# #)) => () diff --git a/testsuite/tests/parser/should_fail/T20654b.stderr b/testsuite/tests/parser/should_fail/T20654b.stderr index 3a913b6b77..76be928e13 100644 --- a/testsuite/tests/parser/should_fail/T20654b.stderr +++ b/testsuite/tests/parser/should_fail/T20654b.stderr @@ -1,4 +1,4 @@ T20654b.hs:6:17: error: [GHC-83865] - • Expected a type, but ‘?ip2 :: Int’ has kind ‘Constraint’ + • Expected a type, but ‘?ip2 :: Int’ is a constraint • In the type signature: bar :: (?ip1 :: ?ip2 :: Int) => Int diff --git a/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr b/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr index 7804228b0b..a67bfdcc7e 100644 --- a/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr +++ b/testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr @@ -4,9 +4,9 @@ ExprSigLocal.hs:9:35: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefa Where: ‘a’ is a rigid type variable bound by the inferred type of <expression> :: a -> a at ExprSigLocal.hs:9:27 - • In the type ‘a -> _’ - In an expression type signature: forall a. a -> _ + • In an expression type signature: forall a. a -> _ In the expression: (\ x -> x) :: forall a. a -> _ + In an equation for ‘y’: y = ((\ x -> x) :: forall a. a -> _) • Relevant bindings include y :: b -> b (bound at ExprSigLocal.hs:9:1) @@ -15,5 +15,4 @@ ExprSigLocal.hs:11:21: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdef Where: ‘a’ is a rigid type variable bound by the inferred type of g :: a -> a at ExprSigLocal.hs:11:13 - • In the type ‘a -> _’ - In the type signature: g :: forall a. a -> _ + • In the type signature: g :: forall a. a -> _ diff --git a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr index 1f776ecc42..9c16399db7 100644 --- a/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr @@ -3,8 +3,7 @@ SplicesUsed.hs:7:15: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Maybe Bool’ - • In the type ‘_’ - In the type signature: maybeBool :: (_) + • In the type signature: maybeBool :: _ SplicesUsed.hs:8:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_a’ standing for ‘w’ @@ -21,8 +20,9 @@ SplicesUsed.hs:8:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefau SplicesUsed.hs:8:26: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Bool’ • In the first argument of ‘Maybe’, namely ‘_’ - In the type ‘Maybe _’ In an expression type signature: Maybe _ + In the first argument of ‘id :: _a -> _a’, namely + ‘(Just True :: Maybe _)’ • Relevant bindings include maybeBool :: Maybe Bool (bound at SplicesUsed.hs:8:1) @@ -31,32 +31,28 @@ SplicesUsed.hs:10:16: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefa Where: ‘a’ is a rigid type variable bound by the inferred type of charA :: a -> (Char, a) at SplicesUsed.hs:10:1-26 - • In the type ‘a -> (_)’ - In the type signature: charA :: a -> (_) + • In the type signature: charA :: a -> _ SplicesUsed.hs:13:13: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘a -> Bool’ Where: ‘a’ is a rigid type variable bound by the inferred type of filter' :: (a -> Bool) -> [a] -> [a] at SplicesUsed.hs:14:1-16 - • In the type ‘_ -> _ -> _’ - In the type signature: filter' :: (_ -> _ -> _) + • In the type signature: filter' :: (_ -> _ -> _) SplicesUsed.hs:13:13: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘[a]’ Where: ‘a’ is a rigid type variable bound by the inferred type of filter' :: (a -> Bool) -> [a] -> [a] at SplicesUsed.hs:14:1-16 - • In the type ‘_ -> _ -> _’ - In the type signature: filter' :: (_ -> _ -> _) + • In the type signature: filter' :: (_ -> _ -> _) SplicesUsed.hs:13:13: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘[a]’ Where: ‘a’ is a rigid type variable bound by the inferred type of filter' :: (a -> Bool) -> [a] -> [a] at SplicesUsed.hs:14:1-16 - • In the type ‘_ -> _ -> _’ - In the type signature: filter' :: (_ -> _ -> _) + • In the type signature: filter' :: (_ -> _ -> _) SplicesUsed.hs:16:2: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found extra-constraints wildcard standing for ‘Eq a’ diff --git a/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr b/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr index d4049ce61e..2347b8e0c4 100644 --- a/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SuperCls.stderr @@ -1,4 +1,4 @@ SuperCls.hs:4:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: f :: (Ord a, _) => a -> Bool diff --git a/testsuite/tests/partial-sigs/should_compile/T11016.stderr b/testsuite/tests/partial-sigs/should_compile/T11016.stderr index 667fcddfdf..44b6fd6c57 100644 --- a/testsuite/tests/partial-sigs/should_compile/T11016.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T11016.stderr @@ -1,6 +1,6 @@ T11016.hs:5:19: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: f1 :: (?x :: Int, _) => Int T11016.hs:8:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] diff --git a/testsuite/tests/partial-sigs/should_compile/T11670.stderr b/testsuite/tests/partial-sigs/should_compile/T11670.stderr index 8a5a342e81..b64df03c1c 100644 --- a/testsuite/tests/partial-sigs/should_compile/T11670.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T11670.stderr @@ -2,8 +2,8 @@ T11670.hs:10:42: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘CLong’ • In the first argument of ‘IO’, namely ‘_’ - In the type ‘IO _’ In an expression type signature: IO _ + In the expression: peekElemOff undefined 0 :: IO _ • Relevant bindings include ptr :: Ptr a (bound at T11670.hs:10:6) peek :: Ptr a -> IO CLong (bound at T11670.hs:10:1) @@ -27,8 +27,8 @@ T11670.hs:13:48: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] the inferred type of <expression> :: Storable w => IO w at T11670.hs:13:40-48 • In the first argument of ‘IO’, namely ‘_’ - In the type ‘IO _’ In an expression type signature: _ => IO _ + In the expression: peekElemOff undefined 0 :: _ => IO _ • Relevant bindings include ptr :: Ptr a (bound at T11670.hs:13:7) peek2 :: Ptr a -> IO CLong (bound at T11670.hs:13:1) diff --git a/testsuite/tests/partial-sigs/should_compile/T12845.stderr b/testsuite/tests/partial-sigs/should_compile/T12845.stderr index 912784a092..d5600c5f9f 100644 --- a/testsuite/tests/partial-sigs/should_compile/T12845.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T12845.stderr @@ -1,6 +1,6 @@ T12845.hs:18:70: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: broken :: forall r r' rngs. ('(r, r') ~ Head rngs, Bar r r' ~ 'True, diff --git a/testsuite/tests/partial-sigs/should_compile/T14643.stderr b/testsuite/tests/partial-sigs/should_compile/T14643.stderr index cc8920f705..ecc629b76b 100644 --- a/testsuite/tests/partial-sigs/should_compile/T14643.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T14643.stderr @@ -1,8 +1,8 @@ T14643.hs:5:18: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: af :: (Num a, _) => a -> a T14643.hs:5:18: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: ag :: (Num a, _) => a -> a diff --git a/testsuite/tests/partial-sigs/should_compile/T14643a.stderr b/testsuite/tests/partial-sigs/should_compile/T14643a.stderr index d8f7b19a02..8791cf6d6a 100644 --- a/testsuite/tests/partial-sigs/should_compile/T14643a.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T14643a.stderr @@ -1,8 +1,8 @@ T14643a.hs:5:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: af :: (Num a, _) => a -> a T14643a.hs:8:14: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ • In the type signature: ag :: (Num a, _) => a -> a diff --git a/testsuite/tests/partial-sigs/should_compile/T16728.stderr b/testsuite/tests/partial-sigs/should_compile/T16728.stderr index 6768b12d48..b8445729d4 100644 --- a/testsuite/tests/partial-sigs/should_compile/T16728.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T16728.stderr @@ -6,4 +6,4 @@ T16728.hs:8:37: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] at T16728.hs:8:13 • In the kind ‘_’ In the first argument of ‘Proxy’, namely ‘(x :: _)’ - In the type ‘Proxy (x :: _)’ + In the type signature: f :: forall k (x :: k). Proxy (x :: _) diff --git a/testsuite/tests/partial-sigs/should_compile/T16728a.stderr b/testsuite/tests/partial-sigs/should_compile/T16728a.stderr index a78fb1f2a6..20e8d933b6 100644 --- a/testsuite/tests/partial-sigs/should_compile/T16728a.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T16728a.stderr @@ -6,8 +6,7 @@ T16728a.hs:4:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] g :: a -> w h :: a -> w at T16728a.hs:(5,1)-(7,9) - • In the type ‘a -> _’ - In the type signature: g :: forall a. a -> _ + • In the type signature: g :: forall a. a -> _ T16728a.hs:4:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘w’ @@ -16,5 +15,4 @@ T16728a.hs:4:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] g :: a -> w h :: a -> w at T16728a.hs:(5,1)-(7,9) - • In the type ‘a -> _’ - In the type signature: h :: forall a. a -> _ + • In the type signature: h :: forall a. a -> _ diff --git a/testsuite/tests/partial-sigs/should_compile/T16728b.stderr b/testsuite/tests/partial-sigs/should_compile/T16728b.stderr index 02dcbac79e..5f3d0648e0 100644 --- a/testsuite/tests/partial-sigs/should_compile/T16728b.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T16728b.stderr @@ -4,10 +4,8 @@ T16728b.hs:4:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] Where: ‘a’ is a rigid type variable bound by the inferred type of g :: a -> a at T16728b.hs:4:14 - • In the type ‘a -> _’ - In the type signature: g :: forall a. a -> _ + • In the type signature: g :: forall a. a -> _ T16728b.hs:4:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Bool’ - • In the type ‘a -> _’ - In the type signature: h :: forall a. a -> _ + • In the type signature: h :: forall a. a -> _ diff --git a/testsuite/tests/partial-sigs/should_compile/T18008.stderr b/testsuite/tests/partial-sigs/should_compile/T18008.stderr index d5b35c957d..21c75abb52 100644 --- a/testsuite/tests/partial-sigs/should_compile/T18008.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T18008.stderr @@ -1,5 +1,5 @@ T18008.hs:5:43: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘String’ - • In the type ‘(forall a. Show a => a -> String) -> _’ - In the type signature: f :: (forall a. Show a => a -> String) -> _ + • In the type signature: + f :: (forall a. Show a => a -> String) -> _ diff --git a/testsuite/tests/partial-sigs/should_compile/T21667.stderr b/testsuite/tests/partial-sigs/should_compile/T21667.stderr index b76d5bd952..aed4ac1782 100644 --- a/testsuite/tests/partial-sigs/should_compile/T21667.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T21667.stderr @@ -2,5 +2,4 @@ T21667.hs:46:40: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘"1" :: Symbol’ • In the second argument of ‘ExoticTraversal'’, namely ‘_’ - In the type ‘ExoticTraversal' a _ f’ In the type signature: test :: forall a f. ExoticTraversal' a _ f diff --git a/testsuite/tests/partial-sigs/should_compile/T22065.stderr b/testsuite/tests/partial-sigs/should_compile/T22065.stderr index c1ee219723..558ebcc4de 100644 --- a/testsuite/tests/partial-sigs/should_compile/T22065.stderr +++ b/testsuite/tests/partial-sigs/should_compile/T22065.stderr @@ -21,8 +21,7 @@ T22065.hs:12:9: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] Where: ‘w’ is a rigid type variable bound by the inferred type of f :: [w] -> Int at T22065.hs:13:3-19 - • In the type ‘[_] -> Int’ - In the type signature: f :: [_] -> Int + • In the type signature: f :: [_] -> Int In an equation for ‘foo’: foo = Apply f x :: forall a. _ @@ -40,8 +39,7 @@ T22065.hs:15:9: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] Where: ‘w’ is a rigid type variable bound by the inferred type of x :: [w] at T22065.hs:16:3-17 - • In the type ‘[_]’ - In the type signature: x :: [_] + • In the type signature: x :: [_] In an equation for ‘foo’: foo = Apply f x :: forall a. _ diff --git a/testsuite/tests/partial-sigs/should_compile/TypedSplice.stderr b/testsuite/tests/partial-sigs/should_compile/TypedSplice.stderr index 7e48c8f80a..891e71e1ff 100644 --- a/testsuite/tests/partial-sigs/should_compile/TypedSplice.stderr +++ b/testsuite/tests/partial-sigs/should_compile/TypedSplice.stderr @@ -1,9 +1,9 @@ TypedSplice.hs:9:22: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Bool’ - • In the type ‘_ -> _b’ - In an expression type signature: _ -> _b + • In an expression type signature: _ -> _b In the Template Haskell quotation [|| not :: _ -> _b ||] + In the expression: [|| not :: _ -> _b ||] • Relevant bindings include metaExp :: Code Q (Bool -> Bool) (bound at TypedSplice.hs:9:1) diff --git a/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr b/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr index ee483a62a6..16a82f7aba 100644 --- a/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr +++ b/testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr @@ -20,29 +20,25 @@ WarningWildcardInstantiations.hs:5:18: warning: [GHC-88464] [-Wpartial-type-sign WarningWildcardInstantiations.hs:5:30: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘String’ - • In the type ‘_a -> _’ - In the type signature: foo :: (Show _a, _) => _a -> _ + • In the type signature: foo :: (Show _a, _) => _a -> _ WarningWildcardInstantiations.hs:8:8: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘t’ Where: ‘t’ is a rigid type variable bound by the inferred type of bar :: t -> (t -> w) -> w at WarningWildcardInstantiations.hs:9:1-13 - • In the type ‘_ -> _ -> _’ - In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ WarningWildcardInstantiations.hs:8:13: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘t -> w’ Where: ‘t’, ‘w’ are rigid type variables bound by the inferred type of bar :: t -> (t -> w) -> w at WarningWildcardInstantiations.hs:9:1-13 - • In the type ‘_ -> _ -> _’ - In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ WarningWildcardInstantiations.hs:8:18: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘w’ Where: ‘w’ is a rigid type variable bound by the inferred type of bar :: t -> (t -> w) -> w at WarningWildcardInstantiations.hs:9:1-13 - • In the type ‘_ -> _ -> _’ - In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ diff --git a/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr b/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr index eb49a8bfed..4f916c20e2 100644 --- a/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr +++ b/testsuite/tests/partial-sigs/should_fail/PartialTypeSignaturesDisabled.stderr @@ -2,11 +2,9 @@ PartialTypeSignaturesDisabled.hs:4:8: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘Bool’ To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _’ - In the type signature: foo :: _ -> _ + • In the type signature: foo :: _ -> _ PartialTypeSignaturesDisabled.hs:4:13: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘Bool’ To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _’ - In the type signature: foo :: _ -> _ + • In the type signature: foo :: _ -> _ diff --git a/testsuite/tests/partial-sigs/should_fail/T10615.stderr b/testsuite/tests/partial-sigs/should_fail/T10615.stderr index b2390ffa41..8dae5a32f8 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10615.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10615.stderr @@ -3,8 +3,7 @@ T10615.hs:5:7: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘w1’ Where: ‘w1’ is an ambiguous type variable To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> f’ - In the type signature: f1 :: _ -> f + • In the type signature: f1 :: _ -> f T10615.hs:6:6: error: [GHC-25897] • Couldn't match type ‘f’ with ‘b1 -> w1’ @@ -21,8 +20,7 @@ T10615.hs:8:7: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘w0’ Where: ‘w0’ is an ambiguous type variable To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _f’ - In the type signature: f2 :: _ -> _f + • In the type signature: f2 :: _ -> _f T10615.hs:9:6: error: [GHC-25897] • Couldn't match type ‘_f’ with ‘b0 -> w0’ diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.stderr b/testsuite/tests/partial-sigs/should_fail/T10999.stderr index 39e94b5033..aa22ff9944 100644 --- a/testsuite/tests/partial-sigs/should_fail/T10999.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T10999.stderr @@ -13,8 +13,7 @@ T10999.hs:5:17: error: [GHC-88464] the inferred type of f :: Ord a => () -> Set.Set a at T10999.hs:6:1-28 To use the inferred type, enable PartialTypeSignatures - • In the type ‘() -> _’ - In the type signature: f :: _ => () -> _ + • In the type signature: f :: _ => () -> _ T10999.hs:8:28: error: [GHC-39999] • Ambiguous type variable ‘b1’ arising from a use of ‘f’ @@ -25,7 +24,7 @@ T10999.hs:8:28: error: [GHC-39999] instance Ord a => Ord (Set.Set a) -- Defined in ‘Data.Set.Internal’ instance Ord Ordering -- Defined in ‘GHC.Classes’ ...plus 24 others - ...plus two instances involving out-of-scope types + ...plus three instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In the second argument of ‘($)’, namely ‘f ()’ In the second argument of ‘($)’, namely ‘Set.toList $ f ()’ diff --git a/testsuite/tests/partial-sigs/should_fail/T11122.stderr b/testsuite/tests/partial-sigs/should_fail/T11122.stderr index 1a173ec11a..6fbe3ecdce 100644 --- a/testsuite/tests/partial-sigs/should_fail/T11122.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T11122.stderr @@ -2,5 +2,4 @@ T11122.hs:19:18: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘Int’ • In the first argument of ‘Parser’, namely ‘_’ - In the type ‘Parser _’ In the type signature: parser :: Parser _ diff --git a/testsuite/tests/partial-sigs/should_fail/T11515.stderr b/testsuite/tests/partial-sigs/should_fail/T11515.stderr index 389b1331b3..c113d8ad6a 100644 --- a/testsuite/tests/partial-sigs/should_fail/T11515.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T11515.stderr @@ -1,5 +1,5 @@ T11515.hs:7:20: error: [GHC-88464] - • Found extra-constraints wildcard standing for ‘()’ + • Found extra-constraints wildcard standing for ‘() :: Constraint’ To use the inferred type, enable PartialTypeSignatures • In the type signature: foo :: (ShowSyn a, _) => a -> String diff --git a/testsuite/tests/partial-sigs/should_fail/T11976.stderr b/testsuite/tests/partial-sigs/should_fail/T11976.stderr index a2a1fead7d..f50719ac35 100644 --- a/testsuite/tests/partial-sigs/should_fail/T11976.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T11976.stderr @@ -1,6 +1,6 @@ T11976.hs:7:20: error: [GHC-83865] • Expected kind ‘k0 -> *’, but ‘Lens _ _’ has kind ‘*’ - • In the type ‘Lens _ _ _’ - In an expression type signature: Lens _ _ _ + • In an expression type signature: Lens _ _ _ In the expression: undefined :: Lens _ _ _ + In an equation for ‘foo’: foo = undefined :: Lens _ _ _ diff --git a/testsuite/tests/partial-sigs/should_fail/T12634.stderr b/testsuite/tests/partial-sigs/should_fail/T12634.stderr index 19a65352db..3c2eb498d5 100644 --- a/testsuite/tests/partial-sigs/should_fail/T12634.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T12634.stderr @@ -1,10 +1,9 @@ T12634.hs:15:58: error: [GHC-83865] - • Expected a type, but - ‘'(t, m, m', r)’ has kind + • Expected a type, + but ‘'(t, m, m', r)’ has kind ‘(k1 -> k2 -> *, k0, k1, k2)’ • In the first argument of ‘Bench’, namely ‘'(t, m, m', r)’ - In the type ‘t m' r -> Bench '(t, m, m', r)’ In the type signature: bench_twacePow :: forall t m m' r. _ => t m' r -> Bench '(t, m, m', r) diff --git a/testsuite/tests/partial-sigs/should_fail/T14040a.stderr b/testsuite/tests/partial-sigs/should_fail/T14040a.stderr index 6f5ee1ff2e..5614422045 100644 --- a/testsuite/tests/partial-sigs/should_fail/T14040a.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T14040a.stderr @@ -3,17 +3,12 @@ T14040a.hs:26:46: error: [GHC-46956] • Couldn't match kind ‘k1’ with ‘WeirdList z’ Expected kind ‘WeirdList k1’, but ‘xs’ has kind ‘WeirdList (WeirdList z)’ - • because kind variable ‘z’ would escape its scope - This (rigid, skolem) kind variable is bound by - an explicit forall (z :: Type) (x :: z) - (xs :: WeirdList (WeirdList z)) - at T14040a.hs:25:26-77 + because kind variable ‘z’ would escape its scope + This (rigid, skolem) kind variable is bound by + an explicit forall (z :: Type) (x :: z) + (xs :: WeirdList (WeirdList z)) + at T14040a.hs:25:26-77 • In the second argument of ‘p’, namely ‘xs’ - In the type ‘Sing wl - -> (forall (y :: Type). p _ WeirdNil) - -> (forall (z :: Type) (x :: z) (xs :: WeirdList (WeirdList z)). - Sing x -> Sing xs -> p _ xs -> p _ (WeirdCons x xs)) - -> p _ wl’ In the type signature: elimWeirdList :: forall (a :: Type) (wl :: WeirdList a) @@ -33,17 +28,12 @@ T14040a.hs:27:27: error: [GHC-46956] • Couldn't match kind ‘k0’ with ‘z’ Expected kind ‘WeirdList k0’, but ‘WeirdCons x xs’ has kind ‘WeirdList z’ - • because kind variable ‘z’ would escape its scope - This (rigid, skolem) kind variable is bound by - an explicit forall (z :: Type) (x :: z) - (xs :: WeirdList (WeirdList z)) - at T14040a.hs:25:26-77 + because kind variable ‘z’ would escape its scope + This (rigid, skolem) kind variable is bound by + an explicit forall (z :: Type) (x :: z) + (xs :: WeirdList (WeirdList z)) + at T14040a.hs:25:26-77 • In the second argument of ‘p’, namely ‘(WeirdCons x xs)’ - In the type ‘Sing wl - -> (forall (y :: Type). p _ WeirdNil) - -> (forall (z :: Type) (x :: z) (xs :: WeirdList (WeirdList z)). - Sing x -> Sing xs -> p _ xs -> p _ (WeirdCons x xs)) - -> p _ wl’ In the type signature: elimWeirdList :: forall (a :: Type) (wl :: WeirdList a) diff --git a/testsuite/tests/partial-sigs/should_fail/T14584.stderr b/testsuite/tests/partial-sigs/should_fail/T14584.stderr index 67ccd9d0da..fcad722d63 100644 --- a/testsuite/tests/partial-sigs/should_fail/T14584.stderr +++ b/testsuite/tests/partial-sigs/should_fail/T14584.stderr @@ -42,7 +42,8 @@ T14584.hs:57:60: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] the instance declaration at T14584.hs:55:10-89 • In the first argument of ‘Sing’, namely ‘_’ - In the type ‘Sing _’ In an expression type signature: Sing _ + In the second argument of ‘fromSing’, namely + ‘(sing @m @a :: Sing _)’ • Relevant bindings include monHom :: a -> a (bound at T14584.hs:57:3) diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr index b354fd8d01..6b3e70e8b9 100644 --- a/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr +++ b/testsuite/tests/partial-sigs/should_fail/TidyClash.stderr @@ -5,8 +5,7 @@ TidyClash.hs:8:19: error: [GHC-88464] the inferred type of bar :: w_ -> (w_, w1 -> w2) at TidyClash.hs:9:1-28 To use the inferred type, enable PartialTypeSignatures - • In the type ‘w_ -> (w_, _ -> _)’ - In the type signature: bar :: w_ -> (w_, _ -> _) + • In the type signature: bar :: w_ -> (w_, _ -> _) TidyClash.hs:8:24: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘w2’ @@ -14,5 +13,4 @@ TidyClash.hs:8:24: error: [GHC-88464] the inferred type of bar :: w_ -> (w_, w1 -> w2) at TidyClash.hs:9:1-28 To use the inferred type, enable PartialTypeSignatures - • In the type ‘w_ -> (w_, _ -> _)’ - In the type signature: bar :: w_ -> (w_, _ -> _) + • In the type signature: bar :: w_ -> (w_, _ -> _) diff --git a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr index d6c07d7ba7..acab0a2052 100644 --- a/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr +++ b/testsuite/tests/partial-sigs/should_fail/TidyClash2.stderr @@ -5,8 +5,7 @@ TidyClash2.hs:13:20: error: [GHC-88464] the inferred type of barry :: w1 -> w2 -> t at TidyClash2.hs:14:1-40 To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _ -> t’ - In the type signature: barry :: forall t. _ -> _ -> t + • In the type signature: barry :: forall t. _ -> _ -> t TidyClash2.hs:13:25: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘w2’ @@ -14,8 +13,7 @@ TidyClash2.hs:13:25: error: [GHC-88464] the inferred type of barry :: w1 -> w2 -> t at TidyClash2.hs:14:1-40 To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _ -> t’ - In the type signature: barry :: forall t. _ -> _ -> t + • In the type signature: barry :: forall t. _ -> _ -> t TidyClash2.hs:14:13: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘w1’ diff --git a/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr b/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr index a9804d8dcb..7bab8376f9 100644 --- a/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr +++ b/testsuite/tests/partial-sigs/should_fail/WildcardInstantiations.stderr @@ -18,8 +18,7 @@ WildcardInstantiations.hs:5:18: error: [GHC-88464] WildcardInstantiations.hs:5:30: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘String’ To use the inferred type, enable PartialTypeSignatures - • In the type ‘_a -> _’ - In the type signature: foo :: (Show _a, _) => _a -> _ + • In the type signature: foo :: (Show _a, _) => _a -> _ WildcardInstantiations.hs:8:8: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘t’ @@ -27,8 +26,7 @@ WildcardInstantiations.hs:8:8: error: [GHC-88464] the inferred type of bar :: t -> (t -> w) -> w at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _ -> _’ - In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ WildcardInstantiations.hs:8:13: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘t -> w’ @@ -36,8 +34,7 @@ WildcardInstantiations.hs:8:13: error: [GHC-88464] the inferred type of bar :: t -> (t -> w) -> w at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _ -> _’ - In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ WildcardInstantiations.hs:8:18: error: [GHC-88464] • Found type wildcard ‘_’ standing for ‘w’ @@ -45,5 +42,4 @@ WildcardInstantiations.hs:8:18: error: [GHC-88464] the inferred type of bar :: t -> (t -> w) -> w at WildcardInstantiations.hs:9:1-13 To use the inferred type, enable PartialTypeSignatures - • In the type ‘_ -> _ -> _’ - In the type signature: bar :: _ -> _ -> _ + • In the type signature: bar :: _ -> _ -> _ diff --git a/testsuite/tests/perf/compiler/T13035.stderr b/testsuite/tests/perf/compiler/T13035.stderr index 1047391d9d..a3d4e4fded 100644 --- a/testsuite/tests/perf/compiler/T13035.stderr +++ b/testsuite/tests/perf/compiler/T13035.stderr @@ -2,5 +2,4 @@ T13035.hs:144:28: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] • Found type wildcard ‘_’ standing for ‘'[ 'Author] :: [Fields]’ • In the second argument of ‘MyRec’, namely ‘_’ - In the type ‘MyRec RecipeFormatter _’ In the type signature: g :: MyRec RecipeFormatter _ diff --git a/testsuite/tests/pmcheck/should_compile/T11195.hs b/testsuite/tests/pmcheck/should_compile/T11195.hs index dca79500ac..7a7a4b05c5 100644 --- a/testsuite/tests/pmcheck/should_compile/T11195.hs +++ b/testsuite/tests/pmcheck/should_compile/T11195.hs @@ -5,6 +5,7 @@ module T11195 where import GHC.Core.TyCo.Rep import GHC.Core.Coercion import GHC.Core.Type hiding( substTyVarBndr, substTy, extendTCvSubst ) +import GHC.Core.TyCo.Compare import GHC.Core.InstEnv import GHC.Core.Coercion.Axiom import GHC.Tc.Utils.TcType ( exactTyCoVarsOfType ) @@ -61,8 +62,8 @@ opt_transList :: InScopeSet -> [NormalCo] -> [NormalCo] -> [NormalCo] opt_transList is = zipWith (opt_trans is) opt_trans_rule :: InScopeSet -> NormalNonIdCo -> NormalNonIdCo -> Maybe NormalCo -opt_trans_rule is in_co1@(NthCo r1 d1 co1) in_co2@(NthCo r2 d2 co2) - | d1 == d2 +opt_trans_rule is in_co1@(SelCo sel1 co1) in_co2@(SelCo sel2 co2) + | sel1 == sel2 , co1 `compatible_co` co2 = undefined opt_trans_rule is in_co1@(LRCo d1 co1) in_co2@(LRCo d2 co2) diff --git a/testsuite/tests/polykinds/T14172.stderr b/testsuite/tests/polykinds/T14172.stderr index d79af1f7c0..df3868fb6c 100644 --- a/testsuite/tests/polykinds/T14172.stderr +++ b/testsuite/tests/polykinds/T14172.stderr @@ -8,7 +8,8 @@ T14172.hs:7:46: error: [GHC-88464] To use the inferred type, enable PartialTypeSignatures • In the first argument of ‘h’, namely ‘_’ In the first argument of ‘f’, namely ‘(h _)’ - In the type ‘(a -> f b) -> g a -> f (h _)’ + In the type signature: + traverseCompose :: (a -> f b) -> g a -> f (h _) T14172.hs:8:19: error: [GHC-25897] • Couldn't match type ‘a’ with ‘g'1 a'0’ diff --git a/testsuite/tests/polykinds/T14265.stderr b/testsuite/tests/polykinds/T14265.stderr index 7f782ff8fc..fad85e9696 100644 --- a/testsuite/tests/polykinds/T14265.stderr +++ b/testsuite/tests/polykinds/T14265.stderr @@ -6,7 +6,6 @@ T14265.hs:7:12: error: [GHC-88464] at T14265.hs:8:1-8 To use the inferred type, enable PartialTypeSignatures • In the first argument of ‘proxy’, namely ‘_’ - In the type ‘proxy _ -> ()’ In the type signature: f :: proxy _ -> () T14265.hs:10:15: error: [GHC-88464] @@ -16,7 +15,6 @@ T14265.hs:10:15: error: [GHC-88464] at T14265.hs:11:1-15 To use the inferred type, enable PartialTypeSignatures • In the first argument of ‘StateT’, namely ‘_’ - In the type ‘StateT _ _ ()’ In the type signature: foo :: StateT _ _ () T14265.hs:10:17: error: [GHC-88464] @@ -26,5 +24,4 @@ T14265.hs:10:17: error: [GHC-88464] at T14265.hs:11:1-15 To use the inferred type, enable PartialTypeSignatures • In the second argument of ‘StateT’, namely ‘_’ - In the type ‘StateT _ _ ()’ In the type signature: foo :: StateT _ _ () diff --git a/testsuite/tests/rep-poly/RepPolyClassMethod.stderr b/testsuite/tests/rep-poly/RepPolyClassMethod.stderr index f4999c7b5c..a5fabd8515 100644 --- a/testsuite/tests/rep-poly/RepPolyClassMethod.stderr +++ b/testsuite/tests/rep-poly/RepPolyClassMethod.stderr @@ -1,6 +1,7 @@ RepPolyClassMethod.hs:10:12: error: [GHC-25897] - • Expected a type, but ‘a’ has kind ‘TYPE rep’ + • Couldn't match kind ‘rep’ with ‘LiftedRep’ + Expected kind ‘*’, but ‘a’ has kind ‘TYPE rep’ ‘rep’ is a rigid type variable bound by the class declaration for ‘C’ at RepPolyClassMethod.hs:8:18-20 diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index a1d95b7298..306352681e 100644 --- a/testsuite/tests/roles/should_compile/Roles14.stderr +++ b/testsuite/tests/roles/should_compile/Roles14.stderr @@ -6,7 +6,7 @@ TYPE CONSTRUCTORS COERCION AXIOMS axiom Roles12.N:C2 :: C2 a = a -> a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.17.0.0] ==================== Typechecker ==================== Roles12.$tcC2 @@ -17,14 +17,13 @@ Roles12.$tc'C:C2 = GHC.Types.TyCon 7087988437584478859##64 11477953550142401435##64 Roles12.$trModule (GHC.Types.TrNameS "'C:C2"#) 1# $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep []) + = GHC.Types.KindRepFun GHC.Types.krep$* GHC.Types.krep$Constraint Roles12.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles12"#) diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index 41016dd5b8..01b0bf9f09 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -21,7 +21,7 @@ COERCION AXIOMS axiom Roles3.N:C3 :: C3 a b = a -> F3 b -> F3 b axiom Roles3.N:C4 :: C4 a b = a -> F4 b -> F4 b Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.17.0.0] ==================== Typechecker ==================== Roles3.$tcC4 @@ -48,24 +48,23 @@ Roles3.$tc'C:C1 = GHC.Types.TyCon 4508088879886988796##64 13962145553903222779##64 Roles3.$trModule (GHC.Types.TrNameS "'C:C1"#) 1# $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp + GHC.Types.$tc~ ((:) GHC.Types.krep$* ((:) $krep ((:) $krep []))) +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp Roles3.$tcC2 ((:) $krep ((:) $krep [])) +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] + = GHC.Types.KindRepFun GHC.Types.krep$* GHC.Types.krep$Constraint $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp - GHC.Types.$tc~ ((:) GHC.Types.krep$* ((:) $krep ((:) $krep []))) -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp Roles3.$tcC2 ((:) $krep ((:) $krep [])) -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp Roles3.$tcC1 ((:) $krep []) Roles3.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles3"#) diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index d4efc75d76..9814844c3d 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -9,7 +9,7 @@ COERCION AXIOMS axiom Roles4.N:C1 :: C1 a = a -> a axiom Roles4.N:C3 :: C3 a = a -> Syn1 a Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.17.0.0] ==================== Typechecker ==================== Roles4.$tcC3 @@ -28,20 +28,19 @@ Roles4.$tc'C:C1 = GHC.Types.TyCon 3870707671502302648##64 10631907186261837450##64 Roles4.$trModule (GHC.Types.TrNameS "'C:C1"#) 1# $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep []) +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp GHC.Types.$tcList ((:) $krep []) -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep []) + = GHC.Types.KindRepFun GHC.Types.krep$* GHC.Types.krep$Constraint $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep []) + = GHC.Types.KindRepTyConApp GHC.Types.$tcList ((:) $krep []) Roles4.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles4"#) diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index 469188e621..028f92c498 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -16,7 +16,7 @@ CLASS INSTANCES -- Defined at T8958.hs:11:10 instance [incoherent] Nominal a -- Defined at T8958.hs:8:10 Dependent modules: [] -Dependent packages: [base-4.16.0.0] +Dependent packages: [base-4.17.0.0] ==================== Typechecker ==================== T8958.$tcMap @@ -46,7 +46,8 @@ T8958.$tc'C:Nominal $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepFun GHC.Types.krep$* GHC.Types.krep$Constraint $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Tuple.Prim.$tc(,) @@ -63,9 +64,6 @@ $krep [InlPrag=[~]] ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep) $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp - GHC.Types.$tcConstraint [] @GHC.Types.KindRep -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp T8958.$tcRepresentational ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep) $krep [InlPrag=[~]] diff --git a/testsuite/tests/saks/should_compile/saks007.hs b/testsuite/tests/saks/should_compile/saks007.hs index 7f6869576b..0d3a94f9c9 100644 --- a/testsuite/tests/saks/should_compile/saks007.hs +++ b/testsuite/tests/saks/should_compile/saks007.hs @@ -13,3 +13,28 @@ type X :: forall k1 k2. (F k1 ~ G k2) => k1 -> k2 -> Type data X a b where MkX :: X Integer Maybe -- OK: F Type ~ G (Type -> Type) -- True ~ True + + +{- +Let co :: F Type ~ G (Type->Type) + +Wrapper data con type: + $WMkX :: X @Type @(Type->Type) @(Eq# co) Integer Maybe + +Worker data con's type: + MkX :: forall k1 k2 (c :: F k1 ~ G k2) (a :: k1) (b :: k2) + -> forall . -- No existentials + ( k1 ~# Type, k2 ~# Type->Type -- EqSpec + , a ~# Integer, b ~# Maybe ) + => X k1 k2 c a b + +f :: forall k. (k ~ Type) => forall (a::k). a->a + + +f :: forall (cv :: a ~# b) => ....ty|>co.... + + +X @kk1 @kk2 @(d :: F kk1 ~ G kk2) Integer Maybe + + +-}
\ No newline at end of file diff --git a/testsuite/tests/saks/should_fail/saks_fail012.stderr b/testsuite/tests/saks/should_fail/saks_fail012.stderr index fe582d980c..5d4970864b 100644 --- a/testsuite/tests/saks/should_fail/saks_fail012.stderr +++ b/testsuite/tests/saks/should_fail/saks_fail012.stderr @@ -1,5 +1,6 @@ saks_fail012.hs:8:1: error: [GHC-83865] - • Couldn't match expected kind ‘Constraint’ - with actual kind ‘* -> Constraint’ + • Expected a constraint, + but found something with kind + ‘* -> Constraint’ • In the class declaration for ‘C’ diff --git a/testsuite/tests/stranal/should_compile/T18982.stderr b/testsuite/tests/stranal/should_compile/T18982.stderr index 9b1f852dda..251e639c1f 100644 --- a/testsuite/tests/stranal/should_compile/T18982.stderr +++ b/testsuite/tests/stranal/should_compile/T18982.stderr @@ -4,15 +4,15 @@ Result size of Tidy Core = {terms: 311, types: 214, coercions: 4, joins: 0/0} -- RHS size: {terms: 8, types: 9, coercions: 1, joins: 0/0} T18982.$WExGADT :: forall e. (e ~ Int) => e %1 -> Int %1 -> ExGADT Int -T18982.$WExGADT = \ (@e) (dt :: e ~ Int) (dt :: e) (dt :: Int) -> T18982.ExGADT @Int @e @~(<Int>_N :: Int GHC.Prim.~# Int) dt dt dt +T18982.$WExGADT = \ (@e) (conrep :: e ~ Int) (conrep :: e) (conrep :: Int) -> T18982.ExGADT @Int @e @~(<Int>_N :: Int GHC.Prim.~# Int) conrep conrep conrep -- RHS size: {terms: 3, types: 2, coercions: 1, joins: 0/0} T18982.$WGADT :: Int %1 -> GADT Int -T18982.$WGADT = \ (dt :: Int) -> T18982.GADT @Int @~(<Int>_N :: Int GHC.Prim.~# Int) dt +T18982.$WGADT = \ (conrep :: Int) -> T18982.GADT @Int @~(<Int>_N :: Int GHC.Prim.~# Int) conrep -- RHS size: {terms: 7, types: 6, coercions: 0, joins: 0/0} T18982.$WEx :: forall e a. e %1 -> a %1 -> Ex a -T18982.$WEx = \ (@e) (@a) (dt :: e) (dt :: a) -> T18982.Ex @a @e dt dt +T18982.$WEx = \ (@e) (@a) (conrep :: e) (conrep :: a) -> T18982.Ex @a @e conrep conrep -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T18982.$trModule4 :: GHC.Prim.Addr# @@ -72,7 +72,7 @@ T18982.$tcBox1 = GHC.Types.TrNameS T18982.$tcBox2 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tcBox :: GHC.Types.TyCon -T18982.$tcBox = GHC.Types.TyCon 16948648223906549518## 2491460178135962649## T18982.$trModule T18982.$tcBox1 0# GHC.Types.krep$*Arr* +T18982.$tcBox = GHC.Types.TyCon 16948648223906549518##64 2491460178135962649##64 T18982.$trModule T18982.$tcBox1 0# GHC.Types.krep$*Arr* -- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} $krep7 :: [GHC.Types.KindRep] @@ -96,7 +96,7 @@ T18982.$tc'Box2 = GHC.Types.TrNameS T18982.$tc'Box3 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tc'Box :: GHC.Types.TyCon -T18982.$tc'Box = GHC.Types.TyCon 1412068769125067428## 8727214667407894081## T18982.$trModule T18982.$tc'Box2 1# T18982.$tc'Box1 +T18982.$tc'Box = GHC.Types.TyCon 1412068769125067428##64 8727214667407894081##64 T18982.$trModule T18982.$tc'Box2 1# T18982.$tc'Box1 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T18982.$tcEx2 :: GHC.Prim.Addr# @@ -108,7 +108,7 @@ T18982.$tcEx1 = GHC.Types.TrNameS T18982.$tcEx2 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tcEx :: GHC.Types.TyCon -T18982.$tcEx = GHC.Types.TyCon 4376661818164435927## 18005417598910668817## T18982.$trModule T18982.$tcEx1 0# GHC.Types.krep$*Arr* +T18982.$tcEx = GHC.Types.TyCon 4376661818164435927##64 18005417598910668817##64 T18982.$trModule T18982.$tcEx1 0# GHC.Types.krep$*Arr* -- RHS size: {terms: 3, types: 2, coercions: 0, joins: 0/0} $krep9 :: [GHC.Types.KindRep] @@ -136,7 +136,7 @@ T18982.$tc'Ex2 = GHC.Types.TrNameS T18982.$tc'Ex3 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tc'Ex :: GHC.Types.TyCon -T18982.$tc'Ex = GHC.Types.TyCon 14609381081172201359## 3077219645053200509## T18982.$trModule T18982.$tc'Ex2 2# T18982.$tc'Ex1 +T18982.$tc'Ex = GHC.Types.TyCon 14609381081172201359##64 3077219645053200509##64 T18982.$trModule T18982.$tc'Ex2 2# T18982.$tc'Ex1 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T18982.$tcGADT2 :: GHC.Prim.Addr# @@ -148,7 +148,7 @@ T18982.$tcGADT1 = GHC.Types.TrNameS T18982.$tcGADT2 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tcGADT :: GHC.Types.TyCon -T18982.$tcGADT = GHC.Types.TyCon 9243924476135839950## 5096619276488416461## T18982.$trModule T18982.$tcGADT1 0# GHC.Types.krep$*Arr* +T18982.$tcGADT = GHC.Types.TyCon 9243924476135839950##64 5096619276488416461##64 T18982.$trModule T18982.$tcGADT1 0# GHC.Types.krep$*Arr* -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} $krep12 :: GHC.Types.KindRep @@ -168,7 +168,7 @@ T18982.$tc'GADT2 = GHC.Types.TrNameS T18982.$tc'GADT3 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tc'GADT :: GHC.Types.TyCon -T18982.$tc'GADT = GHC.Types.TyCon 2077850259354179864## 16731205864486799217## T18982.$trModule T18982.$tc'GADT2 0# T18982.$tc'GADT1 +T18982.$tc'GADT = GHC.Types.TyCon 2077850259354179864##64 16731205864486799217##64 T18982.$trModule T18982.$tc'GADT2 0# T18982.$tc'GADT1 -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} T18982.$tcExGADT2 :: GHC.Prim.Addr# @@ -180,7 +180,7 @@ T18982.$tcExGADT1 = GHC.Types.TrNameS T18982.$tcExGADT2 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tcExGADT :: GHC.Types.TyCon -T18982.$tcExGADT = GHC.Types.TyCon 6470898418160489500## 10361108917441214060## T18982.$trModule T18982.$tcExGADT1 0# GHC.Types.krep$*Arr* +T18982.$tcExGADT = GHC.Types.TyCon 6470898418160489500##64 10361108917441214060##64 T18982.$trModule T18982.$tcExGADT1 0# GHC.Types.krep$*Arr* -- RHS size: {terms: 3, types: 0, coercions: 0, joins: 0/0} $krep13 :: GHC.Types.KindRep @@ -208,10 +208,10 @@ T18982.$tc'ExGADT2 = GHC.Types.TrNameS T18982.$tc'ExGADT3 -- RHS size: {terms: 7, types: 0, coercions: 0, joins: 0/0} T18982.$tc'ExGADT :: GHC.Types.TyCon -T18982.$tc'ExGADT = GHC.Types.TyCon 8468257409157161049## 5503123603717080600## T18982.$trModule T18982.$tc'ExGADT2 1# T18982.$tc'ExGADT1 +T18982.$tc'ExGADT = GHC.Types.TyCon 8468257409157161049##64 5503123603717080600##64 T18982.$trModule T18982.$tc'ExGADT2 1# T18982.$tc'ExGADT1 -- RHS size: {terms: 11, types: 10, coercions: 0, joins: 0/0} -T18982.$wi :: forall {a} {e}. (a GHC.Prim.~# Int) -> e -> GHC.Prim.Int# -> GHC.Prim.Int# +T18982.$wi :: forall {a} {e}. (a GHC.Prim.~# Int) => e -> GHC.Prim.Int# -> GHC.Prim.Int# T18982.$wi = \ (@a) (@e) (ww :: a GHC.Prim.~# Int) (ww1 :: e) (ww2 :: GHC.Prim.Int#) -> case ww1 of { __DEFAULT -> GHC.Prim.+# ww2 1# } -- RHS size: {terms: 15, types: 22, coercions: 1, joins: 0/0} @@ -219,7 +219,7 @@ i :: forall a. ExGADT a -> Int i = \ (@a) (ds :: ExGADT a) -> case ds of { ExGADT @e ww ww1 ww2 ww3 -> case ww3 of { GHC.Types.I# ww4 -> case T18982.$wi @a @e @~(ww :: a GHC.Prim.~# Int) ww2 ww4 of ww5 { __DEFAULT -> GHC.Types.I# ww5 } } } -- RHS size: {terms: 6, types: 7, coercions: 0, joins: 0/0} -T18982.$wh :: forall {a}. (a GHC.Prim.~# Int) -> GHC.Prim.Int# -> GHC.Prim.Int# +T18982.$wh :: forall {a}. (a GHC.Prim.~# Int) => GHC.Prim.Int# -> GHC.Prim.Int# T18982.$wh = \ (@a) (ww :: a GHC.Prim.~# Int) (ww1 :: GHC.Prim.Int#) -> GHC.Prim.+# ww1 1# -- RHS size: {terms: 14, types: 15, coercions: 1, joins: 0/0} diff --git a/testsuite/tests/tcplugins/ArgsPlugin.hs b/testsuite/tests/tcplugins/ArgsPlugin.hs index cb193db05b..94f4dbe9d6 100644 --- a/testsuite/tests/tcplugins/ArgsPlugin.hs +++ b/testsuite/tests/tcplugins/ArgsPlugin.hs @@ -17,7 +17,7 @@ import GHC.Core.DataCon ( classDataCon ) import GHC.Core.Make ( mkCoreConApps, mkIntegerExpr ) -import GHC.Core.Type +import GHC.Core.TyCo.Compare ( eqType ) import GHC.Plugins ( Plugin ) diff --git a/testsuite/tests/tcplugins/EmitWantedPlugin.hs b/testsuite/tests/tcplugins/EmitWantedPlugin.hs index 744c76623b..d43f4667ad 100644 --- a/testsuite/tests/tcplugins/EmitWantedPlugin.hs +++ b/testsuite/tests/tcplugins/EmitWantedPlugin.hs @@ -19,7 +19,7 @@ import GHC.Core.DataCon ( classDataCon ) import GHC.Core.Make ( mkCoreConApps, unitExpr ) -import GHC.Core.Type +import GHC.Core.TyCo.Compare ( eqType ) import GHC.Core.Utils ( mkCast ) diff --git a/testsuite/tests/tcplugins/RewritePerfPlugin.hs b/testsuite/tests/tcplugins/RewritePerfPlugin.hs index b2fab46eb5..54a45306b3 100644 --- a/testsuite/tests/tcplugins/RewritePerfPlugin.hs +++ b/testsuite/tests/tcplugins/RewritePerfPlugin.hs @@ -12,8 +12,10 @@ import GHC.Core.TyCo.Rep ( Type, UnivCoProvenance(PluginProv) ) import GHC.Core.TyCon ( TyCon ) +import GHC.Core.TyCo.Compare + ( eqType ) import GHC.Core.Type - ( eqType, mkTyConApp, splitTyConApp_maybe ) + ( mkTyConApp, splitTyConApp_maybe ) import GHC.Plugins ( Plugin(..), defaultPlugin, purePlugin ) import GHC.Tc.Plugin diff --git a/testsuite/tests/tcplugins/RewritePlugin.hs b/testsuite/tests/tcplugins/RewritePlugin.hs index c9a3d6fe91..10aa7574a4 100644 --- a/testsuite/tests/tcplugins/RewritePlugin.hs +++ b/testsuite/tests/tcplugins/RewritePlugin.hs @@ -25,8 +25,10 @@ import GHC.Core.TyCo.Rep ( Type, UnivCoProvenance(PluginProv) ) import GHC.Core.TyCon ( TyCon ) +import GHC.Core.TyCo.Compare + ( eqType ) import GHC.Core.Type - ( eqType, mkTyConApp, splitTyConApp_maybe ) + ( mkTyConApp, splitTyConApp_maybe ) import GHC.Plugins ( Plugin ) import GHC.Tc.Plugin diff --git a/testsuite/tests/tcplugins/TyFamPlugin.hs b/testsuite/tests/tcplugins/TyFamPlugin.hs index c7d5d75d42..263062082b 100644 --- a/testsuite/tests/tcplugins/TyFamPlugin.hs +++ b/testsuite/tests/tcplugins/TyFamPlugin.hs @@ -21,8 +21,10 @@ import GHC.Core.Predicate ) import GHC.Core.TyCo.Rep ( Type, UnivCoProvenance(PluginProv) ) +import GHC.Core.TyCo.Compare + ( eqType ) import GHC.Core.Type - ( eqType, mkTyConApp, splitTyConApp_maybe ) + ( mkTyConApp, splitTyConApp_maybe ) import GHC.Plugins ( Plugin ) import GHC.Tc.Plugin diff --git a/testsuite/tests/th/T15433a.stderr b/testsuite/tests/th/T15433a.stderr index 5661f88dd2..4cdc8759f4 100644 --- a/testsuite/tests/th/T15433a.stderr +++ b/testsuite/tests/th/T15433a.stderr @@ -1,5 +1,5 @@ T15433a.hs:7:11: error: [GHC-65507] • Wildcard ‘_’ not allowed - • In the type ‘(_)’ + • In the type ‘_’ In the type declaration for ‘T’ diff --git a/testsuite/tests/typecheck/no_skolem_info/T14040.stderr b/testsuite/tests/typecheck/no_skolem_info/T14040.stderr index c0327bc919..c5e44796e1 100644 --- a/testsuite/tests/typecheck/no_skolem_info/T14040.stderr +++ b/testsuite/tests/typecheck/no_skolem_info/T14040.stderr @@ -3,17 +3,12 @@ T14040.hs:27:46: error: [GHC-46956] • Couldn't match kind ‘k1’ with ‘WeirdList z’ Expected kind ‘WeirdList k1’, but ‘xs’ has kind ‘WeirdList (WeirdList z)’ - • because kind variable ‘z’ would escape its scope - This (rigid, skolem) kind variable is bound by - an explicit forall (z :: Type) (x :: z) - (xs :: WeirdList (WeirdList z)) - at T14040.hs:26:26-77 + because kind variable ‘z’ would escape its scope + This (rigid, skolem) kind variable is bound by + an explicit forall (z :: Type) (x :: z) + (xs :: WeirdList (WeirdList z)) + at T14040.hs:26:26-77 • In the second argument of ‘p’, namely ‘xs’ - In the type ‘Sing wl - -> (forall (y :: Type). p _ WeirdNil) - -> (forall (z :: Type) (x :: z) (xs :: WeirdList (WeirdList z)). - Sing x -> Sing xs -> p _ xs -> p _ (WeirdCons x xs)) - -> p _ wl’ In the type signature: elimWeirdList :: forall (a :: Type) (wl :: WeirdList a) @@ -33,17 +28,12 @@ T14040.hs:28:27: error: [GHC-46956] • Couldn't match kind ‘k0’ with ‘z’ Expected kind ‘WeirdList k0’, but ‘WeirdCons x xs’ has kind ‘WeirdList z’ - • because kind variable ‘z’ would escape its scope - This (rigid, skolem) kind variable is bound by - an explicit forall (z :: Type) (x :: z) - (xs :: WeirdList (WeirdList z)) - at T14040.hs:26:26-77 + because kind variable ‘z’ would escape its scope + This (rigid, skolem) kind variable is bound by + an explicit forall (z :: Type) (x :: z) + (xs :: WeirdList (WeirdList z)) + at T14040.hs:26:26-77 • In the second argument of ‘p’, namely ‘(WeirdCons x xs)’ - In the type ‘Sing wl - -> (forall (y :: Type). p _ WeirdNil) - -> (forall (z :: Type) (x :: z) (xs :: WeirdList (WeirdList z)). - Sing x -> Sing xs -> p _ xs -> p _ (WeirdCons x xs)) - -> p _ wl’ In the type signature: elimWeirdList :: forall (a :: Type) (wl :: WeirdList a) diff --git a/testsuite/tests/typecheck/should_compile/T17021a.hs b/testsuite/tests/typecheck/should_compile/T17021a.hs index 6412452680..aa78cb2959 100644 --- a/testsuite/tests/typecheck/should_compile/T17021a.hs +++ b/testsuite/tests/typecheck/should_compile/T17021a.hs @@ -9,8 +9,16 @@ import GHC.Exts type family Id x where Id x = x -type LevId :: TYPE (Id LiftedRep) -> TYPE (Id LiftedRep) -newtype LevId x = MkLevId x +--type LevId :: TYPE (Id LiftedRep) -> TYPE (Id LiftedRep) +--newtype LevId x = MkLevId x type LevId2 :: (r ~ Id LiftedRep) => TYPE r -> TYPE r newtype LevId2 x = MkLevId2 x + +{- +MkLevId2 :: forall (r :: RuntimeRep). + forall (c :: r ~ Id LiftedRep) -> -- c is a TyVar + forall (x :: TYPE r). + x -> LevId2 @r @c x + +-}
\ No newline at end of file diff --git a/testsuite/tests/typecheck/should_compile/T17024.stderr b/testsuite/tests/typecheck/should_compile/T17024.stderr index f7d1672553..2073631d69 100644 --- a/testsuite/tests/typecheck/should_compile/T17024.stderr +++ b/testsuite/tests/typecheck/should_compile/T17024.stderr @@ -4,5 +4,4 @@ T17024.hs:18:42: warning: [GHC-88464] [-Wpartial-type-signatures (in -Wdefault)] Where: ‘c’ is a rigid type variable bound by the inferred type of foo :: (a -> b -> c) -> HList '[a, b] -> c at T17024.hs:18:1-42 - • In the type ‘(a -> b -> c) -> HList '[a, b] -> _’ - In the type signature: foo :: (a -> b -> c) -> HList '[a, b] -> _ + • In the type signature: foo :: (a -> b -> c) -> HList '[a, b] -> _ diff --git a/testsuite/tests/typecheck/should_compile/T18406b.stderr b/testsuite/tests/typecheck/should_compile/T18406b.stderr index 1faf158c36..ef577ce2d8 100644 --- a/testsuite/tests/typecheck/should_compile/T18406b.stderr +++ b/testsuite/tests/typecheck/should_compile/T18406b.stderr @@ -17,20 +17,18 @@ Bug.$tc'C:C = GHC.Types.TyCon 302756782745842909##64 14248103394115774781##64 Bug.$trModule (GHC.Types.TrNameS "'C:C"#) 2# $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp + Bug.$tcC + ((:) @GHC.Types.KindRep + $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp - GHC.Types.$tcConstraint [] @GHC.Types.KindRep -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp - Bug.$tcC - ((:) @GHC.Types.KindRep - $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) + = GHC.Types.KindRepFun GHC.Types.krep$* GHC.Types.krep$Constraint Bug.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Bug"#) diff --git a/testsuite/tests/typecheck/should_compile/T18529.stderr b/testsuite/tests/typecheck/should_compile/T18529.stderr index 71bb9d715b..f5a37a5342 100644 --- a/testsuite/tests/typecheck/should_compile/T18529.stderr +++ b/testsuite/tests/typecheck/should_compile/T18529.stderr @@ -17,23 +17,22 @@ Bug.$tc'C:C = GHC.Types.TyCon 302756782745842909##64 14248103394115774781##64 Bug.$trModule (GHC.Types.TrNameS "'C:C"#) 2# $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp + Bug.$tcC + ((:) @GHC.Types.KindRep + $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep -$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp - GHC.Types.$tcConstraint [] @GHC.Types.KindRep -$krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp GHC.Tuple.Prim.$tc() [] @GHC.Types.KindRep + = GHC.Types.KindRepFun GHC.Types.krep$* GHC.Types.krep$Constraint $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp - Bug.$tcC - ((:) @GHC.Types.KindRep - $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) + GHC.Tuple.Prim.$tc() [] @GHC.Types.KindRep Bug.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Bug"#) diff --git a/testsuite/tests/typecheck/should_fail/LevPolyBounded.stderr b/testsuite/tests/typecheck/should_fail/LevPolyBounded.stderr index 4ff98786d5..69e24ad5f8 100644 --- a/testsuite/tests/typecheck/should_fail/LevPolyBounded.stderr +++ b/testsuite/tests/typecheck/should_fail/LevPolyBounded.stderr @@ -1,6 +1,7 @@ LevPolyBounded.hs:11:15: error: [GHC-25897] - • Expected a type, but ‘a’ has kind ‘TYPE r’ + • Couldn't match kind ‘r’ with ‘LiftedRep’ + Expected kind ‘*’, but ‘a’ has kind ‘TYPE r’ ‘r’ is a rigid type variable bound by the class declaration for ‘XBounded’ at LevPolyBounded.hs:10:17-27 @@ -8,7 +9,8 @@ LevPolyBounded.hs:11:15: error: [GHC-25897] In the class declaration for ‘XBounded’ LevPolyBounded.hs:12:15: error: [GHC-25897] - • Expected a type, but ‘a’ has kind ‘TYPE r’ + • Couldn't match kind ‘r’ with ‘LiftedRep’ + Expected kind ‘*’, but ‘a’ has kind ‘TYPE r’ ‘r’ is a rigid type variable bound by the class declaration for ‘XBounded’ at LevPolyBounded.hs:10:17-27 diff --git a/testsuite/tests/typecheck/should_fail/T11112.stderr b/testsuite/tests/typecheck/should_fail/T11112.stderr index 08afdc44ea..64138ab267 100644 --- a/testsuite/tests/typecheck/should_fail/T11112.stderr +++ b/testsuite/tests/typecheck/should_fail/T11112.stderr @@ -1,4 +1,4 @@ T11112.hs:3:9: error: [GHC-83865] - • Expected a type, but ‘Ord s’ has kind ‘Constraint’ + • Expected a type, but ‘Ord s’ is a constraint • In the type signature: sort :: Ord s -> [s] -> [s] diff --git a/testsuite/tests/typecheck/should_fail/T13677.stderr b/testsuite/tests/typecheck/should_fail/T13677.stderr index 09dac46a9d..c72f80e782 100644 --- a/testsuite/tests/typecheck/should_fail/T13677.stderr +++ b/testsuite/tests/typecheck/should_fail/T13677.stderr @@ -1,4 +1,4 @@ T13677.hs:10:8: error: [GHC-83865] - • Expected a constraint, but ‘Dict (Int ~ Int)’ has kind ‘*’ + • Expected a constraint, but ‘Dict (Int ~ Int)’ is a type • In the type signature: foo :: Dict (Int ~ Int) => Int diff --git a/testsuite/tests/typecheck/should_fail/T15648.stderr b/testsuite/tests/typecheck/should_fail/T15648.stderr index a8df34b3f6..efd83af7a7 100644 --- a/testsuite/tests/typecheck/should_fail/T15648.stderr +++ b/testsuite/tests/typecheck/should_fail/T15648.stderr @@ -1,30 +1,6 @@ -T15648.hs:23:21: error: [GHC-83865] - • Couldn't match type: (a0 GHC.Prim.~# b0) -> JankyEquality a0 b0 - with: JankyEquality a a - Expected: JankyEquality a b - Actual: (a0 GHC.Prim.~# b0) -> JankyEquality a0 b0 - • Probable cause: ‘Jank’ is applied to too few arguments - In the expression: Jank - In an equation for ‘legitToJank’: legitToJank Legit = Jank - • Relevant bindings include - legitToJank :: LegitEquality a b -> JankyEquality a b - (bound at T15648.hs:23:1) - -T15648.hs:30:33: error: [GHC-25897] - • Couldn't match expected type ‘a’ with actual type ‘b’ - ‘b’ is a rigid type variable bound by - the type signature for: - ueqSym :: forall a b. (a GHC.Prim.~# b) -> b GHC.Prim.~# a - at T15648.hs:(28,1)-(29,32) - ‘a’ is a rigid type variable bound by - the type signature for: - ueqSym :: forall a b. (a GHC.Prim.~# b) -> b GHC.Prim.~# a - at T15648.hs:(28,1)-(29,32) - • In the second argument of ‘($)’, namely ‘mkLegit @b @a’ - In the second argument of ‘($)’, namely - ‘legitToJank $ mkLegit @b @a’ - In the expression: unJank $ legitToJank $ mkLegit @b @a - • Relevant bindings include - ueqSym :: (a GHC.Prim.~# b) -> b GHC.Prim.~# a - (bound at T15648.hs:30:1) +T15648.hs:17:11: error: [GHC-83865] + • Expected a type, but ‘(GHC.Prim.~#) a b’ is a constraint + • In the type ‘(GHC.Prim.~#) a b’ + In the definition of data constructor ‘Jank’ + In the data declaration for ‘JankyEquality’ diff --git a/testsuite/tests/typecheck/should_fail/T21530a.hs b/testsuite/tests/typecheck/should_fail/T21530a.hs new file mode 100644 index 0000000000..b7ac175eda --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21530a.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TypeApplications #-} + +module T21530a where + +import Data.Kind +import Data.Proxy + +f :: forall (a :: Type). Proxy a -> Int +f = f + +g :: Proxy (Eq Int) +g = g + +h = f g diff --git a/testsuite/tests/typecheck/should_fail/T21530a.stderr b/testsuite/tests/typecheck/should_fail/T21530a.stderr new file mode 100644 index 0000000000..08cd8c3986 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21530a.stderr @@ -0,0 +1,11 @@ + +T21530a.hs:14:7: error: [GHC-18872] + • Couldn't match kind ‘Constraint’ with ‘*’ + When matching types + a0 :: * + Eq Int :: Constraint + Expected: Proxy a0 + Actual: Proxy (Eq Int) + • In the first argument of ‘f’, namely ‘g’ + In the expression: f g + In an equation for ‘h’: h = f g diff --git a/testsuite/tests/typecheck/should_fail/T21530b.hs b/testsuite/tests/typecheck/should_fail/T21530b.hs new file mode 100644 index 0000000000..6502773f1b --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21530b.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE RankNTypes #-} + +module T21530b where + +f :: (forall a. (Show a, Eq a) => a -> String) -> String +f h = h True + +g :: (forall a. Show a => a -> String) -> String +g = f diff --git a/testsuite/tests/typecheck/should_fail/T21530b.stderr b/testsuite/tests/typecheck/should_fail/T21530b.stderr new file mode 100644 index 0000000000..51535d6340 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21530b.stderr @@ -0,0 +1,8 @@ + +T21530b.hs:9:5: error: [GHC-83865] + • Couldn't match type: Eq a => a -> String + with: a -> String + Expected: (forall a. Show a => a -> String) -> String + Actual: (forall a. (Show a, Eq a) => a -> String) -> String + • In the expression: f + In an equation for ‘g’: g = f diff --git a/testsuite/tests/typecheck/should_fail/T3540.stderr b/testsuite/tests/typecheck/should_fail/T3540.stderr index 4ab1495419..8b1f03c3c2 100644 --- a/testsuite/tests/typecheck/should_fail/T3540.stderr +++ b/testsuite/tests/typecheck/should_fail/T3540.stderr @@ -1,20 +1,20 @@ T3540.hs:4:12: error: [GHC-83865] - • Expected a type, but ‘a ~ Int’ has kind ‘Constraint’ + • Expected a type, but ‘a ~ Int’ is a constraint • In the type signature: thing :: (a ~ Int) T3540.hs:7:20: error: [GHC-83865] - • Expected a type, but ‘a ~ Int’ has kind ‘Constraint’ + • Expected a type, but ‘a ~ Int’ is a constraint • In the type signature: thing1 :: Int -> (a ~ Int) T3540.hs:10:13: error: [GHC-83865] - • Expected a type, but ‘a ~ Int’ has kind ‘Constraint’ + • Expected a type, but ‘a ~ Int’ is a constraint • In the type signature: thing2 :: (a ~ Int) -> Int T3540.hs:13:12: error: [GHC-83865] - • Expected a type, but ‘?dude :: Int’ has kind ‘Constraint’ + • Expected a type, but ‘?dude :: Int’ is a constraint • In the type signature: thing3 :: (?dude :: Int) -> Int T3540.hs:16:11: error: [GHC-83865] - • Expected a type, but ‘Eq a’ has kind ‘Constraint’ + • Expected a type, but ‘Eq a’ is a constraint • In the type signature: thing4 :: (Eq a) -> Int diff --git a/testsuite/tests/typecheck/should_fail/T5570.stderr b/testsuite/tests/typecheck/should_fail/T5570.stderr index 06d53d4fed..bce53fe394 100644 --- a/testsuite/tests/typecheck/should_fail/T5570.stderr +++ b/testsuite/tests/typecheck/should_fail/T5570.stderr @@ -1,6 +1,6 @@ T5570.hs:7:16: error: [GHC-83865] - • Expecting a lifted type, but ‘Double#’ is unlifted + • Expected a lifted type, but ‘Double#’ is a DoubleRep type • In the first argument of ‘($)’, namely ‘D#’ In the second argument of ‘($)’, namely ‘D# $ 3.0##’ In the expression: print $ D# $ 3.0## diff --git a/testsuite/tests/typecheck/should_fail/T7609.stderr b/testsuite/tests/typecheck/should_fail/T7609.stderr index f927b3c0b0..bc9e53ad1d 100644 --- a/testsuite/tests/typecheck/should_fail/T7609.stderr +++ b/testsuite/tests/typecheck/should_fail/T7609.stderr @@ -5,7 +5,7 @@ T7609.hs:7:16: error: [GHC-83865] • In the type signature: f :: (a `X` a, Maybe) T7609.hs:10:7: error: [GHC-83865] - • Expected a constraint, but ‘a `X` a’ has kind ‘*’ + • Expected a constraint, but ‘a `X` a’ is a type • In the type signature: g :: (a `X` a) => Maybe T7609.hs:10:19: error: [GHC-83865] diff --git a/testsuite/tests/typecheck/should_fail/T7697.stderr b/testsuite/tests/typecheck/should_fail/T7697.stderr index 4b263e556d..25441edb95 100644 --- a/testsuite/tests/typecheck/should_fail/T7697.stderr +++ b/testsuite/tests/typecheck/should_fail/T7697.stderr @@ -1,4 +1,4 @@ T7697.hs:3:6: error: [GHC-83865] - • Expected a constraint, but ‘Int’ has kind ‘*’ + • Expected a constraint, but ‘Int’ is a type • In the type signature: f :: Int => Int diff --git a/testsuite/tests/typecheck/should_fail/T8806.stderr b/testsuite/tests/typecheck/should_fail/T8806.stderr index f015603b0b..09c21b75ef 100644 --- a/testsuite/tests/typecheck/should_fail/T8806.stderr +++ b/testsuite/tests/typecheck/should_fail/T8806.stderr @@ -1,8 +1,8 @@ T8806.hs:5:6: error: [GHC-83865] - • Expected a constraint, but ‘Int’ has kind ‘*’ + • Expected a constraint, but ‘Int’ is a type • In the type signature: f :: Int => Int T8806.hs:8:7: error: [GHC-83865] - • Expected a constraint, but ‘Int’ has kind ‘*’ + • Expected a constraint, but ‘Int’ is a type • In the type signature: g :: (Int => Show a) => Int diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesFail.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesFail.stderr index 1fc90b22c8..cae6969619 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesFail.stderr +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesFail.stderr @@ -1,6 +1,6 @@ UnliftedNewtypesFail.hs:6:20: error: [GHC-83865] - • Expected a type, but ‘Show Int’ has kind ‘Constraint’ + • Expected a type, but ‘Show Int’ is a constraint • In the type ‘(Show Int)’ In the definition of data constructor ‘Baz’ In the newtype declaration for ‘Baz’ diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesInstanceFail.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesInstanceFail.stderr index 2ca074ff01..e540dac1ff 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesInstanceFail.stderr +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesInstanceFail.stderr @@ -1,7 +1,5 @@ UnliftedNewtypesInstanceFail.hs:13:3: error: [GHC-83865] - • Couldn't match kind ‘'IntRep’ with ‘'WordRep’ - Expected kind ‘TYPE 'WordRep’, - but ‘Bar Bool’ has kind ‘TYPE 'IntRep’ + • Expected a WordRep type, but ‘Bar Bool’ is an IntRep type • In the newtype instance declaration for ‘Bar’ In the instance declaration for ‘Foo Bool’ diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKind.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKind.stderr index 263e4f2920..456556e1c4 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKind.stderr +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKind.stderr @@ -1,6 +1,6 @@ UnliftedNewtypesMismatchedKind.hs:12:10: error: [GHC-83865] - • Expecting a lifted type, but ‘Int#’ is unlifted + • Expected a lifted type, but ‘Int#’ is an IntRep type • In the type ‘Int#’ In the definition of data constructor ‘MkT’ In the newtype declaration for ‘T’ diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKindRecord.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKindRecord.stderr index ab2ebc1a19..c79efed614 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKindRecord.stderr +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMismatchedKindRecord.stderr @@ -1,7 +1,6 @@ UnliftedNewtypesMismatchedKindRecord.hs:11:23: error: [GHC-83865] - • Couldn't match kind ‘'WordRep’ with ‘'IntRep’ - Expected kind ‘TYPE 'IntRep’, but ‘Word#’ has kind ‘TYPE 'WordRep’ + • Expected an IntRep type, but ‘Word#’ is a WordRep type • In the type ‘Word#’ In the definition of data constructor ‘FooC’ In the newtype declaration for ‘Foo’ diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.stderr index c3ae6e01a6..603a2f24df 100644 --- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.stderr +++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.stderr @@ -1,12 +1,12 @@ UnliftedNewtypesMultiFieldGadt.hs:19:11: error: [GHC-83865] - • Expecting an unlifted type, but ‘Bool’ is lifted + • Expected an IntRep type, but ‘Bool’ is a lifted type • In the type ‘Bool’ In the definition of data constructor ‘FooC’ In the newtype declaration for ‘Foo’ UnliftedNewtypesMultiFieldGadt.hs:19:19: error: [GHC-83865] - • Expecting an unlifted type, but ‘Char’ is lifted + • Expected an IntRep type, but ‘Char’ is a lifted type • In the type ‘Char’ In the definition of data constructor ‘FooC’ In the newtype declaration for ‘Foo’ diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 9d97a8ea3f..646e5685c7 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -660,3 +660,5 @@ test('T21158', normal, compile_fail, ['']) test('T21583', normal, compile_fail, ['']) test('MissingDefaultMethodBinding', normal, compile_fail, ['']) test('T21447', normal, compile_fail, ['']) +test('T21530a', normal, compile_fail, ['']) +test('T21530b', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/tcfail057.stderr b/testsuite/tests/typecheck/should_fail/tcfail057.stderr index afe8f8aa50..49bb567a51 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail057.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail057.stderr @@ -1,4 +1,4 @@ tcfail057.hs:5:7: error: [GHC-83865] - • Expected a type, but ‘RealFrac a’ has kind ‘Constraint’ + • Expected a type, but ‘RealFrac a’ is a constraint • In the type signature: f :: (RealFrac a) -> a -> a diff --git a/testsuite/tests/typecheck/should_fail/tcfail146.stderr b/testsuite/tests/typecheck/should_fail/tcfail146.stderr index ac65c39bb2..0e699557b6 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail146.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail146.stderr @@ -1,6 +1,6 @@ tcfail146.hs:7:22: error: [GHC-83865] - • Expected a type, but ‘SClass a’ has kind ‘Constraint’ + • Expected a type, but ‘SClass a’ is a constraint • In the type ‘(SClass a)’ In the definition of data constructor ‘SCon’ In the data declaration for ‘SData’ diff --git a/testsuite/tests/typecheck/should_fail/tcfail159.stderr b/testsuite/tests/typecheck/should_fail/tcfail159.stderr index 62f807547f..c6b64cde1e 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail159.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail159.stderr @@ -1,6 +1,9 @@ tcfail159.hs:9:11: error: [GHC-83865] - • Expecting a lifted type, but got an unlifted type + • Couldn't match a lifted type with an unlifted type + Expected: * + Actual: TYPE + ('GHC.Types.TupleRep '[GHC.Types.LiftedRep, GHC.Types.LiftedRep]) • In the pattern: ~(# p, q #) In a case alternative: ~(# p, q #) -> p In the expression: case h x of ~(# p, q #) -> p diff --git a/testsuite/tests/typecheck/should_fail/tcfail212.stderr b/testsuite/tests/typecheck/should_fail/tcfail212.stderr index 3448558872..9b8dd3d9bd 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail212.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail212.stderr @@ -10,9 +10,9 @@ tcfail212.hs:10:14: error: [GHC-83865] • In the type signature: f :: (Maybe, Either Int) tcfail212.hs:13:7: error: [GHC-83865] - • Expecting a lifted type, but ‘Int#’ is unlifted + • Expected a lifted type, but ‘Int#’ is an IntRep type • In the type signature: g :: (Int#, Int#) tcfail212.hs:13:13: error: [GHC-83865] - • Expecting a lifted type, but ‘Int#’ is unlifted + • Expected a lifted type, but ‘Int#’ is an IntRep type • In the type signature: g :: (Int#, Int#) diff --git a/testsuite/tests/typecheck/should_fail/tcfail215.stderr b/testsuite/tests/typecheck/should_fail/tcfail215.stderr index 1965951bbc..9a7f7e3b84 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail215.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail215.stderr @@ -1,4 +1,4 @@ tcfail215.hs:8:15: error: [GHC-83865] - • Expecting a lifted type, but ‘Int#’ is unlifted + • Expected a lifted type, but ‘Int#’ is an IntRep type • In the type signature: foo :: (?x :: Int#) => Int diff --git a/testsuite/tests/typecheck/should_run/TypeOf.stdout b/testsuite/tests/typecheck/should_run/TypeOf.stdout index 3344f17193..ac47aad78e 100644 --- a/testsuite/tests/typecheck/should_run/TypeOf.stdout +++ b/testsuite/tests/typecheck/should_run/TypeOf.stdout @@ -9,7 +9,7 @@ SomeTypeRep Bool Ordering Int -> Int -Proxy Constraint (Eq Int) +Proxy (CONSTRAINT ('BoxedRep 'Lifted)) (Eq Int) Proxy * (Int,Int) Proxy Symbol "hello world" Proxy Natural 1 @@ -24,4 +24,4 @@ Proxy Levity 'Lifted Proxy Levity 'Unlifted Proxy RuntimeRep ('BoxedRep 'Lifted) Proxy (Natural,Symbol) ('(,) Natural Symbol 1 "hello") -Proxy (* -> * -> Constraint) ((~~) * *) +Proxy (* -> * -> CONSTRAINT ('BoxedRep 'Lifted)) ((~~) * *) diff --git a/testsuite/tests/typecheck/should_run/TypeRep.stdout b/testsuite/tests/typecheck/should_run/TypeRep.stdout index cf43264714..d3df982ecf 100644 --- a/testsuite/tests/typecheck/should_run/TypeRep.stdout +++ b/testsuite/tests/typecheck/should_run/TypeRep.stdout @@ -14,7 +14,7 @@ Int -> Int Int# (##) (#,#) 'IntRep ('BoxedRep 'Lifted) Int# Int -Proxy Constraint (Eq Int) +Proxy (CONSTRAINT ('BoxedRep 'Lifted)) (Eq Int) Proxy * (Int,Int) Proxy Symbol "hello world" Proxy Natural 1 |