summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2015-12-11 18:19:53 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2015-12-11 18:23:12 -0500
commit6746549772c5cc0ac66c0fce562f297f4d4b80a2 (patch)
tree96869fcfb5757651462511d64d99a3712f09e7fb /testsuite/tests/typecheck
parent6e56ac58a6905197412d58e32792a04a63b94d7e (diff)
downloadhaskell-6746549772c5cc0ac66c0fce562f297f4d4b80a2.tar.gz
Add kind equalities to GHC.
This implements the ideas originally put forward in "System FC with Explicit Kind Equality" (ICFP'13). There are several noteworthy changes with this patch: * We now have casts in types. These change the kind of a type. See new constructor `CastTy`. * All types and all constructors can be promoted. This includes GADT constructors. GADT pattern matches take place in type family equations. In Core, types can now be applied to coercions via the `CoercionTy` constructor. * Coercions can now be heterogeneous, relating types of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2` proves both that `t1` and `t2` are the same and also that `k1` and `k2` are the same. * The `Coercion` type has been significantly enhanced. The documentation in `docs/core-spec/core-spec.pdf` reflects the new reality. * The type of `*` is now `*`. No more `BOX`. * Users can write explicit kind variables in their code, anywhere they can write type variables. For backward compatibility, automatic inference of kind-variable binding is still permitted. * The new extension `TypeInType` turns on the new user-facing features. * Type families and synonyms are now promoted to kinds. This causes trouble with parsing `*`, leading to the somewhat awkward new `HsAppsTy` constructor for `HsType`. This is dispatched with in the renamer, where the kind `*` can be told apart from a type-level multiplication operator. Without `-XTypeInType` the old behavior persists. With `-XTypeInType`, you need to import `Data.Kind` to get `*`, also known as `Type`. * The kind-checking algorithms in TcHsType have been significantly rewritten to allow for enhanced kinds. * The new features are still quite experimental and may be in flux. * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203. * TODO: Update user manual. Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142. Updates Haddock submodule.
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/should_compile/T5581.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/T5655.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/T9834.stderr142
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.stderr40
-rw-r--r--testsuite/tests/typecheck/should_compile/tc141.stderr20
-rw-r--r--testsuite/tests/typecheck/should_compile/tc167.stderr11
-rw-r--r--testsuite/tests/typecheck/should_compile/tc211.stderr20
-rw-r--r--testsuite/tests/typecheck/should_compile/tc231.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/tc243.stderr6
-rw-r--r--testsuite/tests/typecheck/should_compile/tc255.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc256.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc257.hs4
-rw-r--r--testsuite/tests/typecheck/should_compile/tc258.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/AssocTyDef06.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/AssocTyDef06.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr87
-rw-r--r--testsuite/tests/typecheck/should_fail/T10285.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T11112.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T1633.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/T1633.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T2994.stderr32
-rw-r--r--testsuite/tests/typecheck/should_fail/T3540.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/T3950.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/T4875.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T5570.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T5853.stderr35
-rw-r--r--testsuite/tests/typecheck/should_fail/T6018fail.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T6018failclosed.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/T7368.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T7368a.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/T7410.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T7453.stderr64
-rw-r--r--testsuite/tests/typecheck/should_fail/T7609.stderr27
-rw-r--r--testsuite/tests/typecheck/should_fail/T7645.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T7696.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T7734.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/T7778.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/T7857.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/T7892.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T8030.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T8262.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/T8514.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T8603.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T8806.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/T9109.stderr27
-rw-r--r--testsuite/tests/typecheck/should_fail/T9196.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/T9201.stderr9
-rw-r--r--testsuite/tests/typecheck/should_fail/T9260.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T9999.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr100
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail2.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail2.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail002.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail004.stderr18
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail005.stderr18
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail010.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail013.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail014.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail018.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail032.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail036.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail036.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail049.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail050.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail057.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail070.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail078.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail088.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail090.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail099.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail113.stderr32
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail122.stderr29
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail123.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail132.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail133.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail140.stderr78
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail146.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail147.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail151.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail159.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail160.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail161.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail181.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail184.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail195.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail196.stderr9
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail197.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail200.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail201.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail212.stderr32
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail213.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail214.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail217.stderr2
-rw-r--r--testsuite/tests/typecheck/should_run/T10284.hs11
-rw-r--r--testsuite/tests/typecheck/should_run/T10284.stderr8
-rw-r--r--testsuite/tests/typecheck/should_run/T10284.stdout2
-rw-r--r--testsuite/tests/typecheck/should_run/T7861.stdout1
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun043.hs2
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun044.hs6
100 files changed, 820 insertions, 713 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T5581.hs b/testsuite/tests/typecheck/should_compile/T5581.hs
index 074a2babcd..f7762831b3 100644
--- a/testsuite/tests/typecheck/should_compile/T5581.hs
+++ b/testsuite/tests/typecheck/should_compile/T5581.hs
@@ -3,7 +3,7 @@
module TcShouldTerminate where
-import GHC.Prim (Constraint)
+import Data.Kind (Constraint)
class C (p :: Constraint)
class D (p :: Constraint)
diff --git a/testsuite/tests/typecheck/should_compile/T5655.hs b/testsuite/tests/typecheck/should_compile/T5655.hs
index c2eed90abc..8db7a485a3 100644
--- a/testsuite/tests/typecheck/should_compile/T5655.hs
+++ b/testsuite/tests/typecheck/should_compile/T5655.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE TypeFamilies, GADTs, ConstraintKinds, RankNTypes #-}
module T5655 where
-import GHC.Prim (Constraint)
+import Data.Kind (Constraint)
class Show a => Twice a where twice :: a -> a
diff --git a/testsuite/tests/typecheck/should_compile/T9834.stderr b/testsuite/tests/typecheck/should_compile/T9834.stderr
index 3ce53a0c51..b3a6240a6b 100644
--- a/testsuite/tests/typecheck/should_compile/T9834.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9834.stderr
@@ -1,71 +1,71 @@
-
-T9834.hs:23:10: warning:
- Couldn't match type ‘p’ with ‘(->) (p a0)’
- ‘p’ is a rigid type variable bound by
- the class declaration for ‘ApplicativeFix’ at T9834.hs:21:39
- Expected type: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- Actual type: (forall (q :: * -> *).
- Applicative q =>
- Nat (Comp p q) (Comp p q))
- -> p a0 -> p a0
- In the expression: wrapIdComp
- In an equation for ‘afix’: afix = wrapIdComp
- Relevant bindings include
- afix :: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- (bound at T9834.hs:23:3)
-
-T9834.hs:23:10: warning:
- Couldn't match type ‘a’ with ‘p a0’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- afix :: forall a.
- (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a)
- -> p a
- at T9834.hs:22:11
- Expected type: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- Actual type: (forall (q :: * -> *).
- Applicative q =>
- Nat (Comp p q) (Comp p q))
- -> p a0 -> p a0
- In the expression: wrapIdComp
- In an equation for ‘afix’: afix = wrapIdComp
- Relevant bindings include
- afix :: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- (bound at T9834.hs:23:3)
-
-T9834.hs:23:10: warning:
- Couldn't match type ‘a’ with ‘a1’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- afix :: forall a.
- (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a)
- -> p a
- at T9834.hs:22:11
- ‘a1’ is a rigid type variable bound by
- a type expected by the context:
- forall (q :: * -> *) a1.
- Applicative q =>
- Comp p q a1 -> Comp p q a1
- at T9834.hs:23:10
- Expected type: Comp p q a1 -> Comp p q a1
- Actual type: Comp p q a -> Comp p q a
- In the expression: wrapIdComp
- In an equation for ‘afix’: afix = wrapIdComp
- Relevant bindings include
- afix :: (forall (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- (bound at T9834.hs:23:3)
+
+T9834.hs:23:10: warning:
+ • Couldn't match type ‘a’ with ‘p a0’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ afix :: forall a.
+ (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a)
+ -> p a
+ at T9834.hs:22:11
+ Expected type: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ Actual type: (forall (q :: * -> *).
+ Applicative q =>
+ Nat (Comp p q) (Comp p q))
+ -> p a0 -> p a0
+ • In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
+ • Relevant bindings include
+ afix :: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ (bound at T9834.hs:23:3)
+
+T9834.hs:23:10: warning:
+ • Couldn't match type ‘p’ with ‘(->) (p a0)’
+ ‘p’ is a rigid type variable bound by
+ the class declaration for ‘ApplicativeFix’ at T9834.hs:21:39
+ Expected type: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ Actual type: (forall (q :: * -> *).
+ Applicative q =>
+ Nat (Comp p q) (Comp p q))
+ -> p a0 -> p a0
+ • In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
+ • Relevant bindings include
+ afix :: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ (bound at T9834.hs:23:3)
+
+T9834.hs:23:10: warning:
+ • Couldn't match type ‘a’ with ‘a1’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ afix :: forall a.
+ (forall (q :: * -> *). Applicative q => Comp p q a -> Comp p q a)
+ -> p a
+ at T9834.hs:22:11
+ ‘a1’ is a rigid type variable bound by
+ a type expected by the context:
+ forall (q :: * -> *) a1.
+ Applicative q =>
+ Comp p q a1 -> Comp p q a1
+ at T9834.hs:23:10
+ Expected type: Comp p q a1 -> Comp p q a1
+ Actual type: Comp p q a -> Comp p q a
+ • In the expression: wrapIdComp
+ In an equation for ‘afix’: afix = wrapIdComp
+ • Relevant bindings include
+ afix :: (forall (q :: * -> *).
+ Applicative q =>
+ Comp p q a -> Comp p q a)
+ -> p a
+ (bound at T9834.hs:23:3)
diff --git a/testsuite/tests/typecheck/should_compile/T9939.stderr b/testsuite/tests/typecheck/should_compile/T9939.stderr
index 86decf0a5e..106335e8ba 100644
--- a/testsuite/tests/typecheck/should_compile/T9939.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9939.stderr
@@ -1,20 +1,20 @@
-
-T9939.hs:5:1: warning:
- Redundant constraint: Eq a
- In the type signature for:
- f1 :: (Eq a, Ord a) => a -> a -> Bool
-
-T9939.hs:9:1: warning:
- Redundant constraint: Eq a
- In the type signature for:
- f2 :: (Eq a, Ord a) => a -> a -> Bool
-
-T9939.hs:13:1: warning:
- Redundant constraint: Eq b
- In the type signature for:
- f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
-
-T9939.hs:20:1: warning:
- Redundant constraint: Eq b
- In the type signature for:
- f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
+
+T9939.hs:5:1: warning:
+ • Redundant constraint: Eq a
+ • In the type signature for:
+ f1 :: (Eq a, Ord a) => a -> a -> Bool
+
+T9939.hs:9:1: warning:
+ • Redundant constraint: Eq a
+ • In the type signature for:
+ f2 :: (Eq a, Ord a) => a -> a -> Bool
+
+T9939.hs:13:1: warning:
+ • Redundant constraint: Eq b
+ • In the type signature for:
+ f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
+
+T9939.hs:20:1: warning:
+ • Redundant constraint: Eq a
+ • In the type signature for:
+ f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
diff --git a/testsuite/tests/typecheck/should_compile/tc141.stderr b/testsuite/tests/typecheck/should_compile/tc141.stderr
index b5ee77b689..96858b1d3c 100644
--- a/testsuite/tests/typecheck/should_compile/tc141.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc141.stderr
@@ -7,11 +7,11 @@ tc141.hs:11:12: error:
In a pattern binding: (p :: a, q :: a) = x
tc141.hs:11:31: error:
- • Couldn't match expected type ‘a1’ with actual type ‘a’
- because type variable ‘a1’ would escape its scope
+ • Couldn't match expected type ‘a2’ with actual type ‘a’
+ because type variable ‘a2’ would escape its scope
This (rigid, skolem) type variable is bound by
an expression type signature:
- a1
+ a2
at tc141.hs:11:31-34
• In the expression: q :: a
In the expression: (q :: a, p)
@@ -19,7 +19,7 @@ tc141.hs:11:31: error:
p :: a (bound at tc141.hs:11:12)
q :: a (bound at tc141.hs:11:17)
x :: (a, a) (bound at tc141.hs:11:3)
- f :: (a, a) -> (t, a) (bound at tc141.hs:11:1)
+ f :: (a, a) -> (a1, a) (bound at tc141.hs:11:1)
tc141.hs:13:13: error:
• You cannot bind scoped type variable ‘a’
@@ -34,15 +34,15 @@ tc141.hs:13:13: error:
in v
tc141.hs:15:18: error:
- • Couldn't match expected type ‘a2’ with actual type ‘t’
- because type variable ‘a2’ would escape its scope
+ • Couldn't match expected type ‘a1’ with actual type ‘r1’
+ because type variable ‘a1’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- v :: a2
+ v :: a1
at tc141.hs:14:14-19
• In the expression: b
In an equation for ‘v’: v = b
• Relevant bindings include
- v :: a2 (bound at tc141.hs:15:14)
- b :: t (bound at tc141.hs:13:5)
- g :: a -> t -> a1 (bound at tc141.hs:13:1)
+ v :: a1 (bound at tc141.hs:15:14)
+ b :: r1 (bound at tc141.hs:13:5)
+ g :: r -> r1 -> a (bound at tc141.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_compile/tc167.stderr b/testsuite/tests/typecheck/should_compile/tc167.stderr
index 5d869af801..634b50dd5b 100644
--- a/testsuite/tests/typecheck/should_compile/tc167.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc167.stderr
@@ -1,5 +1,6 @@
-
-tc167.hs:8:15:
- Expecting a lifted type, but ‘Int#’ is unlifted
- In the type ‘(->) Int#’
- In the type declaration for ‘T’
+
+tc167.hs:8:15:
+ Expecting a lifted type, but ‘Int#’ is unlifted
+ In the first argument of ‘(->)’, namely ‘Int#’
+ In the type ‘(->) Int#’
+ In the type declaration for ‘T’
diff --git a/testsuite/tests/typecheck/should_compile/tc211.stderr b/testsuite/tests/typecheck/should_compile/tc211.stderr
index 34a35f1781..d802dffe4e 100644
--- a/testsuite/tests/typecheck/should_compile/tc211.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc211.stderr
@@ -1,5 +1,5 @@
-tc211.hs:17:8:
+tc211.hs:17:8: error:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a2 -> a2’
In the expression:
@@ -10,17 +10,17 @@ tc211.hs:17:8:
(forall a. a -> a) -> [forall a. a -> a] -> [forall a. a -> a])
(head foo) foo
-tc211.hs:18:22:
+tc211.hs:18:22: error:
Couldn't match type ‘forall a3. a3 -> a3’ with ‘a -> a’
- Expected type: [a -> a]
- Actual type: [forall a. a -> a]
+ Expected type: [a -> a]
+ Actual type: [forall a. a -> a]
In the first argument of ‘head’, namely ‘foo’
In the first argument of ‘(:) ::
(forall a. a -> a)
-> [forall a. a -> a] -> [forall a. a -> a]’, namely
‘(head foo)’
-tc211.hs:59:18:
+tc211.hs:59:18: error:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a1 -> a1’
In the expression:
@@ -33,7 +33,7 @@ tc211.hs:59:18:
(forall a. a -> a)
-> List (forall a. a -> a) -> List (forall a. a -> a)
-tc211.hs:65:8:
+tc211.hs:65:8: error:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a0 -> a0’
In the expression:
@@ -46,11 +46,11 @@ tc211.hs:65:8:
-> List (forall a. a -> a) -> List (forall a. a -> a))
(\ x -> x) Nil
-tc211.hs:73:9:
+tc211.hs:73:9: error:
Couldn't match type ‘forall a4. a4 -> a4’ with ‘a3 -> a3’
- Expected type: List (forall a. a -> a)
- -> (forall a. a -> a) -> a3 -> a3
- Actual type: List (a3 -> a3) -> (a3 -> a3) -> a3 -> a3
+ Expected type: List (forall a. a -> a)
+ -> (forall a. a -> a) -> a3 -> a3
+ Actual type: List (a3 -> a3) -> (a3 -> a3) -> a3 -> a3
In the expression:
foo2 ::
List (forall a. a -> a) -> (forall a. a -> a) -> (forall a. a -> a)
diff --git a/testsuite/tests/typecheck/should_compile/tc231.stderr b/testsuite/tests/typecheck/should_compile/tc231.stderr
index 2377c13a0f..85ccc32954 100644
--- a/testsuite/tests/typecheck/should_compile/tc231.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc231.stderr
@@ -6,9 +6,9 @@ TYPE SIGNATURES
s :: forall t t1. Q t (Z [Char]) t1 -> Q t (Z [Char]) t1
TYPE CONSTRUCTORS
data Q s a chain = Node s a chain
- Promotable
+ Kind: * -> * -> * -> *
data Z a = Z a
- Promotable
+ Kind: * -> *
class Zork s a b | a -> b where
huh :: Q s a chain -> ST s ()
{-# MINIMAL huh #-}
diff --git a/testsuite/tests/typecheck/should_compile/tc243.stderr b/testsuite/tests/typecheck/should_compile/tc243.stderr
index 31cc3c9fd2..98e0f5ae1e 100644
--- a/testsuite/tests/typecheck/should_compile/tc243.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc243.stderr
@@ -1,3 +1,3 @@
-
-tc243.hs:10:1: Warning:
- Top-level binding with no type signature: (.+.) :: forall t. t
+
+tc243.hs:10:1: Warning:
+ Top-level binding with no type signature: (.+.) :: forall r. r
diff --git a/testsuite/tests/typecheck/should_compile/tc255.hs b/testsuite/tests/typecheck/should_compile/tc255.hs
index d77a7b688b..e5690bb08d 100644
--- a/testsuite/tests/typecheck/should_compile/tc255.hs
+++ b/testsuite/tests/typecheck/should_compile/tc255.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE TypeFamilies, ConstraintKinds, UndecidableInstances #-}
module Ctx where
-import GHC.Prim( Constraint )
+import Data.Kind ( Constraint )
type family Indirect :: * -> Constraint
type instance Indirect = Show
diff --git a/testsuite/tests/typecheck/should_compile/tc256.hs b/testsuite/tests/typecheck/should_compile/tc256.hs
index f06eabf1c3..d33f7a6401 100644
--- a/testsuite/tests/typecheck/should_compile/tc256.hs
+++ b/testsuite/tests/typecheck/should_compile/tc256.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE TypeFamilies, ConstraintKinds, UndecidableInstances #-}
module Ctx where
-import GHC.Prim( Constraint )
+import Data.Kind ( Constraint )
type family Indirect :: * -> Constraint
type instance Indirect = Show
diff --git a/testsuite/tests/typecheck/should_compile/tc257.hs b/testsuite/tests/typecheck/should_compile/tc257.hs
index efab2df224..d5742aa779 100644
--- a/testsuite/tests/typecheck/should_compile/tc257.hs
+++ b/testsuite/tests/typecheck/should_compile/tc257.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE KindSignatures, ConstraintKinds, MultiParamTypeClasses, FlexibleInstances, UndecidableInstances #-}
module Ctx where
-import GHC.Prim( Constraint )
+import Data.Kind ( Constraint )
data Proxy (ctxt :: * -> Constraint) = Proxy
@@ -22,4 +22,4 @@ instance ctxt Int => Foo ctxt Int where
-- from the context (ctxt Int)
-- The problem was that irreducible evidence did not interact with
--- evidence of equal type. \ No newline at end of file
+-- evidence of equal type.
diff --git a/testsuite/tests/typecheck/should_compile/tc258.hs b/testsuite/tests/typecheck/should_compile/tc258.hs
index 353ec94c43..a4dca19526 100644
--- a/testsuite/tests/typecheck/should_compile/tc258.hs
+++ b/testsuite/tests/typecheck/should_compile/tc258.hs
@@ -2,7 +2,7 @@
module AltPrelude where
-import GHC.Prim (Constraint)
+import Data.Kind (Constraint)
class MyFunctor f where
type FunctorCtxt f a :: Constraint
diff --git a/testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr b/testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr
index 4fbaaef199..71fc77d4ed 100644
--- a/testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr
+++ b/testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr
@@ -1,7 +1,7 @@
-
-AssocTyDef04.hs:6:18:
- Expecting one more argument to ‘Maybe’
- Expected kind ‘*’, but ‘Maybe’ has kind ‘* -> *’
- In the type ‘Maybe’
- In the default type instance declaration for ‘Typ’
- In the class declaration for ‘Cls’
+
+AssocTyDef04.hs:6:18:
+ Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ In the type ‘Maybe’
+ In the default type instance declaration for ‘Typ’
+ In the class declaration for ‘Cls’
diff --git a/testsuite/tests/typecheck/should_fail/AssocTyDef06.hs b/testsuite/tests/typecheck/should_fail/AssocTyDef06.hs
index fb595a3e27..e4f45669b7 100644
--- a/testsuite/tests/typecheck/should_fail/AssocTyDef06.hs
+++ b/testsuite/tests/typecheck/should_fail/AssocTyDef06.hs
@@ -3,5 +3,5 @@ module AssocTyDef06 where
class Cls a where
type Typ a
- type Typ a Int = Int
- -- Too many params for default \ No newline at end of file
+ type Typ a b = Int
+ -- Too many params for default
diff --git a/testsuite/tests/typecheck/should_fail/AssocTyDef06.stderr b/testsuite/tests/typecheck/should_fail/AssocTyDef06.stderr
index 665ad223d2..d51ce8ff6c 100644
--- a/testsuite/tests/typecheck/should_fail/AssocTyDef06.stderr
+++ b/testsuite/tests/typecheck/should_fail/AssocTyDef06.stderr
@@ -1,6 +1,5 @@
-
-AssocTyDef06.hs:6:16:
- Unexpected type ‘Int’
- In the default declaration for ‘Typ’
- A default declaration should have form
- default Typ a b = ...
+
+AssocTyDef06.hs:6:5:
+ Number of parameters must match family declaration; expected 1
+ In the default type instance declaration for ‘Typ’
+ In the class declaration for ‘Cls’
diff --git a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
index b545a10caa..6abb044c8e 100644
--- a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
+++ b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
@@ -1,52 +1,47 @@
-FrozenErrorTests.hs:12:12:
- Couldn't match type ‘Int’ with ‘Bool’
- Inaccessible code in
- a pattern with constructor: MkT3 :: forall a. (a ~ Bool) => T a,
- in a case alternative
- In the pattern: MkT3
- In a case alternative: MkT3 -> ()
- In the expression: case x of { MkT3 -> () }
+FrozenErrorTests.hs:12:12: error:
+ • Couldn't match type ‘Int’ with ‘Bool’
+ Inaccessible code in
+ a pattern with constructor: MkT3 :: forall a. (a ~ Bool) => T a,
+ in a case alternative
+ • In the pattern: MkT3
+ In a case alternative: MkT3 -> ()
+ In the expression: case x of { MkT3 -> () }
-FrozenErrorTests.hs:26:9:
- Occurs check: cannot construct the infinite type: a ~ [a]
- Expected type: [a]
- Actual type: F a Bool
- In the expression: goo1 False undefined
- In an equation for ‘test1’: test1 = goo1 False undefined
- Relevant bindings include
- test1 :: a (bound at FrozenErrorTests.hs:26:1)
+FrozenErrorTests.hs:26:9: error:
+ • Occurs check: cannot construct the infinite type: a ~ [a]
+ arising from a use of ‘goo1’
+ • In the expression: goo1 False undefined
+ In an equation for ‘test1’: test1 = goo1 False undefined
+ • Relevant bindings include
+ test1 :: a (bound at FrozenErrorTests.hs:26:1)
-FrozenErrorTests.hs:29:15:
- Couldn't match type ‘Int’ with ‘[Int]’
- Expected type: [[Int]]
- Actual type: F [Int] Bool
- In the first argument of ‘goo2’, namely ‘(goo1 False undefined)’
- In the expression: goo2 (goo1 False undefined)
- In an equation for ‘test2’: test2 = goo2 (goo1 False undefined)
+FrozenErrorTests.hs:29:15: error:
+ • Couldn't match type ‘Int’ with ‘[Int]’
+ arising from a use of ‘goo1’
+ • In the first argument of ‘goo2’, namely ‘(goo1 False undefined)’
+ In the expression: goo2 (goo1 False undefined)
+ In an equation for ‘test2’: test2 = goo2 (goo1 False undefined)
-FrozenErrorTests.hs:30:9:
- Couldn't match type ‘Int’ with ‘[Int]’
- Expected type: [[Int]]
- Actual type: F [Int] Bool
- In the expression: goo1 False (goo2 undefined)
- In an equation for ‘test3’: test3 = goo1 False (goo2 undefined)
+FrozenErrorTests.hs:30:9: error:
+ • Couldn't match type ‘Int’ with ‘[Int]’
+ arising from a use of ‘goo1’
+ • In the expression: goo1 False (goo2 undefined)
+ In an equation for ‘test3’: test3 = goo1 False (goo2 undefined)
-FrozenErrorTests.hs:45:15:
- Couldn't match type ‘T2 c c’ with ‘M (T2 (T2 c c) c)’
- Expected type: T2 (M (T2 (T2 c c) c)) (T2 (T2 c c) c)
- Actual type: F (T2 (T2 c c) c) Bool
- In the first argument of ‘goo4’, namely ‘(goo3 False undefined)’
- In the expression: goo4 (goo3 False undefined)
- In an equation for ‘test4’: test4 = goo4 (goo3 False undefined)
- Relevant bindings include
- test4 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:45:1)
+FrozenErrorTests.hs:45:15: error:
+ • Couldn't match type ‘T2 c c’ with ‘M (T2 (T2 c c) c)’
+ arising from a use of ‘goo3’
+ • In the first argument of ‘goo4’, namely ‘(goo3 False undefined)’
+ In the expression: goo4 (goo3 False undefined)
+ In an equation for ‘test4’: test4 = goo4 (goo3 False undefined)
+ • Relevant bindings include
+ test4 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:45:1)
-FrozenErrorTests.hs:46:9:
- Couldn't match type ‘T2 c c’ with ‘M (T2 (T2 c c) c)’
- Expected type: T2 (M (T2 (T2 c c) c)) (T2 (T2 c c) c)
- Actual type: F (T2 (T2 c c) c) Bool
- In the expression: goo3 False (goo4 undefined)
- In an equation for ‘test5’: test5 = goo3 False (goo4 undefined)
- Relevant bindings include
- test5 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:46:1)
+FrozenErrorTests.hs:46:9: error:
+ • Couldn't match type ‘T2 c c’ with ‘M (T2 (T2 c c) c)’
+ arising from a use of ‘goo3’
+ • In the expression: goo3 False (goo4 undefined)
+ In an equation for ‘test5’: test5 = goo3 False (goo4 undefined)
+ • Relevant bindings include
+ test5 :: T2 (T2 c c) c (bound at FrozenErrorTests.hs:46:1)
diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr
index b7bba0f575..ebc5f97503 100644
--- a/testsuite/tests/typecheck/should_fail/T10285.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10285.stderr
@@ -3,7 +3,7 @@ T10285.hs:8:17: error:
• Could not deduce: Coercible a b arising from a use of ‘coerce’
from the context: Coercible (N a) (N b)
bound by a pattern with constructor:
- Coercion :: forall (k :: BOX) (a :: k) (b :: k).
+ Coercion :: forall k (a :: k) (b :: k).
Coercible a b =>
Coercion a b,
in an equation for ‘oops’
diff --git a/testsuite/tests/typecheck/should_fail/T11112.stderr b/testsuite/tests/typecheck/should_fail/T11112.stderr
index 3534d33b51..ec2154c8ce 100644
--- a/testsuite/tests/typecheck/should_fail/T11112.stderr
+++ b/testsuite/tests/typecheck/should_fail/T11112.stderr
@@ -1,5 +1,5 @@
T11112.hs:3:9: error:
- • Constraint ‘Ord s’ used as a type
+ • Expected a type, but ‘Ord s’ has kind ‘Constraint’
• In the type signature:
sort :: Ord s -> [s] -> [s]
diff --git a/testsuite/tests/typecheck/should_fail/T1633.hs b/testsuite/tests/typecheck/should_fail/T1633.hs
index 3fff8f2540..fb95956774 100644
--- a/testsuite/tests/typecheck/should_fail/T1633.hs
+++ b/testsuite/tests/typecheck/should_fail/T1633.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE FlexibleInstances #-}
+
-- This just tests what the kind error message looks like
-- Trac #1633
diff --git a/testsuite/tests/typecheck/should_fail/T1633.stderr b/testsuite/tests/typecheck/should_fail/T1633.stderr
index 63eced334d..300e6c3def 100644
--- a/testsuite/tests/typecheck/should_fail/T1633.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1633.stderr
@@ -1,5 +1,5 @@
-T1633.hs:6:18:
- The first argument of ‘Functor’ should have kind ‘* -> *’,
- but ‘Bool’ has kind ‘*’
+T1633.hs:8:18: error:
+ Expected kind ‘* -> *’, but ‘Bool’ has kind ‘*’
+ In the first argument of ‘Functor’, namely ‘Bool’
In the instance declaration for ‘Functor Bool’
diff --git a/testsuite/tests/typecheck/should_fail/T2994.stderr b/testsuite/tests/typecheck/should_fail/T2994.stderr
index 83e96b45da..e833cd637d 100644
--- a/testsuite/tests/typecheck/should_fail/T2994.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2994.stderr
@@ -1,16 +1,36 @@
-T2994.hs:11:10:
+T2994.hs:11:10: error:
Expecting one more argument to ‘MonadReader Int’
Expected a constraint,
but ‘MonadReader Int’ has kind ‘* -> Constraint’
In the instance declaration for ‘MonadReader Int’
-T2994.hs:13:23:
+T2994.hs:11:10: error:
+ Malformed instance head: MonadReader Int
+ In the instance declaration for ‘MonadReader Int’
+
+T2994.hs:13:10: error:
+ Expecting one more argument to ‘MonadReader (Reader' r)’
+ Expected a constraint,
+ but ‘MonadReader (Reader' r)’ has kind ‘* -> Constraint’
+ In the instance declaration for ‘MonadReader (Reader' r)’
+
+T2994.hs:13:10: error:
+ Malformed instance head: MonadReader (Reader' r)
+ In the instance declaration for ‘MonadReader (Reader' r)’
+
+T2994.hs:13:23: error:
Expecting one more argument to ‘Reader' r’
- The first argument of ‘MonadReader’ should have kind ‘*’,
- but ‘Reader' r’ has kind ‘* -> *’
+ Expected a type, but ‘Reader' r’ has kind ‘* -> *’
+ In the first argument of ‘MonadReader’, namely ‘Reader' r’
In the instance declaration for ‘MonadReader (Reader' r)’
-T2994.hs:15:10:
- ‘MonadReader’ is applied to too many type arguments
+T2994.hs:15:10: error:
+ Expecting one fewer argument to ‘MonadReader r r’
+ Expected kind ‘(* -> *) -> Constraint’,
+ but ‘MonadReader r r’ has kind ‘Constraint’
+ In the instance declaration for ‘MonadReader r r (Reader' r)’
+
+T2994.hs:15:10: error:
+ Malformed instance head: MonadReader r r (Reader' r)
In the instance declaration for ‘MonadReader r r (Reader' r)’
diff --git a/testsuite/tests/typecheck/should_fail/T3540.stderr b/testsuite/tests/typecheck/should_fail/T3540.stderr
index 75c9dc2ea1..03cd6565fc 100644
--- a/testsuite/tests/typecheck/should_fail/T3540.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3540.stderr
@@ -1,25 +1,37 @@
T3540.hs:4:12: error:
- • Constraint ‘a ~ Int’ used as a type
+ • Expected a type, but ‘a ~ Int’ has kind ‘Constraint’
• In the type signature:
thing :: a ~ Int
T3540.hs:7:20: error:
- • Constraint ‘a ~ Int’ used as a type
+ • Expected a type, but ‘a ~ Int’ has kind ‘Constraint’
• In the type signature:
thing1 :: Int -> (a ~ Int)
T3540.hs:10:13: error:
- • Constraint ‘a ~ Int’ used as a type
+ • Expected a type, but ‘a ~ Int’ has kind ‘Constraint’
• In the type signature:
thing2 :: (a ~ Int) -> Int
T3540.hs:13:12: error:
- • Constraint ‘?dude :: Int’ used as a type
+ • Expected a type, but ‘?dude::Int’ has kind ‘Constraint’
• In the type signature:
thing3 :: (?dude :: Int) -> Int
+T3540.hs:16:10: error:
+ • Could not deduce (Eq a0)
+ from the context: Eq a
+ bound by the type signature for:
+ thing4 :: Eq a => Int
+ at T3540.hs:16:10-22
+ The type variable ‘a0’ is ambiguous
+ • In the ambiguity check for ‘thing4’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature:
+ thing4 :: (Eq a) -> Int
+
T3540.hs:16:11: error:
- • Constraint ‘Eq a’ used as a type
+ • Expected a type, but ‘Eq a’ has kind ‘Constraint’
• In the type signature:
thing4 :: (Eq a) -> Int
diff --git a/testsuite/tests/typecheck/should_fail/T3950.stderr b/testsuite/tests/typecheck/should_fail/T3950.stderr
index 1771e2f5e4..fab70fd01b 100644
--- a/testsuite/tests/typecheck/should_fail/T3950.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3950.stderr
@@ -1,12 +1,12 @@
-T3950.hs:15:13:
- Couldn't match kind ‘* -> *’ with ‘*’
- When matching types
- w :: (* -> * -> *) -> *
- Sealed :: (* -> *) -> *
- Expected type: w (Id p)
- Actual type: Sealed (Id p0 x0)
- In the first argument of ‘Just’, namely ‘rp'’
- In the expression: Just rp'
- Relevant bindings include
- rp :: Bool -> Maybe (w (Id p)) (bound at T3950.hs:15:1)
+T3950.hs:15:13: error:
+ • Couldn't match kind ‘* -> *’ with ‘*’
+ When matching types
+ w :: (* -> * -> *) -> *
+ Sealed :: (* -> *) -> *
+ Expected type: w (Id p)
+ Actual type: Sealed (Id p x0)
+ • In the first argument of ‘Just’, namely ‘rp'’
+ In the expression: Just rp'
+ • Relevant bindings include
+ rp :: Bool -> Maybe (w (Id p)) (bound at T3950.hs:15:1)
diff --git a/testsuite/tests/typecheck/should_fail/T4875.stderr b/testsuite/tests/typecheck/should_fail/T4875.stderr
index 98584a44f0..80e1e0e99d 100644
--- a/testsuite/tests/typecheck/should_fail/T4875.stderr
+++ b/testsuite/tests/typecheck/should_fail/T4875.stderr
@@ -1,5 +1,7 @@
-
-T4875.hs:27:24: error:
- ‘r’ is applied to too many type arguments
- In the type signature: multiplicities :: r c -> [c]
- In the class declaration for ‘Morphic’
+
+T4875.hs:27:24: error:
+ • Expecting one fewer argument to ‘r’
+ Expected kind ‘* -> *’, but ‘r’ has kind ‘*’
+ • In the type signature:
+ multiplicities :: r c -> [c]
+ In the class declaration for ‘Morphic’
diff --git a/testsuite/tests/typecheck/should_fail/T5570.stderr b/testsuite/tests/typecheck/should_fail/T5570.stderr
index 45cdfd5679..8c4ace5173 100644
--- a/testsuite/tests/typecheck/should_fail/T5570.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5570.stderr
@@ -1,9 +1,7 @@
T5570.hs:7:16: error:
- Couldn't match kind ‘*’ with ‘#’
- When matching types
- r0 :: *
- Double# :: #
- In the second argument of ‘($)’, namely ‘D# $ 3.0##’
- In the expression: print $ D# $ 3.0##
- In an equation for ‘main’: main = print $ D# $ 3.0##
+ • Couldn't match a lifted type with an unlifted type
+ When matching the kind of ‘Double#’
+ • In the second argument of ‘($)’, namely ‘D# $ 3.0##’
+ In the expression: print $ D# $ 3.0##
+ In an equation for ‘main’: main = print $ D# $ 3.0##
diff --git a/testsuite/tests/typecheck/should_fail/T5853.stderr b/testsuite/tests/typecheck/should_fail/T5853.stderr
index 231d57dcdd..dc23d4a064 100644
--- a/testsuite/tests/typecheck/should_fail/T5853.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5853.stderr
@@ -1,18 +1,23 @@
T5853.hs:15:52: error:
- Could not deduce: Subst t1 (Elem t2) ~ t2
- from the context: (F t,
- Subst t (Elem t2) ~ t2,
- Subst t2 (Elem t) ~ t,
- F t1,
- Subst t1 (Elem t) ~ t,
- Subst t (Elem t1) ~ t1)
- bound by the RULE "map/map" at T5853.hs:15:2-57
+ • Could not deduce: Subst t1 (Elem t2) ~ t2
+ arising from a use of ‘<$>’
+ from the context: (F t,
+ Elem t ~ Elem t,
+ Elem t2 ~ Elem t2,
+ Subst t (Elem t2) ~ t2,
+ Subst t2 (Elem t) ~ t,
+ F t1,
+ Elem t1 ~ Elem t1,
+ Elem t ~ Elem t,
+ Subst t1 (Elem t) ~ t,
+ Subst t (Elem t1) ~ t1)
+ bound by the RULE "map/map" at T5853.hs:15:2-57
‘t2’ is a rigid type variable bound by
- the RULE "map/map" at T5853.hs:15:2
- In the expression: (f . g) <$> xs
- When checking the transformation rule "map/map"
- Relevant bindings include
- f :: Elem t -> Elem t2 (bound at T5853.hs:15:19)
- g :: Elem t1 -> Elem t (bound at T5853.hs:15:21)
- xs :: t1 (bound at T5853.hs:15:23)
+ the RULE "map/map" at T5853.hs:15:2
+ • In the expression: (f . g) <$> xs
+ When checking the transformation rule "map/map"
+ • Relevant bindings include
+ f :: Elem t -> Elem t2 (bound at T5853.hs:15:19)
+ g :: Elem t1 -> Elem t (bound at T5853.hs:15:21)
+ xs :: t1 (bound at T5853.hs:15:23)
diff --git a/testsuite/tests/typecheck/should_fail/T6018fail.stderr b/testsuite/tests/typecheck/should_fail/T6018fail.stderr
index a0f5439a7d..ac5c2b6fe0 100644
--- a/testsuite/tests/typecheck/should_fail/T6018fail.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6018fail.stderr
@@ -66,7 +66,7 @@ T6018fail.hs:59:10: error:
T6018fail.hs:62:15: error:
Type family equation violates injectivity annotation.
- Kind variable ‘k1’ cannot be inferred from the right-hand side.
+ Kind variable ‘k’ cannot be inferred from the right-hand side.
(enabling -fprint-explicit-kinds might help)
In the type family equation:
PolyKindVars '[] = '[] -- Defined at T6018fail.hs:62:15
@@ -76,7 +76,7 @@ T6018fail.hs:66:15: error:
Kind variable ‘k’ cannot be inferred from the right-hand side.
(enabling -fprint-explicit-kinds might help)
In the type family equation:
- forall (k :: BOX) (a :: k) (b :: k).
+ forall k (a :: k) (b :: k).
Fc a b = Int -- Defined at T6018fail.hs:66:15
T6018fail.hs:70:15: error:
@@ -85,7 +85,7 @@ T6018fail.hs:70:15: error:
cannot be inferred from the right-hand side.
(enabling -fprint-explicit-kinds might help)
In the type family equation:
- forall (k :: BOX) (a :: k) (b :: k).
+ forall k (a :: k) (b :: k).
Gc a b = Int -- Defined at T6018fail.hs:70:15
T6018fail.hs:75:15: error:
@@ -142,7 +142,7 @@ T6018fail.hs:118:15: error:
cannot be inferred from the right-hand side.
(enabling -fprint-explicit-kinds might help)
In the type family equation:
- forall (k :: BOX) a b (c :: k).
+ forall k a b (c :: k).
G7 a b c = [G7a a b c] -- Defined at T6018fail.hs:118:15
T6018fail.hs:129:1: error:
diff --git a/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr b/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr
index 2afafbe4cd..c151553a3a 100644
--- a/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6018failclosed.stderr
@@ -28,7 +28,7 @@ T6018failclosed.hs:25:5: error:
cannot be inferred from the right-hand side.
(enabling -fprint-explicit-kinds might help)
In the type family equation:
- forall (k :: BOX) (k1 :: BOX) (b :: k) (c :: k1).
+ forall k k1 (b :: k) (c :: k1).
JClosed Int b c = Char -- Defined at T6018failclosed.hs:25:5
In the equations for closed type family ‘JClosed’
In the type family declaration for ‘JClosed’
@@ -44,7 +44,7 @@ T6018failclosed.hs:30:5: error:
T6018failclosed.hs:35:5: error:
Type family equation violates injectivity annotation.
RHS of injective type family equation cannot be a type family:
- forall (k :: BOX) (a :: k).
+ forall k (a :: k).
LClosed a = MaybeSynClosed a -- Defined at T6018failclosed.hs:35:5
In the equations for closed type family ‘LClosed’
In the type family declaration for ‘LClosed’
@@ -63,6 +63,13 @@ T6018failclosed.hs:43:5: error:
In the equations for closed type family ‘IClosed’
In the type family declaration for ‘IClosed’
+T6018failclosed.hs:49:3: error:
+ Type family equations violate injectivity annotation:
+ E2 'True = 'False -- Defined at T6018failclosed.hs:49:3
+ E2 a = 'False -- Defined at T6018failclosed.hs:50:3
+ In the equations for closed type family ‘E2’
+ In the type family declaration for ‘E2’
+
T6018failclosed.hs:50:3: error:
Type family equation violates injectivity annotation.
Type variable ‘a’ cannot be inferred from the right-hand side.
@@ -83,7 +90,7 @@ T6018failclosed.hs:66:5: error:
Kind variable ‘k’ cannot be inferred from the right-hand side.
(enabling -fprint-explicit-kinds might help)
In the type family equation:
- forall (k :: BOX) (a :: k) (b :: k).
+ forall k (a :: k) (b :: k).
Gc a b = Int -- Defined at T6018failclosed.hs:66:5
In the equations for closed type family ‘Gc’
In the type family declaration for ‘Gc’
diff --git a/testsuite/tests/typecheck/should_fail/T7368.stderr b/testsuite/tests/typecheck/should_fail/T7368.stderr
index c6c11e81b7..1c538ac7f9 100644
--- a/testsuite/tests/typecheck/should_fail/T7368.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7368.stderr
@@ -1,10 +1,6 @@
T7368.hs:3:10: error:
- Couldn't match kind ‘* -> *’ with ‘*’
- When matching types
- c0 :: (* -> *) -> *
- (->) a0 :: * -> *
- Expected type: a0 -> b0
- Actual type: c0 Maybe
- In the first argument of ‘b’, namely ‘(l Nothing)’
- In the expression: b (l Nothing)
+ • Couldn't match kind ‘*’ with ‘* -> *’
+ When matching the kind of ‘Maybe’
+ • In the first argument of ‘b’, namely ‘(l Nothing)’
+ In the expression: b (l Nothing)
diff --git a/testsuite/tests/typecheck/should_fail/T7368a.stderr b/testsuite/tests/typecheck/should_fail/T7368a.stderr
index a4f796ce6f..e55aab0e62 100644
--- a/testsuite/tests/typecheck/should_fail/T7368a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7368a.stderr
@@ -1,12 +1,12 @@
T7368a.hs:8:6: error:
- Couldn't match kind ‘*’ with ‘* -> *’
- When matching types
- f :: * -> *
- Bad :: (* -> *) -> *
- Expected type: f (Bad f)
- Actual type: Bad t0
- In the pattern: Bad x
- In an equation for ‘fun’: fun (Bad x) = True
- Relevant bindings include
- fun :: f (Bad f) -> Bool (bound at T7368a.hs:8:1)
+ • Couldn't match kind ‘*’ with ‘* -> *’
+ When matching types
+ f :: * -> *
+ Bad :: (* -> *) -> *
+ Expected type: f (Bad f)
+ Actual type: Bad (Bad f)
+ • In the pattern: Bad x
+ In an equation for ‘fun’: fun (Bad x) = True
+ • Relevant bindings include
+ fun :: f (Bad f) -> Bool (bound at T7368a.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7410.stderr b/testsuite/tests/typecheck/should_fail/T7410.stderr
index 46c7a8c2fc..0ca86ed872 100644
--- a/testsuite/tests/typecheck/should_fail/T7410.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7410.stderr
@@ -1,6 +1,6 @@
-
-T7410.hs:3:9: error:
- Expecting one more argument to ‘Either Int’
- The first argument of a tuple should have kind ‘*’,
- but ‘Either Int’ has kind ‘* -> *’
- In the type signature: foo :: (Either Int, Int)
+
+T7410.hs:3:9: error:
+ • Expecting one more argument to ‘Either Int’
+ Expected a type, but ‘Either Int’ has kind ‘* -> *’
+ • In the type signature:
+ foo :: (Either Int, Int)
diff --git a/testsuite/tests/typecheck/should_fail/T7453.stderr b/testsuite/tests/typecheck/should_fail/T7453.stderr
index d3b76c54bf..efbc7497e5 100644
--- a/testsuite/tests/typecheck/should_fail/T7453.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7453.stderr
@@ -1,40 +1,50 @@
-T7453.hs:10:30: error:
- • Couldn't match expected type ‘t1’ with actual type ‘t’
- because type variable ‘t1’ would escape its scope
+T7453.hs:9:15: error:
+ • Couldn't match type ‘r’ with ‘t’
+ because type variable ‘t’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- z :: Id t1
+ z :: Id t
at T7453.hs:8:11-19
- • In the first argument of ‘Id’, namely ‘v’
- In the expression: Id v
+ Expected type: Id t
+ Actual type: Id r
+ • In the expression: aux
+ In an equation for ‘z’:
+ z = aux
+ where
+ aux = Id v
• Relevant bindings include
- aux :: Id t1 (bound at T7453.hs:10:21)
- z :: Id t1 (bound at T7453.hs:9:11)
- v :: t (bound at T7453.hs:7:7)
- cast1 :: t -> a (bound at T7453.hs:7:1)
+ aux :: Id r (bound at T7453.hs:10:21)
+ z :: Id t (bound at T7453.hs:9:11)
+ v :: r (bound at T7453.hs:7:7)
+ cast1 :: r -> a (bound at T7453.hs:7:1)
-T7453.hs:16:33: error:
- • Couldn't match expected type ‘t2’ with actual type ‘t’
- because type variable ‘t2’ would escape its scope
+T7453.hs:15:15: error:
+ • Couldn't match type ‘r’ with ‘t1’
+ because type variable ‘t1’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- z :: () -> t2
+ z :: () -> t1
at T7453.hs:14:11-22
- • In the first argument of ‘const’, namely ‘v’
- In the expression: const v
+ Expected type: () -> t1
+ Actual type: () -> r
+ • In the expression: aux
+ In an equation for ‘z’:
+ z = aux
+ where
+ aux = const v
• Relevant bindings include
- aux :: b -> t2 (bound at T7453.hs:16:21)
- z :: () -> t2 (bound at T7453.hs:15:11)
- v :: t (bound at T7453.hs:13:7)
- cast2 :: t -> t1 (bound at T7453.hs:13:1)
+ aux :: forall b. b -> r (bound at T7453.hs:16:21)
+ z :: () -> t1 (bound at T7453.hs:15:11)
+ v :: r (bound at T7453.hs:13:7)
+ cast2 :: r -> t (bound at T7453.hs:13:1)
T7453.hs:21:15: error:
- • Couldn't match expected type ‘t2’ with actual type ‘t’
- because type variable ‘t2’ would escape its scope
+ • Couldn't match expected type ‘t1’ with actual type ‘r’
+ because type variable ‘t1’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- z :: t2
+ z :: t1
at T7453.hs:20:11-16
• In the expression: v
In an equation for ‘z’:
@@ -42,7 +52,7 @@ T7453.hs:21:15: error:
where
aux = const v
• Relevant bindings include
- aux :: forall b. b -> t2 (bound at T7453.hs:22:21)
- z :: t2 (bound at T7453.hs:21:11)
- v :: t (bound at T7453.hs:19:7)
- cast3 :: t -> t1 (bound at T7453.hs:19:1)
+ aux :: forall b. b -> r (bound at T7453.hs:22:21)
+ z :: t1 (bound at T7453.hs:21:11)
+ v :: r (bound at T7453.hs:19:7)
+ cast3 :: r -> t (bound at T7453.hs:19:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7609.stderr b/testsuite/tests/typecheck/should_fail/T7609.stderr
index c5ed9fcad9..24339311b8 100644
--- a/testsuite/tests/typecheck/should_fail/T7609.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7609.stderr
@@ -1,10 +1,17 @@
-
-T7609.hs:7:16: error:
- Expecting one more argument to ‘Maybe’
- The second argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
- In the type signature: f :: (a `X` a, Maybe)
-
-T7609.hs:10:7: error:
- Expected a constraint, but ‘a `X` a’ has kind ‘*’
- In the type signature: g :: (a `X` a) => Maybe
+
+T7609.hs:7:16: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type signature:
+ f :: (a `X` a, Maybe)
+
+T7609.hs:10:7: error:
+ • Expected a constraint, but ‘X a a’ has kind ‘*’
+ • In the type signature:
+ g :: (a `X` a) => Maybe
+
+T7609.hs:10:19: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type signature:
+ g :: (a `X` a) => Maybe
diff --git a/testsuite/tests/typecheck/should_fail/T7645.stderr b/testsuite/tests/typecheck/should_fail/T7645.stderr
index 17420143f8..1b3fe0ad76 100644
--- a/testsuite/tests/typecheck/should_fail/T7645.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7645.stderr
@@ -1,6 +1,6 @@
-
-T7645.hs:6:23: error:
- Expecting one more argument to ‘Maybe’
- The second argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
- In the type signature: f :: ((+) a (a :: *), Maybe)
+
+T7645.hs:6:23: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type signature:
+ f :: ((+) a (a :: *), Maybe)
diff --git a/testsuite/tests/typecheck/should_fail/T7696.stderr b/testsuite/tests/typecheck/should_fail/T7696.stderr
index 41f2296797..eef19a5cfc 100644
--- a/testsuite/tests/typecheck/should_fail/T7696.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7696.stderr
@@ -1,7 +1,7 @@
T7696.hs:7:6: error:
- • Couldn't match type ‘m0 a0’ with ‘()’
+ • Couldn't match type ‘() a0’ with ‘()’
Expected type: ((), w ())
- Actual type: (m0 a0, t0 m0)
+ Actual type: (() a0, w ())
• In the expression: f1
In an equation for ‘f2’: f2 = f1
diff --git a/testsuite/tests/typecheck/should_fail/T7734.stderr b/testsuite/tests/typecheck/should_fail/T7734.stderr
index 9cd71add8d..d4efb614df 100644
--- a/testsuite/tests/typecheck/should_fail/T7734.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7734.stderr
@@ -1,16 +1,16 @@
-T7734.hs:4:13:
- Occurs check: cannot construct the infinite type: t2 ~ t2 -> t1
- In the first argument of ‘x’, namely ‘x’
- In the expression: x x
- Relevant bindings include
- x :: t2 -> t1 (bound at T7734.hs:4:1)
- f :: (t2 -> t1) -> t -> t1 (bound at T7734.hs:4:1)
+T7734.hs:4:13: error:
+ • Occurs check: cannot construct the infinite type: r2 ~ r2 -> r1
+ • In the first argument of ‘x’, namely ‘x’
+ In the expression: x x
+ • Relevant bindings include
+ x :: r2 -> r1 (bound at T7734.hs:4:1)
+ f :: (r2 -> r1) -> r -> r1 (bound at T7734.hs:4:1)
-T7734.hs:5:13:
- Occurs check: cannot construct the infinite type: t2 ~ t2 -> t1
- In the first argument of ‘x’, namely ‘x’
- In the expression: x x
- Relevant bindings include
- x :: t2 -> t1 (bound at T7734.hs:5:5)
- (&) :: (t2 -> t1) -> t -> t1 (bound at T7734.hs:5:1)
+T7734.hs:5:13: error:
+ • Occurs check: cannot construct the infinite type: r2 ~ r2 -> r1
+ • In the first argument of ‘x’, namely ‘x’
+ In the expression: x x
+ • Relevant bindings include
+ x :: r2 -> r1 (bound at T7734.hs:5:5)
+ (&) :: (r2 -> r1) -> r -> r1 (bound at T7734.hs:5:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7778.stderr b/testsuite/tests/typecheck/should_fail/T7778.stderr
index 7538c15cce..545d885129 100644
--- a/testsuite/tests/typecheck/should_fail/T7778.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7778.stderr
@@ -1,5 +1,12 @@
-
-T7778.hs:3:19: error:
- Expecting one more argument to ‘Num’
- Expected a type, but ‘Num’ has kind ‘* -> Constraint’
- In the type signature: v :: ((Num Int => Num) ()) => ()
+
+T7778.hs:3:7: error:
+ • Expecting one fewer argument to ‘Num Int => Num’
+ Expected kind ‘* -> Constraint’, but ‘Num Int => Num’ has kind ‘*’
+ • In the type signature:
+ v :: ((Num Int => Num) ()) => ()
+
+T7778.hs:3:19: error:
+ • Expecting one more argument to ‘Num’
+ Expected a type, but ‘Num’ has kind ‘* -> Constraint’
+ • In the type signature:
+ v :: ((Num Int => Num) ()) => ()
diff --git a/testsuite/tests/typecheck/should_fail/T7857.stderr b/testsuite/tests/typecheck/should_fail/T7857.stderr
index e923a02472..2596efb51f 100644
--- a/testsuite/tests/typecheck/should_fail/T7857.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7857.stderr
@@ -1,17 +1,17 @@
T7857.hs:8:11: error:
- Could not deduce (PrintfType r0) arising from a use of ‘printf’
- from the context: PrintfArg t
- bound by the inferred type of g :: PrintfArg t => t -> b
- at T7857.hs:8:1-21
- The type variable ‘r0’ is ambiguous
- These potential instances exist:
- instance [safe] (a ~ ()) => PrintfType (IO a)
- -- Defined in ‘Text.Printf’
- instance [safe] (PrintfArg a, PrintfType r) => PrintfType (a -> r)
- -- Defined in ‘Text.Printf’
- instance [safe] IsChar c => PrintfType [c]
- -- Defined in ‘Text.Printf’
- In the second argument of ‘($)’, namely ‘printf "" i’
- In the expression: f $ printf "" i
- In an equation for ‘g’: g i = f $ printf "" i
+ • Could not deduce (PrintfType a0) arising from a use of ‘printf’
+ from the context: PrintfArg t
+ bound by the inferred type of g :: PrintfArg t => t -> b
+ at T7857.hs:8:1-21
+ The type variable ‘a0’ is ambiguous
+ These potential instances exist:
+ instance [safe] (a ~ ()) => PrintfType (IO a)
+ -- Defined in ‘Text.Printf’
+ instance [safe] (PrintfArg a, PrintfType r) => PrintfType (a -> r)
+ -- Defined in ‘Text.Printf’
+ instance [safe] IsChar c => PrintfType [c]
+ -- Defined in ‘Text.Printf’
+ • In the second argument of ‘($)’, namely ‘printf "" i’
+ In the expression: f $ printf "" i
+ In an equation for ‘g’: g i = f $ printf "" i
diff --git a/testsuite/tests/typecheck/should_fail/T7892.stderr b/testsuite/tests/typecheck/should_fail/T7892.stderr
index 559ac67270..d6120f936c 100644
--- a/testsuite/tests/typecheck/should_fail/T7892.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7892.stderr
@@ -1,2 +1,2 @@
-T7892.hs:5:4: Couldn't match kind ‘*’ against ‘* -> *’
+T7892.hs:5:4: error: Expected kind ‘* -> *’, but ‘f’ has kind ‘*’
diff --git a/testsuite/tests/typecheck/should_fail/T8030.stderr b/testsuite/tests/typecheck/should_fail/T8030.stderr
index c6c05f8cf1..6e902a4294 100644
--- a/testsuite/tests/typecheck/should_fail/T8030.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8030.stderr
@@ -6,7 +6,7 @@ T8030.hs:9:3: error:
• In the ambiguity check for ‘op1’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method:
- op1 :: forall (k :: BOX) (a :: k). C a => Pr a
+ op1 :: forall k (a :: k). C a => Pr a
In the class declaration for ‘C’
T8030.hs:10:3: error:
@@ -14,9 +14,9 @@ T8030.hs:10:3: error:
NB: ‘Pr’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
Expected type: Pr a -> Pr a -> Pr a
- Actual type: Pr a0 -> Pr a0 -> Pr a0
+ Actual type: Pr a0 -> Pr a0 -> Pr a0
• In the ambiguity check for ‘op2’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method:
- op2 :: forall (k :: BOX) (a :: k). C a => Pr a -> Pr a -> Pr a
+ op2 :: forall k (a :: k). C a => Pr a -> Pr a -> Pr a
In the class declaration for ‘C’
diff --git a/testsuite/tests/typecheck/should_fail/T8262.stderr b/testsuite/tests/typecheck/should_fail/T8262.stderr
index b6f7ef7711..45e201cc76 100644
--- a/testsuite/tests/typecheck/should_fail/T8262.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8262.stderr
@@ -1,11 +1,7 @@
T8262.hs:5:15: error:
- Couldn't match kind ‘*’ with ‘#’
- When matching types
- a :: *
- Int# :: #
- In the first argument of ‘Just’, namely ‘(1#)’
- In the expression: Just (1#)
- In an equation for ‘foo’: foo x = Just (1#)
- Relevant bindings include
- foo :: t -> Maybe a (bound at T8262.hs:5:1)
+ • Couldn't match a lifted type with an unlifted type
+ When matching the kind of ‘Int#’
+ • In the first argument of ‘Just’, namely ‘(1#)’
+ In the expression: Just (1#)
+ In an equation for ‘foo’: foo x = Just (1#)
diff --git a/testsuite/tests/typecheck/should_fail/T8514.stderr b/testsuite/tests/typecheck/should_fail/T8514.stderr
index 41aeb3b52e..e3ea4cb385 100644
--- a/testsuite/tests/typecheck/should_fail/T8514.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8514.stderr
@@ -1,7 +1,6 @@
T8514.hs:3:16:
Expecting one more argument to ‘Maybe’
- The second argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
In the type ‘(a, Maybe)’
In the type declaration for ‘T’
diff --git a/testsuite/tests/typecheck/should_fail/T8603.stderr b/testsuite/tests/typecheck/should_fail/T8603.stderr
index a3d17ceb56..5bfd397167 100644
--- a/testsuite/tests/typecheck/should_fail/T8603.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8603.stderr
@@ -6,14 +6,10 @@ T8603.hs:13:10: error:
T8603.hs:29:17: error:
• Couldn't match kind ‘* -> *’ with ‘*’
- When matching types
- t1 :: (* -> *) -> * -> *
- (->) :: * -> * -> *
- Expected type: [Integer] -> StateT s RV t0
- Actual type: t1 ((->) [a0]) (StateT s RV t0)
+ When matching the kind of ‘[[a0]]’
• The function ‘lift’ is applied to two arguments,
- but its type ‘([a0] -> StateT s RV t0)
- -> t1 ((->) [a0]) (StateT s RV t0)’
+ but its type ‘[] [a0] (StateT s RV t0)
+ -> (->) [[a0]] (StateT s RV t0)’
has only one
In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
In the expression:
@@ -22,7 +18,7 @@ T8603.hs:29:17: error:
T8603.hs:29:22: error:
• Couldn't match type ‘RV a0’ with ‘StateT s RV t0’
- Expected type: [a0] -> StateT s RV t0
+ Expected type: [] [a0] (StateT s RV t0)
Actual type: [a0] -> RV a0
• In the first argument of ‘lift’, namely ‘uniform’
In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
diff --git a/testsuite/tests/typecheck/should_fail/T8806.stderr b/testsuite/tests/typecheck/should_fail/T8806.stderr
index 0131dbd929..0c7a06291a 100644
--- a/testsuite/tests/typecheck/should_fail/T8806.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8806.stderr
@@ -1,8 +1,20 @@
-
-T8806.hs:5:6: error:
- Expected a constraint, but ‘Int’ has kind ‘*’
- In the type signature: f :: Int => Int
-
-T8806.hs:8:7: error:
- Expected a constraint, but ‘Int’ has kind ‘*’
- In the type signature: g :: (Int => Show a) => Int
+
+T8806.hs:5:6: error:
+ • Expected a constraint, but ‘Int’ has kind ‘*’
+ • In the type signature:
+ f :: Int => Int
+
+T8806.hs:8:7: error:
+ • Expected a constraint, but ‘Int’ has kind ‘*’
+ • In the type signature:
+ g :: (Int => Show a) => Int
+
+T8806.hs:8:7: error:
+ • Expected a constraint, but ‘Show a’ has kind ‘*’
+ • In the type signature:
+ g :: (Int => Show a) => Int
+
+T8806.hs:8:14: error:
+ • Expected a type, but ‘Show a’ has kind ‘Constraint’
+ • In the type signature:
+ g :: (Int => Show a) => Int
diff --git a/testsuite/tests/typecheck/should_fail/T9109.stderr b/testsuite/tests/typecheck/should_fail/T9109.stderr
index afd77c4f81..defd77572e 100644
--- a/testsuite/tests/typecheck/should_fail/T9109.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9109.stderr
@@ -1,14 +1,15 @@
-T9109.hs:8:13:
- Couldn't match expected type ‘t’ with actual type ‘Bool’
- ‘t’ is untouchable
- inside the constraints: t1 ~ Bool
- bound by a pattern with constructor: GBool :: G Bool,
- in an equation for ‘foo’
- at T9109.hs:8:5-9
- ‘t’ is a rigid type variable bound by
- the inferred type of foo :: G t1 -> t at T9109.hs:8:1
- Possible fix: add a type signature for ‘foo’
- In the expression: True
- In an equation for ‘foo’: foo GBool = True
- Relevant bindings include foo :: G t1 -> t (bound at T9109.hs:8:1)
+T9109.hs:8:13: error:
+ • Couldn't match expected type ‘r’ with actual type ‘Bool’
+ ‘r’ is untouchable
+ inside the constraints: r1 ~ Bool
+ bound by a pattern with constructor: GBool :: G Bool,
+ in an equation for ‘foo’
+ at T9109.hs:8:5-9
+ ‘r’ is a rigid type variable bound by
+ the inferred type of foo :: G r1 -> r at T9109.hs:8:1
+ Possible fix: add a type signature for ‘foo’
+ • In the expression: True
+ In an equation for ‘foo’: foo GBool = True
+ • Relevant bindings include
+ foo :: G r1 -> r (bound at T9109.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T9196.stderr b/testsuite/tests/typecheck/should_fail/T9196.stderr
index fd10f24875..c6765a9a69 100644
--- a/testsuite/tests/typecheck/should_fail/T9196.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9196.stderr
@@ -1,8 +1,15 @@
-
-T9196.hs:4:7: error:
- Illegal constraint: forall a. Eq a
- In the type signature: f :: (forall a. Eq a) => a -> a
-
-T9196.hs:7:7: error:
- Expected a constraint, but ‘Eq a => Ord a’ has kind ‘*’
- In the type signature: g :: (Eq a => Ord a) => a -> a
+
+T9196.hs:4:7: error:
+ • Illegal constraint: forall a. Eq a
+ • In the type signature:
+ f :: (forall a. Eq a) => a -> a
+
+T9196.hs:7:7: error:
+ • Expected a constraint, but ‘Ord a’ has kind ‘*’
+ • In the type signature:
+ g :: (Eq a => Ord a) => a -> a
+
+T9196.hs:7:15: error:
+ • Expected a type, but ‘Ord a’ has kind ‘Constraint’
+ • In the type signature:
+ g :: (Eq a => Ord a) => a -> a
diff --git a/testsuite/tests/typecheck/should_fail/T9201.stderr b/testsuite/tests/typecheck/should_fail/T9201.stderr
index 2f1d0a2dae..b6c187548b 100644
--- a/testsuite/tests/typecheck/should_fail/T9201.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9201.stderr
@@ -1,6 +1,7 @@
T9201.hs:6:17: error:
- The first argument of ‘f’ should have kind ‘x1’,
- but ‘a’ has kind ‘y1’
- In the type signature: ret :: d a (f a)
- In the class declaration for ‘MonoidalCCC’
+ • Expected kind ‘x’, but ‘a’ has kind ‘y’
+ • In the first argument of ‘f’, namely ‘a’
+ In the second argument of ‘d’, namely ‘f a’
+ In the type signature:
+ ret :: d a (f a)
diff --git a/testsuite/tests/typecheck/should_fail/T9260.stderr b/testsuite/tests/typecheck/should_fail/T9260.stderr
index a163b16cbd..0773da2bf5 100644
--- a/testsuite/tests/typecheck/should_fail/T9260.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9260.stderr
@@ -1,7 +1,7 @@
T9260.hs:12:8: error:
- Couldn't match type ‘2’ with ‘1’
- Expected type: Fin 1
- Actual type: Fin (1 + 1)
- In the expression: Fsucc Fzero
- In an equation for ‘test’: test = Fsucc Fzero
+ • Couldn't match type ‘2’ with ‘1’
+ Expected type: Fin 1
+ Actual type: Fin (1 + 1)
+ • In the expression: Fsucc Fzero
+ In an equation for ‘test’: test = Fsucc Fzero
diff --git a/testsuite/tests/typecheck/should_fail/T9999.stderr b/testsuite/tests/typecheck/should_fail/T9999.stderr
index 0defd090b0..934da44f38 100644
--- a/testsuite/tests/typecheck/should_fail/T9999.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9999.stderr
@@ -1,10 +1,9 @@
T9999.hs:13:38: error:
- No instance for (Typeable F1) arising from a use of ‘typeRep’
- GHC can't yet do polykinded Typeable (F1 :: k0 -> *)
- In the second argument of ‘(==)’, namely
- ‘typeRep (Proxy :: Proxy F1)’
- In the expression:
- typeRep (Proxy :: Proxy F) == typeRep (Proxy :: Proxy F1)
- In an equation for ‘main’:
- main = typeRep (Proxy :: Proxy F) == typeRep (Proxy :: Proxy F1)
+ • No instance for (Typeable k0) arising from a use of ‘typeRep’
+ • In the second argument of ‘(==)’, namely
+ ‘typeRep (Proxy :: Proxy F1)’
+ In the expression:
+ typeRep (Proxy :: Proxy F) == typeRep (Proxy :: Proxy F1)
+ In an equation for ‘main’:
+ main = typeRep (Proxy :: Proxy F) == typeRep (Proxy :: Proxy F1)
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
index c97acc25a7..8141caf5b5 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
@@ -1,64 +1,68 @@
TcCoercibleFail.hs:11:8: error:
- Couldn't match representation of type ‘Int’ with that of ‘()’
- arising from a use of ‘coerce’
- In the expression: coerce
- In the expression: coerce $ one :: ()
- In an equation for ‘foo1’: foo1 = coerce $ one :: ()
+ • Couldn't match representation of type ‘Int’ with that of ‘()’
+ arising from a use of ‘coerce’
+ • In the expression: coerce
+ In the expression: coerce $ one :: ()
+ In an equation for ‘foo1’: foo1 = coerce $ one :: ()
TcCoercibleFail.hs:14:8: error:
- Couldn't match representation of type ‘m Int’ with that of ‘m Age’
- arising from a use of ‘coerce’
- NB: We cannot know what roles the parameters to ‘m’ have;
- we must assume that the role is nominal
- In the expression: coerce
- In the expression: coerce $ (return one :: m Int)
- In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int)
- Relevant bindings include
- foo2 :: m Age (bound at TcCoercibleFail.hs:14:1)
+ • Couldn't match representation of type ‘m Int’
+ with that of ‘m Age’
+ arising from a use of ‘coerce’
+ NB: We cannot know what roles the parameters to ‘m’ have;
+ we must assume that the role is nominal
+ • In the expression: coerce
+ In the expression: coerce $ (return one :: m Int)
+ In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int)
+ • Relevant bindings include
+ foo2 :: m Age (bound at TcCoercibleFail.hs:14:1)
TcCoercibleFail.hs:16:8: error:
- Couldn't match type ‘Int’ with ‘Age’ arising from a use of ‘coerce’
- In the expression: coerce
- In the expression: coerce $ Map one () :: Map Age ()
- In an equation for ‘foo3’: foo3 = coerce $ Map one () :: Map Age ()
+ • Couldn't match type ‘Int’ with ‘Age’
+ arising from a use of ‘coerce’
+ • In the expression: coerce
+ In the expression: coerce $ Map one () :: Map Age ()
+ In an equation for ‘foo3’: foo3 = coerce $ Map one () :: Map Age ()
TcCoercibleFail.hs:18:8: error:
- Couldn't match representation of type ‘Int’ with that of ‘Down Int’
- arising from a use of ‘coerce’
- The data constructor ‘Down’ of newtype ‘Down’ is not in scope
- In the expression: coerce
- In the expression: coerce $ one :: Down Int
- In an equation for ‘foo4’: foo4 = coerce $ one :: Down Int
+ • Couldn't match representation of type ‘Int’
+ with that of ‘Down Int’
+ arising from a use of ‘coerce’
+ The data constructor ‘Down’ of newtype ‘Down’ is not in scope
+ • In the expression: coerce
+ In the expression: coerce $ one :: Down Int
+ In an equation for ‘foo4’: foo4 = coerce $ one :: Down Int
TcCoercibleFail.hs:21:8: error:
- Couldn't match representation of type ‘Void’ with that of ‘()’
- arising from a use of ‘coerce’
- In the expression: coerce :: Void -> ()
- In an equation for ‘foo5’: foo5 = coerce :: Void -> ()
+ • Couldn't match representation of type ‘Void’ with that of ‘()’
+ arising from a use of ‘coerce’
+ • In the expression: coerce :: Void -> ()
+ In an equation for ‘foo5’: foo5 = coerce :: Void -> ()
TcCoercibleFail.hs:24:9: error:
- Couldn't match representation of type ‘VoidBad ()’
- with that of ‘()’
- arising from a use of ‘coerce’
- In the expression: coerce :: (VoidBad ()) -> ()
- In an equation for ‘foo5'’: foo5' = coerce :: (VoidBad ()) -> ()
+ • Couldn't match representation of type ‘VoidBad ()’
+ with that of ‘()’
+ arising from a use of ‘coerce’
+ • In the expression: coerce :: (VoidBad ()) -> ()
+ In an equation for ‘foo5'’: foo5' = coerce :: (VoidBad ()) -> ()
TcCoercibleFail.hs:28:8: error:
- Reduction stack overflow; size = 201
- When simplifying the following type: Fix (Either Age)
- Use -freduction-depth=0 to disable this check
- (any upper bound you could choose might fail unpredictably with
- minor updates to GHC, so disabling the check is recommended if
- you're sure that type checking should terminate)
- In the expression: coerce :: Fix (Either Int) -> Fix (Either Age)
- In an equation for ‘foo6’:
- foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)
+ • Reduction stack overflow; size = 201
+ When simplifying the following type:
+ Coercible (Fix (Either Int)) (Fix (Either Age))
+ Use -freduction-depth=0 to disable this check
+ (any upper bound you could choose might fail unpredictably with
+ minor updates to GHC, so disabling the check is recommended if
+ you're sure that type checking should terminate)
+ • In the expression: coerce :: Fix (Either Int) -> Fix (Either Age)
+ In an equation for ‘foo6’:
+ foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)
TcCoercibleFail.hs:29:8: error:
- Couldn't match representation of type ‘Either
- Int (Fix (Either Int))’
- with that of ‘()’
- arising from a use of ‘coerce’
- In the expression: coerce :: Fix (Either Int) -> ()
- In an equation for ‘foo7’: foo7 = coerce :: Fix (Either Int) -> ()
+ • Couldn't match representation of type ‘Either
+ Int (Fix (Either Int))’
+ with that of ‘()’
+ arising from a use of ‘coerce’
+ • In the expression: coerce :: Fix (Either Int) -> ()
+ In an equation for ‘foo7’: foo7 = coerce :: Fix (Either Int) -> ()
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.hs b/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.hs
index 8d89b52639..d165648a32 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.hs
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+
import Data.Coerce (Coercible)
instance Coercible () ()
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.stderr
index 29c268d22f..b121f91c65 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail2.stderr
@@ -1,5 +1,5 @@
-TcCoercibleFail2.hs:3:10:
+TcCoercibleFail2.hs:5:10: error:
Illegal instance declaration for ‘Coercible () ()’
- The class is abstract, manual instances are not permitted.
+ Manual instances of this class are not permitted.
In the instance declaration for ‘Coercible () ()’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail002.stderr b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
index 4017239930..285b6bf577 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail002.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
@@ -1,8 +1,8 @@
-tcfail002.hs:4:7:
- Occurs check: cannot construct the infinite type: t ~ [t]
- In the expression: z
- In an equation for ‘c’: c z = z
- Relevant bindings include
- z :: [t] (bound at tcfail002.hs:4:3)
- c :: [t] -> t (bound at tcfail002.hs:3:1)
+tcfail002.hs:4:7: error:
+ • Occurs check: cannot construct the infinite type: r ~ [r]
+ • In the expression: z
+ In an equation for ‘c’: c z = z
+ • Relevant bindings include
+ z :: [r] (bound at tcfail002.hs:4:3)
+ c :: [r] -> r (bound at tcfail002.hs:3:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail004.stderr b/testsuite/tests/typecheck/should_fail/tcfail004.stderr
index 9c51edc5b2..2294a6166f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail004.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail004.stderr
@@ -1,9 +1,9 @@
-
-tcfail004.hs:3:9:
- Couldn't match expected type ‘(t, t1)’
- with actual type ‘(Integer, Integer, Integer)’
- In the expression: (1, 2, 3)
- In a pattern binding: (f, g) = (1, 2, 3)
- Relevant bindings include
- f :: t (bound at tcfail004.hs:3:2)
- g :: t1 (bound at tcfail004.hs:3:4)
+
+tcfail004.hs:3:9: error:
+ • Couldn't match expected type ‘(r, r1)’
+ with actual type ‘(Integer, Integer, Integer)’
+ • In the expression: (1, 2, 3)
+ In a pattern binding: (f, g) = (1, 2, 3)
+ • Relevant bindings include
+ f :: r (bound at tcfail004.hs:3:2)
+ g :: r1 (bound at tcfail004.hs:3:4)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail005.stderr b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
index c9d3360243..4c585af3da 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail005.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
@@ -1,9 +1,9 @@
-
-tcfail005.hs:3:9:
- Couldn't match expected type ‘[t]’
- with actual type ‘(Integer, Char)’
- In the expression: (1, 'a')
- In a pattern binding: (h : i) = (1, 'a')
- Relevant bindings include
- h :: t (bound at tcfail005.hs:3:2)
- i :: [t] (bound at tcfail005.hs:3:4)
+
+tcfail005.hs:3:9: error:
+ • Couldn't match expected type ‘[r]’
+ with actual type ‘(Integer, Char)’
+ • In the expression: (1, 'a')
+ In a pattern binding: (h : i) = (1, 'a')
+ • Relevant bindings include
+ h :: r (bound at tcfail005.hs:3:2)
+ i :: [r] (bound at tcfail005.hs:3:4)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail010.stderr b/testsuite/tests/typecheck/should_fail/tcfail010.stderr
index abffc1acd2..92ee3d8f8e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail010.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail010.stderr
@@ -1,6 +1,6 @@
tcfail010.hs:3:17:
- No instance for (Num [t0]) arising from a use of ‘+’
+ No instance for (Num [r0]) arising from a use of ‘+’
In the expression: z + 2
In the expression: \ (y : z) -> z + 2
In an equation for ‘q’: q = \ (y : z) -> z + 2
diff --git a/testsuite/tests/typecheck/should_fail/tcfail013.stderr b/testsuite/tests/typecheck/should_fail/tcfail013.stderr
index 2f200abcce..332f10e729 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail013.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail013.stderr
@@ -1,6 +1,7 @@
-tcfail013.hs:4:3:
- Couldn't match expected type ‘[t]’ with actual type ‘Bool’
- In the pattern: True
- In an equation for ‘f’: f True = 2
- Relevant bindings include f :: [t] -> a (bound at tcfail013.hs:3:1)
+tcfail013.hs:4:3: error:
+ • Couldn't match expected type ‘[r]’ with actual type ‘Bool’
+ • In the pattern: True
+ In an equation for ‘f’: f True = 2
+ • Relevant bindings include
+ f :: [r] -> a (bound at tcfail013.hs:3:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail014.stderr b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
index bf28aa76b7..92307b3830 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail014.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
@@ -1,8 +1,8 @@
-tcfail014.hs:5:33:
- Occurs check: cannot construct the infinite type: t8 ~ t8 -> t7
- In the first argument of ‘z’, namely ‘z’
- In the expression: z z
- Relevant bindings include
- z :: t8 -> t7 (bound at tcfail014.hs:5:27)
- h :: (t8 -> t7) -> t7 (bound at tcfail014.hs:5:25)
+tcfail014.hs:5:33: error:
+ • Occurs check: cannot construct the infinite type: r8 ~ r8 -> r7
+ • In the first argument of ‘z’, namely ‘z’
+ In the expression: z z
+ • Relevant bindings include
+ z :: r8 -> r7 (bound at tcfail014.hs:5:27)
+ h :: (r8 -> r7) -> r7 (bound at tcfail014.hs:5:25)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail018.stderr b/testsuite/tests/typecheck/should_fail/tcfail018.stderr
index ef32705126..88c08a8a8b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail018.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail018.stderr
@@ -1,5 +1,5 @@
tcfail018.hs:5:10:
- No instance for (Num [t0]) arising from the literal ‘1’
+ No instance for (Num [r0]) arising from the literal ‘1’
In the expression: 1
In a pattern binding: (a : []) = 1
diff --git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index 649acb0b07..05d33a5e05 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ -1,13 +1,13 @@
-tcfail032.hs:14:8:
- Couldn't match expected type ‘a1 -> Int’ with actual type ‘t’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature: Eq a1 => a1 -> Int
- at tcfail032.hs:14:8-30
- In the expression: (x :: (Eq a) => a -> Int)
- In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
- Relevant bindings include
- x :: t (bound at tcfail032.hs:14:3)
- f :: t -> a -> Int (bound at tcfail032.hs:14:1)
-
+tcfail032.hs:14:8: error:
+ • Couldn't match expected type ‘a1 -> Int’ with actual type ‘r’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ an expression type signature:
+ Eq a1 => a1 -> Int
+ at tcfail032.hs:14:8-30
+ • In the expression: (x :: (Eq a) => a -> Int)
+ In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
+ • Relevant bindings include
+ x :: r (bound at tcfail032.hs:14:3)
+ f :: r -> a -> Int (bound at tcfail032.hs:14:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail036.hs b/testsuite/tests/typecheck/should_fail/tcfail036.hs
index ade1720ccc..62c7b7e26b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail036.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail036.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE FlexibleInstances #-}
+
-- !!! prelude class name in an instance-tycon position
--
module ShouldFail where
diff --git a/testsuite/tests/typecheck/should_fail/tcfail036.stderr b/testsuite/tests/typecheck/should_fail/tcfail036.stderr
index a9aef1192b..e94ba6a2a4 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail036.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail036.stderr
@@ -1,11 +1,11 @@
-tcfail036.hs:6:10:
+tcfail036.hs:8:10:
Duplicate instance declarations:
- instance Num NUM -- Defined at tcfail036.hs:6:10
instance Num NUM -- Defined at tcfail036.hs:8:10
+ instance Num NUM -- Defined at tcfail036.hs:10:10
-tcfail036.hs:9:13:
+tcfail036.hs:11:13:
Expecting one more argument to ‘Num’
- The first argument of ‘Eq’ should have kind ‘*’,
- but ‘Num’ has kind ‘* -> Constraint’
+ Expected a type, but ‘Num’ has kind ‘* -> Constraint’
+ In the first argument of ‘Eq’, namely ‘Num’
In the instance declaration for ‘Eq Num’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail049.stderr b/testsuite/tests/typecheck/should_fail/tcfail049.stderr
index 12fc06db98..1b74ce0070 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail049.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail049.stderr
@@ -1,2 +1,2 @@
-
-tcfail049.hs:3:7: error: Variable not in scope: g :: t1 -> t
+
+tcfail049.hs:3:7: error: Variable not in scope: g :: t -> t1
diff --git a/testsuite/tests/typecheck/should_fail/tcfail050.stderr b/testsuite/tests/typecheck/should_fail/tcfail050.stderr
index 881e497b4d..2ca5065938 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail050.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail050.stderr
@@ -1,3 +1,3 @@
-
-tcfail050.hs:3:7: error:
- Data constructor not in scope: B :: t1 -> t
+
+tcfail050.hs:3:7: error:
+ Data constructor not in scope: B :: t -> t1
diff --git a/testsuite/tests/typecheck/should_fail/tcfail057.stderr b/testsuite/tests/typecheck/should_fail/tcfail057.stderr
index 07a8116173..945c81c1cd 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail057.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail057.stderr
@@ -1,5 +1,5 @@
tcfail057.hs:5:7: error:
- • Constraint ‘RealFrac a’ used as a type
+ • Expected a type, but ‘RealFrac a’ has kind ‘Constraint’
• In the type signature:
f :: (RealFrac a) -> a -> a
diff --git a/testsuite/tests/typecheck/should_fail/tcfail070.stderr b/testsuite/tests/typecheck/should_fail/tcfail070.stderr
index d98857de4c..6236947709 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail070.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail070.stderr
@@ -1,5 +1,6 @@
tcfail070.hs:15:15:
- ‘[Int]’ is applied to too many type arguments
+ Expecting one fewer argument to ‘[Int]’
+ Expected kind ‘* -> k0’, but ‘[Int]’ has kind ‘*’
In the type ‘[Int] Bool’
In the type declaration for ‘State’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail078.stderr b/testsuite/tests/typecheck/should_fail/tcfail078.stderr
index 8a7837df00..f68b142340 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail078.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail078.stderr
@@ -1,4 +1,6 @@
-
-tcfail078.hs:5:6: error:
- ‘Integer’ is applied to too many type arguments
- In the type signature: f :: Integer i => i
+
+tcfail078.hs:5:6: error:
+ • Expecting one fewer argument to ‘Integer’
+ Expected kind ‘* -> Constraint’, but ‘Integer’ has kind ‘*’
+ • In the type signature:
+ f :: Integer i => i
diff --git a/testsuite/tests/typecheck/should_fail/tcfail088.stderr b/testsuite/tests/typecheck/should_fail/tcfail088.stderr
index d9cd5427b7..1aedd2a43c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail088.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail088.stderr
@@ -1,4 +1,4 @@
tcfail088.hs:9:19:
- Illegal polymorphic or qualified type: forall s. T s a
+ Illegal polymorphic or qualified type: forall s1. T s1 a
In the instance declaration for ‘Ord (forall s. T s a)’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail090.stderr b/testsuite/tests/typecheck/should_fail/tcfail090.stderr
index 6c6f97d932..662d7da804 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail090.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail090.stderr
@@ -1,8 +1,6 @@
tcfail090.hs:11:9: error:
- Couldn't match kind ‘*’ with ‘#’
- When matching types
- a0 :: *
- ByteArray# :: #
- In the expression: my_undefined
- In an equation for ‘die’: die _ = my_undefined
+ • Couldn't match a lifted type with an unlifted type
+ When matching the kind of ‘ByteArray#’
+ • In the expression: my_undefined
+ In an equation for ‘die’: die _ = my_undefined
diff --git a/testsuite/tests/typecheck/should_fail/tcfail099.stderr b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
index 9fdccb3335..687fafb6da 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail099.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
@@ -1,14 +1,14 @@
-
-tcfail099.hs:9:20:
- Couldn't match expected type ‘a’ with actual type ‘t’
- because type variable ‘a’ would escape its scope
- This (rigid, skolem) type variable is bound by
- a pattern with constructor: C :: forall a. (a -> Int) -> DS,
- in an equation for ‘call’
- at tcfail099.hs:9:7-9
- In the first argument of ‘f’, namely ‘arg’
- In the expression: f arg
- Relevant bindings include
- arg :: t (bound at tcfail099.hs:9:12)
- f :: a -> Int (bound at tcfail099.hs:9:9)
- call :: DS -> t -> Int (bound at tcfail099.hs:9:1)
+
+tcfail099.hs:9:20: error:
+ • Couldn't match expected type ‘a’ with actual type ‘r’
+ because type variable ‘a’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ a pattern with constructor: C :: forall a. (a -> Int) -> DS,
+ in an equation for ‘call’
+ at tcfail099.hs:9:7-9
+ • In the first argument of ‘f’, namely ‘arg’
+ In the expression: f arg
+ • Relevant bindings include
+ arg :: r (bound at tcfail099.hs:9:12)
+ f :: a -> Int (bound at tcfail099.hs:9:9)
+ call :: DS -> r -> Int (bound at tcfail099.hs:9:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail113.stderr b/testsuite/tests/typecheck/should_fail/tcfail113.stderr
index 06837f6f73..b84151ac73 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail113.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail113.stderr
@@ -1,14 +1,18 @@
-
-tcfail113.hs:12:7: error:
- Expecting one more argument to ‘Maybe’
- Expected kind ‘*’, but ‘Maybe’ has kind ‘* -> *’
- In the type signature: f :: [Maybe]
-
-tcfail113.hs:15:8: error:
- The first argument of ‘T’ should have kind ‘* -> *’,
- but ‘Int’ has kind ‘*’
- In the type signature: g :: T Int
-
-tcfail113.hs:18:6: error:
- ‘Int’ is applied to too many type arguments
- In the type signature: h :: Int Int
+
+tcfail113.hs:12:7: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type signature:
+ f :: [Maybe]
+
+tcfail113.hs:15:8: error:
+ • Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
+ • In the first argument of ‘T’, namely ‘Int’
+ In the type signature:
+ g :: T Int
+
+tcfail113.hs:18:6: error:
+ • Expecting one fewer argument to ‘Int’
+ Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
+ • In the type signature:
+ h :: Int Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail122.stderr b/testsuite/tests/typecheck/should_fail/tcfail122.stderr
index 47b391df6d..ab743441f9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail122.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail122.stderr
@@ -1,18 +1,15 @@
tcfail122.hs:8:9: error:
- Couldn't match kind ‘* -> *’ with ‘*’
- When matching types
- c0 :: (* -> *) -> *
- a :: * -> *
- Expected type: a b
- Actual type: c0 d0
- In the expression:
- undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d
- In the expression:
- [undefined :: forall a b. a b,
- undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d]
- In an equation for ‘foo’:
- foo
- = [undefined :: forall a b. a b,
- undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d]
- Relevant bindings include foo :: [a b] (bound at tcfail122.hs:7:1)
+ • Couldn't match kind ‘* -> *’ with ‘*’
+ When matching the kind of ‘a’
+ • In the expression:
+ undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d
+ In the expression:
+ [undefined :: forall a b. a b,
+ undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d]
+ In an equation for ‘foo’:
+ foo
+ = [undefined :: forall a b. a b,
+ undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d]
+ • Relevant bindings include
+ foo :: [a b] (bound at tcfail122.hs:7:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail123.stderr b/testsuite/tests/typecheck/should_fail/tcfail123.stderr
index 396d63c9f8..00b8bbdd10 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail123.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail123.stderr
@@ -1,9 +1,7 @@
tcfail123.hs:11:9: error:
- Couldn't match kind ‘*’ with ‘#’
- When matching types
- t0 :: *
- Int# :: #
+ Couldn't match a lifted type with an unlifted type
+ When matching the kind of ‘Int#’
In the first argument of ‘f’, namely ‘3#’
In the expression: f 3#
In an equation for ‘h’: h v = f 3#
diff --git a/testsuite/tests/typecheck/should_fail/tcfail132.stderr b/testsuite/tests/typecheck/should_fail/tcfail132.stderr
index 16fee3fbb4..9ec35d7d9f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail132.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail132.stderr
@@ -1,6 +1,15 @@
-tcfail132.hs:17:37:
- The first argument of ‘T’ should have kind ‘* -> * -> * -> *’,
+tcfail132.hs:17:37: error:
+ Expecting one fewer argument to ‘Object f' f t’
+ Expected kind ‘* -> * -> * -> *’,
but ‘Object f' f t’ has kind ‘* -> * -> *’
+ In the first argument of ‘T’, namely ‘Object f' f t’
+ In the type ‘T (Object f' f t) (DUnit t)’
+ In the type declaration for ‘LiftObject’
+
+tcfail132.hs:17:53: error:
+ Expected kind ‘* -> * -> * -> *’,
+ but ‘DUnit t’ has kind ‘* -> * -> *’
+ In the second argument of ‘T’, namely ‘DUnit t’
In the type ‘T (Object f' f t) (DUnit t)’
In the type declaration for ‘LiftObject’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail133.stderr b/testsuite/tests/typecheck/should_fail/tcfail133.stderr
index 32f73422af..f629ea0140 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail133.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail133.stderr
@@ -3,9 +3,9 @@ tcfail133.hs:2:61: warning:
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
tcfail133.hs:68:7: error:
- Ambiguous type variable ‘r0’ arising from a use of ‘show’
- prevents the constraint ‘(Show r0)’ from being solved.
- Probable fix: use a type annotation to specify what ‘r0’ should be.
+ Ambiguous type variable ‘a0’ arising from a use of ‘show’
+ prevents the constraint ‘(Show a0)’ from being solved.
+ Probable fix: use a type annotation to specify what ‘a0’ should be.
These potential instances exist:
instance Show Module -- Defined in ‘GHC.Show’
instance Show Ordering -- Defined in ‘GHC.Show’
@@ -18,7 +18,7 @@ tcfail133.hs:68:7: error:
foo = show $ add (One :@ Zero) (One :@ One)
tcfail133.hs:68:14: error:
- No instance for (AddDigit (Zero :@ (One :@ One)) One r0)
+ No instance for (AddDigit (Zero :@ (One :@ One)) One a0)
arising from a use of ‘add’
In the second argument of ‘($)’, namely
‘add (One :@ Zero) (One :@ One)’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail140.stderr b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
index 09eb70c588..41268ec6df 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail140.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
@@ -1,38 +1,40 @@
-
-tcfail140.hs:10:7: error:
- Couldn't match expected type ‘Integer -> t’ with actual type ‘Int’
- The function ‘f’ is applied to two arguments,
- but its type ‘Int -> Int’ has only one
- In the expression: f 3 9
- In an equation for ‘bar’: bar = f 3 9
- Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
-
-tcfail140.hs:12:10: error:
- Couldn't match expected type ‘Integer -> t1’ with actual type ‘Int’
- The operator ‘f’ takes two arguments,
- but its type ‘Int -> Int’ has only one
- In the expression: 3 `f` 4
- In an equation for ‘rot’: rot xs = 3 `f` 4
- Relevant bindings include
- rot :: t -> t1 (bound at tcfail140.hs:12:1)
-
-tcfail140.hs:14:15: error:
- Couldn't match expected type ‘a -> b’ with actual type ‘Int’
- The operator ‘f’ takes two arguments,
- but its type ‘Int -> Int’ has only one
- In the first argument of ‘map’, namely ‘(3 `f`)’
- In the expression: map (3 `f`) xs
- Relevant bindings include
- xs :: [a] (bound at tcfail140.hs:14:5)
- bot :: [a] -> [b] (bound at tcfail140.hs:14:1)
-
-tcfail140.hs:16:8: error:
- The constructor ‘Just’ should have 1 argument, but has been given none
- In the pattern: Just
- In the expression: (\ Just x -> x) :: Maybe a -> a
- In the expression: ((\ Just x -> x) :: Maybe a -> a) (Just 1)
-
-tcfail140.hs:19:1: error:
- Couldn't match expected type ‘t0 -> Bool’ with actual type ‘Int’
- The equation(s) for ‘g’ have two arguments,
- but its type ‘Int -> Int’ has only one
+
+tcfail140.hs:10:7: error:
+ • Couldn't match expected type ‘Integer -> t’
+ with actual type ‘Int’
+ • The function ‘f’ is applied to two arguments,
+ but its type ‘Int -> Int’ has only one
+ In the expression: f 3 9
+ In an equation for ‘bar’: bar = f 3 9
+ • Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
+
+tcfail140.hs:12:10: error:
+ • Couldn't match expected type ‘Integer -> t’
+ with actual type ‘Int’
+ • The operator ‘f’ takes two arguments,
+ but its type ‘Int -> Int’ has only one
+ In the expression: 3 `f` 4
+ In an equation for ‘rot’: rot xs = 3 `f` 4
+ • Relevant bindings include
+ rot :: r -> t (bound at tcfail140.hs:12:1)
+
+tcfail140.hs:14:15: error:
+ • Couldn't match expected type ‘a -> b’ with actual type ‘Int’
+ • The operator ‘f’ takes two arguments,
+ but its type ‘Int -> Int’ has only one
+ In the first argument of ‘map’, namely ‘(3 `f`)’
+ In the expression: map (3 `f`) xs
+ • Relevant bindings include
+ xs :: [a] (bound at tcfail140.hs:14:5)
+ bot :: [a] -> [b] (bound at tcfail140.hs:14:1)
+
+tcfail140.hs:16:8: error:
+ • The constructor ‘Just’ should have 1 argument, but has been given none
+ • In the pattern: Just
+ In the expression: (\ Just x -> x) :: Maybe a -> a
+ In the expression: ((\ Just x -> x) :: Maybe a -> a) (Just 1)
+
+tcfail140.hs:19:1: error:
+ • Couldn't match expected type ‘t0 -> Bool’ with actual type ‘Int’
+ • The equation(s) for ‘g’ have two arguments,
+ but its type ‘Int -> Int’ has only one
diff --git a/testsuite/tests/typecheck/should_fail/tcfail146.stderr b/testsuite/tests/typecheck/should_fail/tcfail146.stderr
index c1cce251a9..cf9341dfb3 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:
- Constraint ‘SClass a’ used as a type
- In the type ‘SClass a’
- In the definition of data constructor ‘SCon’
- In the data declaration for ‘SData’
+ • Expected a type, but ‘SClass a’ has kind ‘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/tcfail147.stderr b/testsuite/tests/typecheck/should_fail/tcfail147.stderr
index 68ec767eed..0c4db9a88e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail147.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail147.stderr
@@ -1,7 +1,7 @@
-tcfail147.hs:7:19:
+tcfail147.hs:7:19: error:
Expecting one more argument to ‘XClass’
- Expected a type, but ‘XClass’ has kind ‘k0 -> Constraint’
+ Expected a type, but ‘XClass’ has kind ‘* -> Constraint’
In the type ‘XClass’
In the definition of data constructor ‘XCon’
In the data declaration for ‘XData’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail151.stderr b/testsuite/tests/typecheck/should_fail/tcfail151.stderr
index 3e675c2ef0..5e4dcfcf2f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail151.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail151.stderr
@@ -6,3 +6,10 @@ tcfail151.hs:8:6:
Expecting one more argument to ‘Name a’
Expected a constraint, but ‘Name a’ has kind ‘* -> Constraint’
In the data declaration for ‘Exp’
+
+tcfail151.hs:8:30:
+ Expecting one more argument to ‘a’
+ Expected a type, but ‘a’ has kind ‘* -> *’
+ In the type ‘a’
+ In the definition of data constructor ‘MkExp’
+ In the data declaration for ‘Exp’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail159.stderr b/testsuite/tests/typecheck/should_fail/tcfail159.stderr
index 48c4ceb406..e28363a707 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail159.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail159.stderr
@@ -1,9 +1,7 @@
tcfail159.hs:9:11: error:
- Couldn't match kind ‘*’ with ‘#’
- When matching types
- t0 :: *
- (# Int, Int #) :: #
+ Couldn't match a lifted type with an unlifted type
+ When matching the kind of ‘(# Int, Int #)’
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/tcfail160.stderr b/testsuite/tests/typecheck/should_fail/tcfail160.stderr
index 7e17d5c476..46a7640cf9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail160.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail160.stderr
@@ -1,5 +1,6 @@
-
-tcfail160.hs:7:8: error:
- The first argument of ‘T’ should have kind ‘* -> *’,
- but ‘Int’ has kind ‘*’
- In the type signature: g :: T Int
+
+tcfail160.hs:7:8: error:
+ • Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
+ • In the first argument of ‘T’, namely ‘Int’
+ In the type signature:
+ g :: T Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail161.stderr b/testsuite/tests/typecheck/should_fail/tcfail161.stderr
index afe989206f..ce783bb5ab 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail161.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail161.stderr
@@ -1,5 +1,6 @@
-
-tcfail161.hs:5:7: error:
- Expecting one more argument to ‘Maybe’
- Expected kind ‘*’, but ‘Maybe’ has kind ‘* -> *’
- In the type signature: f :: [Maybe]
+
+tcfail161.hs:5:7: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type signature:
+ f :: [Maybe]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
index 6d483798b1..18309c10d1 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
@@ -3,7 +3,7 @@ tcfail181.hs:17:9: error:
Could not deduce (Monad m0) arising from a use of ‘foo’
from the context: Monad m
bound by the inferred type of
- wog :: Monad m => t -> Something (m Bool) e
+ wog :: Monad m => r -> Something (m Bool) e
at tcfail181.hs:17:1-30
The type variable ‘m0’ is ambiguous
These potential instances exist:
diff --git a/testsuite/tests/typecheck/should_fail/tcfail184.stderr b/testsuite/tests/typecheck/should_fail/tcfail184.stderr
index 8d349cd864..ed33280cf6 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail184.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail184.stderr
@@ -1,7 +1,7 @@
tcfail184.hs:8:19:
Illegal polymorphic or qualified type:
- forall a. Ord a => [a] -> [a]
+ forall a1. Ord a1 => [a1] -> [a1]
Perhaps you intended to use RankNTypes or Rank2Types
In the definition of data constructor ‘MkSwizzle’
In the newtype declaration for ‘Swizzle’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail195.stderr b/testsuite/tests/typecheck/should_fail/tcfail195.stderr
index c1cb85abce..c044a37117 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail195.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail195.stderr
@@ -1,5 +1,5 @@
-
-tcfail195.hs:6:3: error:
- Illegal polymorphic or qualified type: forall a. a
- In the definition of data constructor ‘Foo’
- In the data type declaration for ‘Foo’
+
+tcfail195.hs:6:3: error:
+ Illegal polymorphic or qualified type: forall a1. a1
+ In the definition of data constructor ‘Foo’
+ In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail196.stderr b/testsuite/tests/typecheck/should_fail/tcfail196.stderr
index bcb2c32700..0dbbda8f13 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail196.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail196.stderr
@@ -1,4 +1,5 @@
-
-tcfail196.hs:5:8: error:
- Illegal polymorphic or qualified type: forall a. a
- In the type signature: bar :: Num (forall a. a) => Int -> Int
+
+tcfail196.hs:5:8: error:
+ • Illegal polymorphic or qualified type: forall a1. a1
+ • In the type signature:
+ bar :: Num (forall a. a) => Int -> Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail197.stderr b/testsuite/tests/typecheck/should_fail/tcfail197.stderr
index 8b814870f2..802a77fa47 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail197.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail197.stderr
@@ -1,5 +1,6 @@
-
-tcfail197.hs:5:8: error:
- Illegal polymorphic or qualified type: forall a. a
- GHC doesn't yet support impredicative polymorphism
- In the type signature: foo :: [forall a. a] -> Int
+
+tcfail197.hs:5:8: error:
+ • Illegal polymorphic or qualified type: forall a1. a1
+ GHC doesn't yet support impredicative polymorphism
+ • In the type signature:
+ foo :: [forall a. a] -> Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail200.stderr b/testsuite/tests/typecheck/should_fail/tcfail200.stderr
index 7570047d0c..c8a6fa94f2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail200.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail200.stderr
@@ -1,11 +1,7 @@
tcfail200.hs:5:15: error:
- Couldn't match kind ‘*’ with ‘#’
- When matching types
- t1 :: *
- Int# :: #
- In the expression: 1#
- In the expression: (1#, 'c')
- In an equation for ‘x’: x = (1#, 'c')
- Relevant bindings include
- x :: (t1, Char) (bound at tcfail200.hs:5:9)
+ • Couldn't match a lifted type with an unlifted type
+ When matching the kind of ‘Int#’
+ • In the expression: 1#
+ In the expression: (1#, 'c')
+ In an equation for ‘x’: x = (1#, 'c')
diff --git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index 03efc08ff2..c19aa0c274 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ -3,7 +3,7 @@ tcfail201.hs:17:58: error:
• Couldn't match expected type ‘a’ with actual type ‘HsDoc id0’
‘a’ is a rigid type variable bound by
the type signature for:
- gfoldl' :: forall a (c :: * -> *).
+ gfoldl' :: forall (c :: * -> *) a.
(forall a1 b. c (a1 -> b) -> a1 -> c b)
-> (forall g. g -> c g) -> a -> c a
at tcfail201.hs:15:12
diff --git a/testsuite/tests/typecheck/should_fail/tcfail212.stderr b/testsuite/tests/typecheck/should_fail/tcfail212.stderr
index e14e62bddf..8eb7e6e57f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail212.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail212.stderr
@@ -1,10 +1,22 @@
-
-tcfail212.hs:10:7: error:
- Expecting one more argument to ‘Maybe’
- The first argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
- In the type signature: f :: (Maybe, Either Int)
-
-tcfail212.hs:13:7: error:
- Expecting a lifted type, but ‘Int#’ is unlifted
- In the type signature: g :: (Int#, Int#)
+
+tcfail212.hs:10:7: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type signature:
+ f :: (Maybe, Either Int)
+
+tcfail212.hs:10:14: error:
+ • Expecting one more argument to ‘Either Int’
+ Expected a type, but ‘Either Int’ has kind ‘* -> *’
+ • In the type signature:
+ f :: (Maybe, Either Int)
+
+tcfail212.hs:13:7: error:
+ • Expecting a lifted type, but ‘Int#’ is unlifted
+ • In the type signature:
+ g :: (Int#, Int#)
+
+tcfail212.hs:13:13: error:
+ • Expecting a lifted type, but ‘Int#’ is unlifted
+ • In the type signature:
+ g :: (Int#, Int#)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail213.hs b/testsuite/tests/typecheck/should_fail/tcfail213.hs
index c93c4ad999..f9e44f8cf4 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail213.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail213.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE TypeFamilies, ConstraintKinds #-}
module ShouldFail where
-import GHC.Prim( Constraint )
+import GHC.Exts( Constraint )
type family F a :: Constraint
diff --git a/testsuite/tests/typecheck/should_fail/tcfail214.hs b/testsuite/tests/typecheck/should_fail/tcfail214.hs
index 81162e678e..a88bbf2196 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail214.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail214.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE TypeFamilies, ConstraintKinds #-}
module ShouldFail where
-import GHC.Prim( Constraint )
+import GHC.Exts( Constraint )
type family F a :: Constraint
diff --git a/testsuite/tests/typecheck/should_fail/tcfail217.stderr b/testsuite/tests/typecheck/should_fail/tcfail217.stderr
index c51b97d8b5..0dc1a593b1 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail217.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail217.stderr
@@ -1,4 +1,4 @@
-tcfail217.hs:7:1:
+tcfail217.hs:7:1: error:
Cycle in class declaration (via superclasses): A -> Aish -> A
In the class declaration for ‘A’
diff --git a/testsuite/tests/typecheck/should_run/T10284.hs b/testsuite/tests/typecheck/should_run/T10284.hs
index 8fc86351a0..c703284e51 100644
--- a/testsuite/tests/typecheck/should_run/T10284.hs
+++ b/testsuite/tests/typecheck/should_run/T10284.hs
@@ -1,17 +1,16 @@
{-# OPTIONS_GHC -fdefer-type-errors -fno-warn-deferred-type-errors #-}
import Control.Exception
+import Data.Functor
a :: Int
a = 'a'
main :: IO ()
main = do
- catch (evaluate a)
+ catch (void $ evaluate a)
(\e -> do let err = show (e :: TypeError)
- putStrLn ("As expected, TypeError: " ++ err)
- return "")
- catch (evaluate a)
+ putStrLn ("As expected, TypeError: " ++ err))
+ catch (void $ evaluate a)
(\e -> do let err = show (e :: ErrorCall)
- putStrLn ("Something went horribly wrong: " ++ err)
- return "")
+ putStrLn ("Something went horribly wrong: " ++ err))
diff --git a/testsuite/tests/typecheck/should_run/T10284.stderr b/testsuite/tests/typecheck/should_run/T10284.stderr
index c7133f0172..622e2bfa45 100644
--- a/testsuite/tests/typecheck/should_run/T10284.stderr
+++ b/testsuite/tests/typecheck/should_run/T10284.stderr
@@ -1,5 +1,5 @@
-T10284: T10284.hs:14:19: error:
- Couldn't match expected type ‘()’ with actual type ‘Int’
- In the first argument of ‘evaluate’, namely ‘a’
- In the first argument of ‘catch’, namely ‘(evaluate a)’
+T10284: T10284.hs:7:5: error:
+ • Couldn't match expected type ‘Int’ with actual type ‘Char’
+ • In the expression: 'a'
+ In an equation for ‘a’: a = 'a'
(deferred type error)
diff --git a/testsuite/tests/typecheck/should_run/T10284.stdout b/testsuite/tests/typecheck/should_run/T10284.stdout
index 82f9518fc7..5d5c564c18 100644
--- a/testsuite/tests/typecheck/should_run/T10284.stdout
+++ b/testsuite/tests/typecheck/should_run/T10284.stdout
@@ -1,4 +1,4 @@
-As expected, TypeError: T10284.hs:6:5: error:
+As expected, TypeError: T10284.hs:7:5: error:
• Couldn't match expected type ‘Int’ with actual type ‘Char’
• In the expression: 'a'
In an equation for ‘a’: a = 'a'
diff --git a/testsuite/tests/typecheck/should_run/T7861.stdout b/testsuite/tests/typecheck/should_run/T7861.stdout
index 6578f4363d..0f2678faac 100644
--- a/testsuite/tests/typecheck/should_run/T7861.stdout
+++ b/testsuite/tests/typecheck/should_run/T7861.stdout
@@ -1,2 +1 @@
"Hello 1"
-"Hello 2"
diff --git a/testsuite/tests/typecheck/should_run/tcrun043.hs b/testsuite/tests/typecheck/should_run/tcrun043.hs
index 4a745cf0b0..78accb8604 100644
--- a/testsuite/tests/typecheck/should_run/tcrun043.hs
+++ b/testsuite/tests/typecheck/should_run/tcrun043.hs
@@ -1,6 +1,6 @@
{-# LANGUAGE GADTs, TypeFamilies, ConstraintKinds #-}
-import GHC.Prim ( Constraint )
+import GHC.Exts ( Constraint )
type Showish = Show
diff --git a/testsuite/tests/typecheck/should_run/tcrun044.hs b/testsuite/tests/typecheck/should_run/tcrun044.hs
index 029c4f9050..3e2f99381c 100644
--- a/testsuite/tests/typecheck/should_run/tcrun044.hs
+++ b/testsuite/tests/typecheck/should_run/tcrun044.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE TypeFamilies, ConstraintKinds #-}
import qualified Data.Set as S
-import GHC.Prim ( Constraint )
+import GHC.Exts ( Constraint )
class RMonad m where
type RMonadCtxt m a :: Constraint
@@ -22,7 +22,7 @@ instance RMonad S.Set where
main = do
- print $ (returnR 1 ++ returnR 2) `bindR`
+ print $ (returnR 1 ++ returnR 2) `bindR`
(\x -> returnR (x + 1) ++ returnR (x + 2))
- print $ (returnR 1 `S.union` returnR 2) `bindR`
+ print $ (returnR 1 `S.union` returnR 2) `bindR`
(\x -> returnR (x + 1) `S.union` returnR (x + 2))