summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-12-01 17:38:23 +0100
committerBen Gamari <ben@smart-cactus.org>2015-12-01 18:45:23 +0100
commit1e041b7382b6aa329e4ad9625439f811e0f27232 (patch)
tree91f4418553a1e6df072f56f43b5697d40c985b5f /testsuite/tests/typecheck
parentb432e2f39c095d8acbb0cfcc63bd08436c7a3e49 (diff)
downloadhaskell-1e041b7382b6aa329e4ad9625439f811e0f27232.tar.gz
Refactor treatment of wildcards
This patch began as a modest refactoring of HsType and friends, to clarify and tidy up exactly where quantification takes place in types. Although initially driven by making the implementation of wildcards more tidy (and fixing a number of bugs), I gradually got drawn into a pretty big process, which I've been doing on and off for quite a long time. There is one compiler performance regression as a result of all this, in perf/compiler/T3064. I still need to look into that. * The principal driving change is described in Note [HsType binders] in HsType. Well worth reading! * Those data type changes drive almost everything else. In particular we now statically know where (a) implicit quantification only (LHsSigType), e.g. in instance declaratios and SPECIALISE signatures (b) implicit quantification and wildcards (LHsSigWcType) can appear, e.g. in function type signatures * As part of this change, HsForAllTy is (a) simplified (no wildcards) and (b) split into HsForAllTy and HsQualTy. The two contructors appear when and only when the correponding user-level construct appears. Again see Note [HsType binders]. HsExplicitFlag disappears altogether. * Other simplifications - ExprWithTySig no longer needs an ExprWithTySigOut variant - TypeSig no longer needs a PostRn name [name] field for wildcards - PatSynSig records a LHsSigType rather than the decomposed pieces - The mysterious 'GenericSig' is now 'ClassOpSig' * Renamed LHsTyVarBndrs to LHsQTyVars * There are some uninteresting knock-on changes in Haddock, because of the HsSyn changes I also did a bunch of loosely-related changes: * We already had type synonyms CoercionN/CoercionR for nominal and representational coercions. I've added similar treatment for TcCoercionN/TcCoercionR mkWpCastN/mkWpCastN All just type synonyms but jolly useful. * I record-ised ForeignImport and ForeignExport * I improved the (poor) fix to Trac #10896, by making TcTyClsDecls.checkValidTyCl recover from errors, but adding a harmless, abstract TyCon to the envt if so. * I did some significant refactoring in RnEnv.lookupSubBndrOcc, for reasons that I have (embarrassingly) now totally forgotten. It had to do with something to do with import and export Updates haddock submodule.
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/should_compile/FD1.stderr19
-rw-r--r--testsuite/tests/typecheck/should_compile/FD2.stderr38
-rw-r--r--testsuite/tests/typecheck/should_compile/FD3.stderr23
-rw-r--r--testsuite/tests/typecheck/should_compile/T10632.stderr9
-rw-r--r--testsuite/tests/typecheck/should_compile/T7220a.stderr28
-rw-r--r--testsuite/tests/typecheck/should_compile/T9834.stderr46
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.stderr38
-rw-r--r--testsuite/tests/typecheck/should_compile/tc141.stderr86
-rw-r--r--testsuite/tests/typecheck/should_compile/tc166.hs4
-rw-r--r--testsuite/tests/typecheck/should_compile/tc168.stderr22
-rw-r--r--testsuite/tests/typecheck/should_compile/tc182.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc244.hs62
-rw-r--r--testsuite/tests/typecheck/should_fail/ContextStack2.stderr25
-rw-r--r--testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/CustomTypeErrors03.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr35
-rw-r--r--testsuite/tests/typecheck/should_fail/FailDueToGivenOverlapping.stderr25
-rw-r--r--testsuite/tests/typecheck/should_fail/IPFail.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/T10285.stderr34
-rw-r--r--testsuite/tests/typecheck/should_fail/T10351.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T10534.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/T10715.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/T11112.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/T1897a.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/T1899.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/T2538.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/T2714.stderr18
-rw-r--r--testsuite/tests/typecheck/should_fail/T3102.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/T3540.stderr25
-rw-r--r--testsuite/tests/typecheck/should_fail/T4875.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T5236.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/T5300.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/T5957.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/T6022.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T7279.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/T7410.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T7453.stderr81
-rw-r--r--testsuite/tests/typecheck/should_fail/T7609.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/T7645.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T7696.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/T7697.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T7748a.stderr34
-rw-r--r--testsuite/tests/typecheck/should_fail/T7778.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T7809.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T7869.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/T8030.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T8034.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/T8142.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/T8392a.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T8450.stderr16
-rw-r--r--testsuite/tests/typecheck/should_fail/T8603.stderr43
-rw-r--r--testsuite/tests/typecheck/should_fail/T8806.stderr16
-rw-r--r--testsuite/tests/typecheck/should_fail/T8883.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T9196.stderr16
-rw-r--r--testsuite/tests/typecheck/should_fail/T9201.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/mc19.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/mc21.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/mc22.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail032.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail034.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail057.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail058.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail063.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail065.stderr27
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail067.stderr155
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail068.stderr159
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail072.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail076.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail078.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail080.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail097.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail098.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail101.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail102.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail103.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail107.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail110.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail113.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail116.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail127.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail131.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail134.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail135.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail142.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail153.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail158.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail160.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail161.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail175.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail179.stderr36
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail181.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail191.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail193.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail196.stderr9
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail197.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail201.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail206.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail208.stderr18
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail209a.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail212.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail215.stderr8
-rwxr-xr-xtestsuite/tests/typecheck/should_run/Defer01.hs5
-rw-r--r--testsuite/tests/typecheck/should_run/T7861.stderr6
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun008.hs11
105 files changed, 1100 insertions, 1023 deletions
diff --git a/testsuite/tests/typecheck/should_compile/FD1.stderr b/testsuite/tests/typecheck/should_compile/FD1.stderr
index 661bbcd9aa..19d698294a 100644
--- a/testsuite/tests/typecheck/should_compile/FD1.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD1.stderr
@@ -1,9 +1,10 @@
-
-FD1.hs:16:1:
- Couldn't match expected type ‘Int -> Int’ with actual type ‘a’
- ‘a’ is a rigid type variable bound by
- the type signature for: plus :: E a (Int -> Int) => Int -> a
- at FD1.hs:15:9
- The equation(s) for ‘plus’ have two arguments,
- but its type ‘Int -> a’ has only one
- Relevant bindings include plus :: Int -> a (bound at FD1.hs:16:1)
+
+FD1.hs:16:1: error:
+ • Couldn't match expected type ‘Int -> Int’ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ plus :: forall a. E a (Int -> Int) => Int -> a
+ at FD1.hs:15:9
+ • The equation(s) for ‘plus’ have two arguments,
+ but its type ‘Int -> a’ has only one
+ • Relevant bindings include plus :: Int -> a (bound at FD1.hs:16:1)
diff --git a/testsuite/tests/typecheck/should_compile/FD2.stderr b/testsuite/tests/typecheck/should_compile/FD2.stderr
index 590c9b6520..93997c52ec 100644
--- a/testsuite/tests/typecheck/should_compile/FD2.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD2.stderr
@@ -1,19 +1,19 @@
-
-FD2.hs:26:34:
- Couldn't match expected type ‘e1’ with actual type ‘e’
- ‘e’ is a rigid type variable bound by
- the type signature for:
- foldr1 :: Elem a e => (e -> e -> e) -> a -> e
- at FD2.hs:21:13
- ‘e1’ is a rigid type variable bound by
- the type signature for:
- mf :: Elem a e1 => e1 -> Maybe e1 -> Maybe e1
- at FD2.hs:24:18
- In the first argument of ‘Just’, namely ‘(f x y)’
- In the expression: Just (f x y)
- Relevant bindings include
- y :: e1 (bound at FD2.hs:26:23)
- x :: e1 (bound at FD2.hs:26:15)
- mf :: e1 -> Maybe e1 -> Maybe e1 (bound at FD2.hs:25:12)
- f :: e -> e -> e (bound at FD2.hs:22:10)
- foldr1 :: (e -> e -> e) -> a -> e (bound at FD2.hs:22:3)
+
+FD2.hs:26:34: error:
+ • Couldn't match expected type ‘e1’ with actual type ‘e’
+ ‘e’ is a rigid type variable bound by
+ the type signature for:
+ foldr1 :: forall e. Elem a e => (e -> e -> e) -> a -> e
+ at FD2.hs:21:13
+ ‘e1’ is a rigid type variable bound by
+ the type signature for:
+ mf :: forall e1. Elem a e1 => e1 -> Maybe e1 -> Maybe e1
+ at FD2.hs:24:18
+ • In the first argument of ‘Just’, namely ‘(f x y)’
+ In the expression: Just (f x y)
+ • Relevant bindings include
+ y :: e1 (bound at FD2.hs:26:23)
+ x :: e1 (bound at FD2.hs:26:15)
+ mf :: e1 -> Maybe e1 -> Maybe e1 (bound at FD2.hs:25:12)
+ f :: e -> e -> e (bound at FD2.hs:22:10)
+ foldr1 :: (e -> e -> e) -> a -> e (bound at FD2.hs:22:3)
diff --git a/testsuite/tests/typecheck/should_compile/FD3.stderr b/testsuite/tests/typecheck/should_compile/FD3.stderr
index 8d3c33fcaf..f0dafbe47c 100644
--- a/testsuite/tests/typecheck/should_compile/FD3.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD3.stderr
@@ -1,14 +1,15 @@
FD3.hs:15:15: error:
- Couldn't match type ‘a’ with ‘(String, a)’
- arising from a functional dependency between:
- constraint ‘MkA (String, a) a’ arising from a use of ‘mkA’
- instance ‘MkA a1 a1’ at FD3.hs:12:10-16
- ‘a’ is a rigid type variable bound by
- the type signature for: translate :: (String, a) -> A a
+ • Couldn't match type ‘a’ with ‘(String, a)’
+ arising from a functional dependency between:
+ constraint ‘MkA (String, a) a’ arising from a use of ‘mkA’
+ instance ‘MkA a1 a1’ at FD3.hs:12:10-16
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ translate :: forall a. (String, a) -> A a
at FD3.hs:14:14
- In the expression: mkA a
- In an equation for ‘translate’: translate a = mkA a
- Relevant bindings include
- a :: (String, a) (bound at FD3.hs:15:11)
- translate :: (String, a) -> A a (bound at FD3.hs:15:1)
+ • In the expression: mkA a
+ In an equation for ‘translate’: translate a = mkA a
+ • Relevant bindings include
+ a :: (String, a) (bound at FD3.hs:15:11)
+ translate :: (String, a) -> A a (bound at FD3.hs:15:1)
diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr
index 81377b3364..5a6809de5c 100644
--- a/testsuite/tests/typecheck/should_compile/T10632.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10632.stderr
@@ -1,4 +1,5 @@
-
-T10632.hs:3:6: warning:
- Redundant constraint: ?file1::String
- In the type signature for: f :: (?file1::String) => IO ()
+
+T10632.hs:3:1: warning:
+ Redundant constraint: ?file1::String
+ In the type signature for:
+ f :: (?file1::String) => IO ()
diff --git a/testsuite/tests/typecheck/should_compile/T7220a.stderr b/testsuite/tests/typecheck/should_compile/T7220a.stderr
index ea0331b3dc..b728a1e8d9 100644
--- a/testsuite/tests/typecheck/should_compile/T7220a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T7220a.stderr
@@ -1,14 +1,14 @@
-
-T7220a.hs:17:6:
- Could not deduce (C a b)
- from the context: (C a0 b, TF b ~ Y)
- bound by the type signature for: f :: (C a0 b, TF b ~ Y) => b
- at T7220a.hs:17:6-44
- Possible fix:
- add (C a b) to the context of
- the type signature for: f :: (C a0 b, TF b ~ Y) => b
- In the ambiguity check for the type signature for ‘f’:
- f :: forall a. (forall b. (C a b, TF b ~ Y) => b) -> X
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘f’:
- f :: (forall b. (C a b, TF b ~ Y) => b) -> X
+
+T7220a.hs:17:6: error:
+ Could not deduce (C a b)
+ from the context: (C a0 b, TF b ~ Y)
+ bound by the type signature for:
+ f :: (C a0 b, TF b ~ Y) => b
+ at T7220a.hs:17:6-44
+ Possible fix:
+ add (C a b) to the context of
+ the type signature for:
+ f :: (C a0 b, TF b ~ Y) => b
+ In the ambiguity check for ‘f’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature: f :: (forall b. (C a b, TF b ~ Y) => b) -> X
diff --git a/testsuite/tests/typecheck/should_compile/T9834.stderr b/testsuite/tests/typecheck/should_compile/T9834.stderr
index c49e49bb9d..3ce53a0c51 100644
--- a/testsuite/tests/typecheck/should_compile/T9834.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9834.stderr
@@ -1,8 +1,8 @@
-T9834.hs:23:10: Warning:
+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
+ ‘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)
@@ -20,15 +20,14 @@ T9834.hs:23:10: Warning:
-> p a
(bound at T9834.hs:23:3)
-T9834.hs:23:10: Warning:
+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 (q :: * -> *).
- Applicative q =>
- Comp p q a -> Comp p q a)
- -> p a
- at T9834.hs:22:11
+ ‘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)
@@ -46,19 +45,20 @@ T9834.hs:23:10: Warning:
-> p a
(bound at T9834.hs:23:3)
-T9834.hs:23:10: Warning:
+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 (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:
- Applicative q => Comp p q a1 -> Comp p q a1
- at T9834.hs:23:10
+ ‘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
diff --git a/testsuite/tests/typecheck/should_compile/T9939.stderr b/testsuite/tests/typecheck/should_compile/T9939.stderr
index eda780ae0e..86decf0a5e 100644
--- a/testsuite/tests/typecheck/should_compile/T9939.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9939.stderr
@@ -1,18 +1,20 @@
-
-T9939.hs:5:7: Warning:
- Redundant constraint: Eq a
- In the type signature for: f1 :: (Eq a, Ord a) => a -> a -> Bool
-
-T9939.hs:9:7: Warning:
- Redundant constraint: Eq a
- In the type signature for: f2 :: (Eq a, Ord a) => a -> a -> Bool
-
-T9939.hs:13:7: Warning:
- Redundant constraint: Eq b
- In the type signature for:
- f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
-
-T9939.hs:20:7: 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 b
+ 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 933eb03f55..b5ee77b689 100644
--- a/testsuite/tests/typecheck/should_compile/tc141.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc141.stderr
@@ -1,46 +1,48 @@
-tc141.hs:11:12:
- You cannot bind scoped type variable ‘a’
- in a pattern binding signature
- In the pattern: p :: a
- In the pattern: (p :: a, q :: a)
- In a pattern binding: (p :: a, q :: a) = x
+tc141.hs:11:12: error:
+ • You cannot bind scoped type variable ‘a’
+ in a pattern binding signature
+ • In the pattern: p :: a
+ In the pattern: (p :: a, q :: a)
+ In a pattern binding: (p :: a, q :: a) = x
-tc141.hs:11:31:
- Couldn't match expected type ‘a1’ with actual type ‘a’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature: a1
- at tc141.hs:11:31-34
- In the expression: q :: a
- In the expression: (q :: a, p)
- Relevant bindings include
- 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)
+tc141.hs:11:31: error:
+ • Couldn't match expected type ‘a1’ with actual type ‘a’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ an expression type signature:
+ a1
+ at tc141.hs:11:31-34
+ • In the expression: q :: a
+ In the expression: (q :: a, p)
+ • Relevant bindings include
+ 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)
-tc141.hs:13:13:
- You cannot bind scoped type variable ‘a’
- in a pattern binding signature
- In the pattern: y :: a
- In a pattern binding: y :: a = a
- In the expression:
- let y :: a = a in
- let
- v :: a
- v = b
- in v
+tc141.hs:13:13: error:
+ • You cannot bind scoped type variable ‘a’
+ in a pattern binding signature
+ • In the pattern: y :: a
+ In a pattern binding: y :: a = a
+ In the expression:
+ let y :: a = a in
+ let
+ v :: a
+ v = b
+ in v
-tc141.hs:15:18:
- Couldn't match expected type ‘a2’ with actual type ‘t’
- because type variable ‘a2’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: v :: a2
- at tc141.hs: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)
+tc141.hs:15:18: error:
+ • Couldn't match expected type ‘a2’ with actual type ‘t’
+ because type variable ‘a2’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ v :: a2
+ 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)
diff --git a/testsuite/tests/typecheck/should_compile/tc166.hs b/testsuite/tests/typecheck/should_compile/tc166.hs
index 75ea65c650..5739a347c8 100644
--- a/testsuite/tests/typecheck/should_compile/tc166.hs
+++ b/testsuite/tests/typecheck/should_compile/tc166.hs
@@ -14,9 +14,9 @@ module ShouldCompile where
instance C Char a Bool
data P t a = forall b. (C t a b) => MkP b
-
+
data Q t = MkQ (forall a. P t a)
-
+
f1 :: Q Char
f1 = MkQ (MkP True)
diff --git a/testsuite/tests/typecheck/should_compile/tc168.stderr b/testsuite/tests/typecheck/should_compile/tc168.stderr
index 4eca08f17c..7d992a48a0 100644
--- a/testsuite/tests/typecheck/should_compile/tc168.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc168.stderr
@@ -1,10 +1,12 @@
-
-tc168.hs:17:1:
- Could not deduce (C a1 (a, b0))
- from the context: C a1 (a, b)
- bound by the inferred type for ‘g’: C a1 (a, b) => a1 -> a
- at tc168.hs:17:1-16
- The type variable ‘b0’ is ambiguous
- When checking that ‘g’ has the inferred type
- g :: forall a b a1. C a1 (a, b) => a1 -> a
- Probable cause: the inferred type is ambiguous
+
+tc168.hs:17:1: error:
+ Could not deduce (C a1 (a, b0))
+ from the context: C a1 (a, b)
+ bound by the inferred type for ‘g’:
+ C a1 (a, b) => a1 -> a
+ at tc168.hs:17:1-16
+ The type variable ‘b0’ is ambiguous
+ In the ambiguity check for the inferred type for ‘g’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
+ g :: forall a b a1. C a1 (a, b) => a1 -> a
diff --git a/testsuite/tests/typecheck/should_compile/tc182.hs b/testsuite/tests/typecheck/should_compile/tc182.hs
index f6e9164f47..00b3f724de 100644
--- a/testsuite/tests/typecheck/should_compile/tc182.hs
+++ b/testsuite/tests/typecheck/should_compile/tc182.hs
@@ -9,5 +9,3 @@ data (Show a) => Obs a = forall b. LiftObs a b
f :: Show a => Obs a -> String
f (LiftObs _ _) = "yes"
-
-
diff --git a/testsuite/tests/typecheck/should_compile/tc244.hs b/testsuite/tests/typecheck/should_compile/tc244.hs
index 4c5468809a..196f6e0990 100644
--- a/testsuite/tests/typecheck/should_compile/tc244.hs
+++ b/testsuite/tests/typecheck/should_compile/tc244.hs
@@ -1,30 +1,32 @@
-{-# LANGUAGE TypeFamilies, GADTs #-}
-
--- Tests record update in the presence of
--- existentials, GADTs, type families
-
-module Rec where
-
------------------ Existential
-data S a where
- S1 :: { fs1 :: a, fs2 :: b } -> S a
- S2 :: { fs1 :: a } -> S a
-
-updS s x = s { fs1=x }
-
------------------- GADT
-data T a b where
- T1 :: { ft1 :: a, ft2 :: c, ft3 :: d } -> T a Int
- T2 :: { ft1 :: a, ft3 :: c } -> T a Int
- T3 :: T Int b
-
-f :: T a1 b -> a2 -> T a2 b
-f x v = x { ft1 = v }
-
------------------- Type family
-data family R a
-data instance R (a,b) where
- R1 :: { fr1 :: a, fr2 :: b, fr3 :: c } -> R (a,b)
- R2 :: { fr1 :: a, fr3 :: c } -> R (a,b)
-
-updR r x = r { fr1=x }
+{-# LANGUAGE TypeFamilies, GADTs #-}
+
+-- Tests record update in the presence of
+-- existentials, GADTs, type families
+
+module Rec where
+
+----------------- Existential
+data S a where
+ S1 :: { fs1 :: a, fs2 :: b } -> S a
+ S2 :: { fs1 :: a } -> S a
+
+updS s x = s { fs1=x }
+
+{-
+------------------ GADT
+data T a b where
+ T1 :: { ft1 :: a, ft2 :: c, ft3 :: d } -> T a Int
+ T2 :: { ft1 :: a, ft3 :: c } -> T a Int
+ T3 :: T Int b
+
+f :: T a1 b -> a2 -> T a2 b
+f x v = x { ft1 = v }
+
+------------------ Type family
+data family R a
+data instance R (a,b) where
+ R1 :: { fr1 :: a, fr2 :: b, fr3 :: c } -> R (a,b)
+ R2 :: { fr1 :: a, fr3 :: c } -> R (a,b)
+
+updR r x = r { fr1=x }
+-}
diff --git a/testsuite/tests/typecheck/should_fail/ContextStack2.stderr b/testsuite/tests/typecheck/should_fail/ContextStack2.stderr
index 1a6d1d26aa..4c92698f02 100644
--- a/testsuite/tests/typecheck/should_fail/ContextStack2.stderr
+++ b/testsuite/tests/typecheck/should_fail/ContextStack2.stderr
@@ -1,13 +1,12 @@
-
-ContextStack2.hs:8:6:
- Reduction stack overflow; size = 11
- When simplifying the following type:
- TF (TF (TF (TF (TF a))))
- ~ (TF (TF (TF (TF (TF (TF a))))), TF (TF (TF (TF (TF (TF Int))))))
- 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 ambiguity check for the type signature for ‘t’:
- t :: forall a. (a ~ TF (a, Int)) => Int
- In the type signature for ‘t’: t :: (a ~ TF (a, Int)) => Int
+
+ContextStack2.hs:8:6: error:
+ Reduction stack overflow; size = 11
+ When simplifying the following type:
+ TF (TF (TF (TF (TF a))))
+ ~ (TF (TF (TF (TF (TF (TF a))))), TF (TF (TF (TF (TF (TF Int))))))
+ 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 ambiguity check for ‘t’
+ In the type signature: t :: (a ~ TF (a, Int)) => Int
diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr
index 02ae25931a..464c62d244 100644
--- a/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr
+++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors02.stderr
@@ -1,7 +1,7 @@
CustomTypeErrors02.hs:17:1: error:
• The type 'a_aEN -> a_aEN' cannot be represented as an integer.
- • When checking that ‘err’ has the inferred type
+ • When checking the inferred type
err :: (TypeError ...)
CustomTypeErrors02.hs:17:7: error:
diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors03.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors03.stderr
index 330fadb6fd..b1ceb26b5e 100644
--- a/testsuite/tests/typecheck/should_fail/CustomTypeErrors03.stderr
+++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors03.stderr
@@ -1,5 +1,5 @@
CustomTypeErrors03.hs:6:6: error:
This is a type error
- In the type signature for ‘f’:
+ In the type signature:
f :: TypeError (Text "This is a type error")
diff --git a/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr b/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
index a2a9928181..a2cab99ae9 100644
--- a/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
+++ b/testsuite/tests/typecheck/should_fail/FDsFromGivens.stderr
@@ -1,17 +1,18 @@
-
-FDsFromGivens.hs:9:7: error:
- Couldn't match type ‘[a]’ with ‘Bool’
- arising from a functional dependency between constraints:
- ‘C Char Bool’
- arising from the type signature for:
- g1 :: (C Char [a], C Char Bool) => a -> ()
- at FDsFromGivens.hs:9:7-42
- ‘C Char [a]’
- arising from the type signature for:
- g1 :: (C Char [a], C Char Bool) => a -> ()
- at FDsFromGivens.hs:9:7-42
- In the ambiguity check for the type signature for ‘g1’:
- g1 :: forall a. (C Char [a], C Char Bool) => a -> ()
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘g1’:
- g1 :: (C Char [a], C Char Bool) => a -> ()
+
+FDsFromGivens.hs:9:7: error:
+ Couldn't match type ‘[a]’ with ‘Bool’
+ arising from a functional dependency between constraints:
+ ‘C Char Bool’
+ arising from the type signature for:
+ g1 :: (C Char [a], C Char Bool) => a -> ()
+ at FDsFromGivens.hs:9:7-42
+ ‘C Char [a]’
+ arising from the type signature for:
+ g1 :: (C Char [a], C Char Bool) => a -> ()
+ at FDsFromGivens.hs:9:7-42
+ Inaccessible code in
+ the type signature for:
+ g1 :: (C Char [a], C Char Bool) => a -> ()
+ In the ambiguity check for ‘g1’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature: g1 :: (C Char [a], C Char Bool) => a -> ()
diff --git a/testsuite/tests/typecheck/should_fail/FailDueToGivenOverlapping.stderr b/testsuite/tests/typecheck/should_fail/FailDueToGivenOverlapping.stderr
index 62354d3f02..b9a2629e32 100644
--- a/testsuite/tests/typecheck/should_fail/FailDueToGivenOverlapping.stderr
+++ b/testsuite/tests/typecheck/should_fail/FailDueToGivenOverlapping.stderr
@@ -1,12 +1,13 @@
-
-FailDueToGivenOverlapping.hs:27:9:
- Overlapping instances for E [t0] arising from a use of ‘eop’
- Matching givens (or their superclasses):
- E [Int]
- bound by the type signature for: bar :: E [Int] => () -> ()
- at FailDueToGivenOverlapping.hs:26:8-26
- Matching instances:
- instance E [a] -- Defined at FailDueToGivenOverlapping.hs:21:10
- (The choice depends on the instantiation of ‘t0’)
- In the expression: eop [undefined]
- In an equation for ‘bar’: bar _ = eop [undefined]
+
+FailDueToGivenOverlapping.hs:27:9: error:
+ Overlapping instances for E [t0] arising from a use of ‘eop’
+ Matching givens (or their superclasses):
+ E [Int]
+ bound by the type signature for:
+ bar :: E [Int] => () -> ()
+ at FailDueToGivenOverlapping.hs:26:1-26
+ Matching instances:
+ instance E [a] -- Defined at FailDueToGivenOverlapping.hs:21:10
+ (The choice depends on the instantiation of ‘t0’)
+ In the expression: eop [undefined]
+ In an equation for ‘bar’: bar _ = eop [undefined]
diff --git a/testsuite/tests/typecheck/should_fail/IPFail.stderr b/testsuite/tests/typecheck/should_fail/IPFail.stderr
index 963ccd8b54..59aac31632 100644
--- a/testsuite/tests/typecheck/should_fail/IPFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/IPFail.stderr
@@ -2,8 +2,9 @@
IPFail.hs:6:18: error:
Could not deduce (Num Bool) arising from the literal ‘5’
from the context: ?x::Int
- bound by the type signature for: f0 :: (?x::Int) => () -> Bool
- at IPFail.hs:5:7-31
+ bound by the type signature for:
+ f0 :: (?x::Int) => () -> Bool
+ at IPFail.hs:5:1-31
In the expression: 5
In the expression: let ?x = 5 in ?x
In an equation for ‘f0’: f0 () = let ?x = 5 in ?x
diff --git a/testsuite/tests/typecheck/should_fail/T10285.stderr b/testsuite/tests/typecheck/should_fail/T10285.stderr
index d14bc3b427..b7bba0f575 100644
--- a/testsuite/tests/typecheck/should_fail/T10285.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10285.stderr
@@ -1,20 +1,22 @@
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).
- Coercible a b =>
- Coercion a b,
- in an equation for ‘oops’
- at T10285.hs:8:6-13
+ • 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).
+ Coercible a b =>
+ Coercion a b,
+ in an equation for ‘oops’
+ at T10285.hs:8:6-13
‘a’ is a rigid type variable bound by
- the type signature for: oops :: Coercion (N a) (N b) -> a -> b
- at T10285.hs:7:9
+ the type signature for:
+ oops :: forall a b. Coercion (N a) (N b) -> a -> b
+ at T10285.hs:7:9
‘b’ is a rigid type variable bound by
- the type signature for: oops :: Coercion (N a) (N b) -> a -> b
- at T10285.hs:7:9
- In the expression: coerce
- In an equation for ‘oops’: oops Coercion = coerce
- Relevant bindings include
- oops :: Coercion (N a) (N b) -> a -> b (bound at T10285.hs:8:1)
+ the type signature for:
+ oops :: forall a b. Coercion (N a) (N b) -> a -> b
+ at T10285.hs:7:9
+ • In the expression: coerce
+ In an equation for ‘oops’: oops Coercion = coerce
+ • Relevant bindings include
+ oops :: Coercion (N a) (N b) -> a -> b (bound at T10285.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T10351.stderr b/testsuite/tests/typecheck/should_fail/T10351.stderr
index 58c28e463d..4a9e38eb3e 100644
--- a/testsuite/tests/typecheck/should_fail/T10351.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10351.stderr
@@ -2,5 +2,5 @@
T10351.hs:6:1: error:
Non type-variable argument in the constraint: C [t]
(Use FlexibleContexts to permit this)
- When checking that ‘f’ has the inferred type
+ When checking the inferred type
f :: forall t. C [t] => t -> ()
diff --git a/testsuite/tests/typecheck/should_fail/T10534.stderr b/testsuite/tests/typecheck/should_fail/T10534.stderr
index 41deac7063..ecdb6d2935 100644
--- a/testsuite/tests/typecheck/should_fail/T10534.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10534.stderr
@@ -1,17 +1,19 @@
T10534a.hs:10:9: error:
- Could not deduce: Coercible a b arising from a use of ‘coerce’
- from the context: Coercible (DF a) (DF b)
- bound by the type signature for:
- silly :: Coercible (DF a) (DF b) => a -> b
- at T10534a.hs:9:10-42
+ • Could not deduce: Coercible a b arising from a use of ‘coerce’
+ from the context: Coercible (DF a) (DF b)
+ bound by the type signature for:
+ silly :: Coercible (DF a) (DF b) => a -> b
+ at T10534a.hs:9:1-42
‘a’ is a rigid type variable bound by
- the type signature for: silly :: Coercible (DF a) (DF b) => a -> b
- at T10534a.hs:9:10
+ the type signature for:
+ silly :: forall a b. Coercible (DF a) (DF b) => a -> b
+ at T10534a.hs:9:10
‘b’ is a rigid type variable bound by
- the type signature for: silly :: Coercible (DF a) (DF b) => a -> b
- at T10534a.hs:9:10
- In the expression: coerce
- In an equation for ‘silly’: silly = coerce
- Relevant bindings include
- silly :: a -> b (bound at T10534a.hs:10:1)
+ the type signature for:
+ silly :: forall a b. Coercible (DF a) (DF b) => a -> b
+ at T10534a.hs:9:10
+ • In the expression: coerce
+ In an equation for ‘silly’: silly = coerce
+ • Relevant bindings include
+ silly :: a -> b (bound at T10534a.hs:10:1)
diff --git a/testsuite/tests/typecheck/should_fail/T10715.stderr b/testsuite/tests/typecheck/should_fail/T10715.stderr
index e6f85a5256..0bbaa35573 100644
--- a/testsuite/tests/typecheck/should_fail/T10715.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10715.stderr
@@ -2,14 +2,13 @@
T10715.hs:9:13: error:
Couldn't match representation of type ‘a’ with that of ‘X a’
‘a’ is a rigid type variable bound by
- the type signature for:
- doCoerce :: Coercible a (X a) => a -> X a
- at T10715.hs:9:13
+ the type signature for:
+ doCoerce :: forall a. Coercible a (X a) => a -> X a
+ at T10715.hs:9:13
Inaccessible code in
the type signature for:
doCoerce :: Coercible a (X a) => a -> X a
- In the ambiguity check for the type signature for ‘doCoerce’:
- doCoerce :: forall a. Coercible a (X a) => a -> X a
+ In the ambiguity check for ‘doCoerce’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘doCoerce’:
+ In the type signature:
doCoerce :: Coercible a (X a) => a -> X a
diff --git a/testsuite/tests/typecheck/should_fail/T11112.stderr b/testsuite/tests/typecheck/should_fail/T11112.stderr
index da0ab532a7..3534d33b51 100644
--- a/testsuite/tests/typecheck/should_fail/T11112.stderr
+++ b/testsuite/tests/typecheck/should_fail/T11112.stderr
@@ -1,4 +1,5 @@
T11112.hs:3:9: error:
- Constraint ‘Ord s’ used as a type
- In the type signature for ‘sort’: sort :: Ord s -> [s] -> [s]
+ • Constraint ‘Ord s’ used as a type
+ • In the type signature:
+ sort :: Ord s -> [s] -> [s]
diff --git a/testsuite/tests/typecheck/should_fail/T1897a.stderr b/testsuite/tests/typecheck/should_fail/T1897a.stderr
index 5e7a590fa5..101caab6e7 100644
--- a/testsuite/tests/typecheck/should_fail/T1897a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1897a.stderr
@@ -1,10 +1,12 @@
-
-T1897a.hs:9:1:
- Could not deduce (Wob a0 b)
- from the context: Wob a b
- bound by the inferred type for ‘foo’: Wob a b => b -> [b]
- at T1897a.hs:9:1-24
- The type variable ‘a0’ is ambiguous
- When checking that ‘foo’ has the inferred type
- foo :: forall a b. Wob a b => b -> [b]
- Probable cause: the inferred type is ambiguous
+
+T1897a.hs:9:1: error:
+ Could not deduce (Wob a0 b)
+ from the context: Wob a b
+ bound by the inferred type for ‘foo’:
+ Wob a b => b -> [b]
+ at T1897a.hs:9:1-24
+ The type variable ‘a0’ is ambiguous
+ In the ambiguity check for the inferred type for ‘foo’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
+ foo :: forall a b. Wob a b => b -> [b]
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index d41c96a787..8c2964cfc6 100644
--- a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ -1,13 +1,14 @@
T1899.hs:14:36: error:
- Couldn't match type ‘a’ with ‘Proposition a0’
+ • Couldn't match type ‘a’ with ‘Proposition a0’
‘a’ is a rigid type variable bound by
- the type signature for: transRHS :: [a] -> Int -> Constraint a
- at T1899.hs:9:14
- Expected type: [Proposition a0]
- Actual type: [a]
- In the first argument of ‘Auxiliary’, namely ‘varSet’
- In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
- Relevant bindings include
- varSet :: [a] (bound at T1899.hs:10:11)
- transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
+ the type signature for:
+ transRHS :: forall a. [a] -> Int -> Constraint a
+ at T1899.hs:9:14
+ Expected type: [Proposition a0]
+ Actual type: [a]
+ • In the first argument of ‘Auxiliary’, namely ‘varSet’
+ In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’
+ • Relevant bindings include
+ varSet :: [a] (bound at T1899.hs:10:11)
+ transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
diff --git a/testsuite/tests/typecheck/should_fail/T2538.stderr b/testsuite/tests/typecheck/should_fail/T2538.stderr
index 94583a42b4..a905d95b48 100644
--- a/testsuite/tests/typecheck/should_fail/T2538.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2538.stderr
@@ -1,14 +1,14 @@
-
-T2538.hs:6:6: error:
- Illegal polymorphic or qualified type: Eq a => a -> a
- Perhaps you intended to use RankNTypes or Rank2Types
- In the type signature for ‘f’: f :: (Eq a => a -> a) -> Int
-
-T2538.hs:9:6: error:
- Illegal polymorphic or qualified type: Eq a => a -> a
- GHC doesn't yet support impredicative polymorphism
- In the type signature for ‘g’: g :: [Eq a => a -> a] -> Int
-
-T2538.hs:12:6: error:
- Illegal polymorphic or qualified type: Eq a => a -> a
- In the type signature for ‘h’: h :: Ix (Eq a => a -> a) => Int
+
+T2538.hs:6:6: error:
+ Illegal polymorphic or qualified type: Eq a => a -> a
+ Perhaps you intended to use RankNTypes or Rank2Types
+ In the type signature: f :: (Eq a => a -> a) -> Int
+
+T2538.hs:9:6: error:
+ Illegal polymorphic or qualified type: Eq a => a -> a
+ GHC doesn't yet support impredicative polymorphism
+ In the type signature: g :: [Eq a => a -> a] -> Int
+
+T2538.hs:12:6: error:
+ Illegal polymorphic or qualified type: Eq a => a -> a
+ In the type signature: h :: Ix (Eq a => a -> a) => Int
diff --git a/testsuite/tests/typecheck/should_fail/T2714.stderr b/testsuite/tests/typecheck/should_fail/T2714.stderr
index 07a925cc10..0991ddeec0 100644
--- a/testsuite/tests/typecheck/should_fail/T2714.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2714.stderr
@@ -1,9 +1,10 @@
-T2714.hs:8:5:
+T2714.hs:8:5: error:
Couldn't match type ‘a’ with ‘f0 b’
- ‘a’ is a rigid type variable bound by
- the type signature for: f :: ((a -> b) -> b) -> forall c. c -> a
- at T2714.hs:7:6
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a b. ((a -> b) -> b) -> forall c. c -> a
+ at T2714.hs:7:6
Expected type: ((a -> b) -> b) -> c -> a
Actual type: ((a -> b) -> b) -> f0 (a -> b) -> f0 b
In the expression: ffmap
@@ -11,11 +12,12 @@ T2714.hs:8:5:
Relevant bindings include
f :: ((a -> b) -> b) -> forall c. c -> a (bound at T2714.hs:8:1)
-T2714.hs:8:5:
+T2714.hs:8:5: error:
Couldn't match type ‘c’ with ‘f0 (a -> b)’
- ‘c’ is a rigid type variable bound by
- the type signature for: f :: ((a -> b) -> b) -> c -> a
- at T2714.hs:8:1
+ ‘c’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall c. ((a -> b) -> b) -> c -> a
+ at T2714.hs:8:1
Expected type: ((a -> b) -> b) -> c -> a
Actual type: ((a -> b) -> b) -> f0 (a -> b) -> f0 b
In the expression: ffmap
diff --git a/testsuite/tests/typecheck/should_fail/T3102.stderr b/testsuite/tests/typecheck/should_fail/T3102.stderr
index d23a2729c1..925e80f7fc 100644
--- a/testsuite/tests/typecheck/should_fail/T3102.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3102.stderr
@@ -1,9 +1,11 @@
-
-T3102.hs:11:12:
- Couldn't match type ‘a’ with ‘(?p::Int) => a0’
- ‘a’ is a rigid type variable bound by
- a type expected by the context: a -> String at T3102.hs:11:10
- Expected type: a -> String
- Actual type: ((?p::Int) => a0) -> String
- In the first argument of ‘f’, namely ‘t’
- In the expression: f t
+
+T3102.hs:11:12: error:
+ Couldn't match type ‘a’ with ‘(?p::Int) => a0’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. a -> String
+ at T3102.hs:11:10
+ Expected type: a -> String
+ Actual type: ((?p::Int) => a0) -> String
+ In the first argument of ‘f’, namely ‘t’
+ In the expression: f t
diff --git a/testsuite/tests/typecheck/should_fail/T3540.stderr b/testsuite/tests/typecheck/should_fail/T3540.stderr
index 9867b7401e..75c9dc2ea1 100644
--- a/testsuite/tests/typecheck/should_fail/T3540.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3540.stderr
@@ -1,20 +1,25 @@
T3540.hs:4:12: error:
- Constraint ‘a ~ Int’ used as a type
- In the type signature for ‘thing’: thing :: a ~ Int
+ • Constraint ‘a ~ Int’ used as a type
+ • In the type signature:
+ thing :: a ~ Int
T3540.hs:7:20: error:
- Constraint ‘a ~ Int’ used as a type
- In the type signature for ‘thing1’: thing1 :: Int -> (a ~ Int)
+ • Constraint ‘a ~ Int’ used as a type
+ • In the type signature:
+ thing1 :: Int -> (a ~ Int)
T3540.hs:10:13: error:
- Constraint ‘a ~ Int’ used as a type
- In the type signature for ‘thing2’: thing2 :: (a ~ Int) -> Int
+ • Constraint ‘a ~ Int’ used as a type
+ • In the type signature:
+ thing2 :: (a ~ Int) -> Int
T3540.hs:13:12: error:
- Constraint ‘?dude :: Int’ used as a type
- In the type signature for ‘thing3’: thing3 :: (?dude :: Int) -> Int
+ • Constraint ‘?dude :: Int’ used as a type
+ • In the type signature:
+ thing3 :: (?dude :: Int) -> Int
T3540.hs:16:11: error:
- Constraint ‘Eq a’ used as a type
- In the type signature for ‘thing4’: thing4 :: (Eq a) -> Int
+ • Constraint ‘Eq a’ used as a type
+ • In the type signature:
+ thing4 :: (Eq a) -> Int
diff --git a/testsuite/tests/typecheck/should_fail/T4875.stderr b/testsuite/tests/typecheck/should_fail/T4875.stderr
index 6f885d24fe..98584a44f0 100644
--- a/testsuite/tests/typecheck/should_fail/T4875.stderr
+++ b/testsuite/tests/typecheck/should_fail/T4875.stderr
@@ -1,5 +1,5 @@
-
-T4875.hs:27:24:
- ‘r’ is applied to too many type arguments
- In the type ‘r c -> [c]’
- In the class declaration for ‘Morphic’
+
+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’
diff --git a/testsuite/tests/typecheck/should_fail/T5236.stderr b/testsuite/tests/typecheck/should_fail/T5236.stderr
index c1cbae3699..825218c926 100644
--- a/testsuite/tests/typecheck/should_fail/T5236.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5236.stderr
@@ -1,11 +1,14 @@
-T5236.hs:13:9:
+T5236.hs:13:9: error:
Couldn't match type ‘B’ with ‘A’
- arising from a functional dependency between:
- constraint ‘Id A B’
- arising from the type signature for: loop :: Id A B => Bool
- instance ‘Id B B’ at T5236.hs:11:10-15
- In the ambiguity check for the type signature for ‘loop’:
- loop :: Id A B => Bool
+ arising from a functional dependency between:
+ constraint ‘Id A B’
+ arising from the type signature for:
+ loop :: Id A B => Bool
+ instance ‘Id B B’ at T5236.hs:11:10-15
+ Inaccessible code in
+ the type signature for:
+ loop :: Id A B => Bool
+ In the ambiguity check for ‘loop’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘loop’: loop :: Id A B => Bool
+ In the type signature: loop :: Id A B => Bool
diff --git a/testsuite/tests/typecheck/should_fail/T5300.stderr b/testsuite/tests/typecheck/should_fail/T5300.stderr
index 524edc4446..f751249677 100644
--- a/testsuite/tests/typecheck/should_fail/T5300.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5300.stderr
@@ -6,12 +6,9 @@ T5300.hs:11:7: error:
f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
at T5300.hs:11:7-50
The type variable ‘c0’ is ambiguous
- • In the ambiguity check for the type signature for ‘f1’:
- f1 :: forall a b (m :: * -> *) c.
- (Monad m, C1 a b c) =>
- a -> StateT (T b) m a
+ • In the ambiguity check for ‘f1’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘f1’:
+ In the type signature:
f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
T5300.hs:14:7: error:
@@ -22,11 +19,8 @@ T5300.hs:14:7: error:
a1 -> StateT (T b2) m a2
at T5300.hs:14:7-69
The type variable ‘c20’ is ambiguous
- • In the ambiguity check for the type signature for ‘f2’:
- f2 :: forall a1 b2 (m :: * -> *) a2 b1 c1 c2.
- (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
- a1 -> StateT (T b2) m a2
+ • In the ambiguity check for ‘f2’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘f2’:
+ In the type signature:
f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
diff --git a/testsuite/tests/typecheck/should_fail/T5957.stderr b/testsuite/tests/typecheck/should_fail/T5957.stderr
index 1c457ad6fb..c960ba9689 100644
--- a/testsuite/tests/typecheck/should_fail/T5957.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5957.stderr
@@ -1,6 +1,5 @@
-
-T5957.hs:3:9:
- Illegal polymorphic or qualified type: Show a => a -> String
- Perhaps you intended to use RankNTypes or Rank2Types
- In the type signature for ‘flex’:
- flex :: Int -> Show a => a -> String
+
+T5957.hs:3:9: error:
+ Illegal polymorphic or qualified type: Show a => a -> String
+ Perhaps you intended to use RankNTypes or Rank2Types
+ In the type signature: flex :: Int -> Show a => a -> String
diff --git a/testsuite/tests/typecheck/should_fail/T6022.stderr b/testsuite/tests/typecheck/should_fail/T6022.stderr
index a3cd78e2e1..61d44b2497 100644
--- a/testsuite/tests/typecheck/should_fail/T6022.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6022.stderr
@@ -2,5 +2,5 @@
T6022.hs:3:1: error:
Non type-variable argument in the constraint: Eq ([a] -> a)
(Use FlexibleContexts to permit this)
- When checking that ‘f’ has the inferred type
+ When checking the inferred type
f :: forall a. Eq ([a] -> a) => ([a] -> a) -> Bool
diff --git a/testsuite/tests/typecheck/should_fail/T7279.stderr b/testsuite/tests/typecheck/should_fail/T7279.stderr
index 33af730620..ca30f48069 100644
--- a/testsuite/tests/typecheck/should_fail/T7279.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7279.stderr
@@ -1,11 +1,10 @@
-
-T7279.hs:6:10:
- Could not deduce (Show b0)
- from the context: (Eq a, Show b)
- bound by an instance declaration: (Eq a, Show b) => Eq (T a)
- at T7279.hs:6:10-35
- The type variable ‘b0’ is ambiguous
- In the ambiguity check for an instance declaration:
- forall a b. (Eq a, Show b) => Eq (T a)
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the instance declaration for ‘Eq (T a)’
+
+T7279.hs:6:10: error:
+ Could not deduce (Show b0)
+ from the context: (Eq a, Show b)
+ bound by an instance declaration: (Eq a, Show b) => Eq (T a)
+ at T7279.hs:6:10-35
+ The type variable ‘b0’ is ambiguous
+ In the ambiguity check for an instance declaration
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the instance declaration for ‘Eq (T a)’
diff --git a/testsuite/tests/typecheck/should_fail/T7410.stderr b/testsuite/tests/typecheck/should_fail/T7410.stderr
index 8126362633..46c7a8c2fc 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:
- 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 for ‘foo’: foo :: (Either Int, Int)
+
+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)
diff --git a/testsuite/tests/typecheck/should_fail/T7453.stderr b/testsuite/tests/typecheck/should_fail/T7453.stderr
index 4ca1218772..d3b76c54bf 100644
--- a/testsuite/tests/typecheck/should_fail/T7453.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7453.stderr
@@ -1,45 +1,48 @@
T7453.hs:10:30: error:
- Couldn't match expected type ‘t1’ with actual type ‘t’
- because type variable ‘t1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: z :: Id t1
- at T7453.hs:8:16-19
- In the first argument of ‘Id’, namely ‘v’
- In the expression: 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)
+ • Couldn't match expected type ‘t1’ with actual type ‘t’
+ because type variable ‘t1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ z :: Id t1
+ at T7453.hs:8:11-19
+ • In the first argument of ‘Id’, namely ‘v’
+ In the expression: 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)
T7453.hs:16:33: error:
- Couldn't match expected type ‘t2’ with actual type ‘t’
- because type variable ‘t2’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: z :: () -> t2
- at T7453.hs:14:16-22
- In the first argument of ‘const’, namely ‘v’
- In the expression: 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)
+ • Couldn't match expected type ‘t2’ with actual type ‘t’
+ because type variable ‘t2’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ z :: () -> t2
+ at T7453.hs:14:11-22
+ • In the first argument of ‘const’, namely ‘v’
+ In the expression: 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)
T7453.hs:21:15: error:
- Couldn't match expected type ‘t2’ with actual type ‘t’
- because type variable ‘t2’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type signature for: z :: t2
- at T7453.hs:20:16
- In the expression: v
- In an equation for ‘z’:
- z = v
- 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)
+ • Couldn't match expected type ‘t2’ with actual type ‘t’
+ because type variable ‘t2’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type signature for:
+ z :: t2
+ at T7453.hs:20:11-16
+ • In the expression: v
+ In an equation for ‘z’:
+ z = v
+ 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)
diff --git a/testsuite/tests/typecheck/should_fail/T7609.stderr b/testsuite/tests/typecheck/should_fail/T7609.stderr
index b02dbe20f8..c5ed9fcad9 100644
--- a/testsuite/tests/typecheck/should_fail/T7609.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7609.stderr
@@ -1,10 +1,10 @@
-
-T7609.hs:7:16:
- Expecting one more argument to ‘Maybe’
- The second argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
- In the type signature for ‘f’: f :: (a `X` a, Maybe)
-
-T7609.hs:10:7:
- Expected a constraint, but ‘a `X` a’ has kind ‘*’
- In the type signature for ‘g’: g :: (a `X` a) => Maybe
+
+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
diff --git a/testsuite/tests/typecheck/should_fail/T7645.stderr b/testsuite/tests/typecheck/should_fail/T7645.stderr
index 12d6c15e49..17420143f8 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:
- Expecting one more argument to ‘Maybe’
- The second argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
- In the type signature for ‘f’: f :: ((+) a (a :: *), Maybe)
+
+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)
diff --git a/testsuite/tests/typecheck/should_fail/T7696.stderr b/testsuite/tests/typecheck/should_fail/T7696.stderr
index 73da26c4f4..41f2296797 100644
--- a/testsuite/tests/typecheck/should_fail/T7696.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7696.stderr
@@ -1,11 +1,7 @@
T7696.hs:7:6: error:
- Couldn't match kind ‘* -> *’ with ‘*’
- When matching types
- t0 :: (* -> *) -> *
- w :: * -> *
- Expected type: ((), w ())
- Actual type: (m0 a0, t0 m0)
- In the expression: f1
- In an equation for ‘f2’: f2 = f1
- Relevant bindings include f2 :: ((), w ()) (bound at T7696.hs:7:1)
+ • Couldn't match type ‘m0 a0’ with ‘()’
+ Expected type: ((), w ())
+ Actual type: (m0 a0, t0 m0)
+ • In the expression: f1
+ In an equation for ‘f2’: f2 = f1
diff --git a/testsuite/tests/typecheck/should_fail/T7697.stderr b/testsuite/tests/typecheck/should_fail/T7697.stderr
index 477acc1d09..47d8336588 100644
--- a/testsuite/tests/typecheck/should_fail/T7697.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7697.stderr
@@ -1,4 +1,4 @@
-
-T7697.hs:3:6:
- Expected a constraint, but ‘Int’ has kind ‘*’
- In the type signature for ‘f’: f :: Int => Int
+
+T7697.hs:3:6: error:
+ Expected a constraint, but ‘Int’ has kind ‘*’
+ In the type signature: f :: Int => Int
diff --git a/testsuite/tests/typecheck/should_fail/T7748a.stderr b/testsuite/tests/typecheck/should_fail/T7748a.stderr
index 5e546b171a..2f4c35598f 100644
--- a/testsuite/tests/typecheck/should_fail/T7748a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7748a.stderr
@@ -1,18 +1,20 @@
-T7748a.hs:16:24:
- Couldn't match expected type ‘a’
- with actual type ‘Maybe (Maybe (r -> ()))’
+T7748a.hs:16:24: error:
+ • Couldn't match expected type ‘a’
+ with actual type ‘Maybe (Maybe (r -> ()))’
‘a’ is a rigid type variable bound by
- the type signature for: test :: a -> r -> () at T7748a.hs:11:9
- In the pattern: Just (Just p)
- In a case alternative: Just (Just p) -> p
- In the expression:
- case zd of {
- Nothing -> const ()
- Just Nothing -> const ()
- Just (Just p) -> p }
- Relevant bindings include
- g :: r -> () (bound at T7748a.hs:13:16)
- f :: r -> () (bound at T7748a.hs:13:8)
- zd :: a (bound at T7748a.hs:12:6)
- test :: a -> r -> () (bound at T7748a.hs:12:1)
+ the type signature for:
+ test :: forall a r. a -> r -> ()
+ at T7748a.hs:11:9
+ • In the pattern: Just (Just p)
+ In a case alternative: Just (Just p) -> p
+ In the expression:
+ case zd of {
+ Nothing -> const ()
+ Just Nothing -> const ()
+ Just (Just p) -> p }
+ • Relevant bindings include
+ g :: r -> () (bound at T7748a.hs:13:16)
+ f :: r -> () (bound at T7748a.hs:13:8)
+ zd :: a (bound at T7748a.hs:12:6)
+ test :: a -> r -> () (bound at T7748a.hs:12:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7778.stderr b/testsuite/tests/typecheck/should_fail/T7778.stderr
index 136625af75..7538c15cce 100644
--- a/testsuite/tests/typecheck/should_fail/T7778.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7778.stderr
@@ -1,5 +1,5 @@
-
-T7778.hs:3:19:
- Expecting one more argument to ‘Num’
- Expected a type, but ‘Num’ has kind ‘* -> Constraint’
- In the type signature for ‘v’: 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/T7809.stderr b/testsuite/tests/typecheck/should_fail/T7809.stderr
index 153c4d1c1f..aa44b44676 100644
--- a/testsuite/tests/typecheck/should_fail/T7809.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7809.stderr
@@ -1,5 +1,5 @@
-
-T7809.hs:8:8: error:
- Illegal polymorphic or qualified type: PolyId
- GHC doesn't yet support impredicative polymorphism
- In the type signature for ‘foo’: foo :: F PolyId
+
+T7809.hs:8:8: error:
+ Illegal polymorphic or qualified type: PolyId
+ GHC doesn't yet support impredicative polymorphism
+ In the type signature: foo :: F PolyId
diff --git a/testsuite/tests/typecheck/should_fail/T7869.stderr b/testsuite/tests/typecheck/should_fail/T7869.stderr
index 74a483602d..6431c274e5 100644
--- a/testsuite/tests/typecheck/should_fail/T7869.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7869.stderr
@@ -26,3 +26,4 @@ T7869.hs:3:12:
In the expression: (\ x -> f x) :: [a] -> b
In an equation for ‘f’: f = (\ x -> f x) :: [a] -> b
Relevant bindings include f :: [a] -> b (bound at T7869.hs:3:1)
+
diff --git a/testsuite/tests/typecheck/should_fail/T8030.stderr b/testsuite/tests/typecheck/should_fail/T8030.stderr
index 24c9d59ff7..c6c05f8cf1 100644
--- a/testsuite/tests/typecheck/should_fail/T8030.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8030.stderr
@@ -3,8 +3,7 @@ T8030.hs:9:3: error:
• Couldn't match expected type ‘Pr a’ with actual type ‘Pr a0’
NB: ‘Pr’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
- • In the ambiguity check for the type signature for ‘op1’:
- op1 :: forall (k :: BOX) (a :: k). C a => Pr a
+ • 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
@@ -16,8 +15,7 @@ T8030.hs:10:3: error:
The type variable ‘a0’ is ambiguous
Expected type: Pr a -> Pr a -> Pr a
Actual type: Pr a0 -> Pr a0 -> Pr a0
- • In the ambiguity check for the type signature for ‘op2’:
- op2 :: forall (k :: BOX) (a :: k). C a => Pr a -> Pr a -> Pr a
+ • 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
diff --git a/testsuite/tests/typecheck/should_fail/T8034.stderr b/testsuite/tests/typecheck/should_fail/T8034.stderr
index cea9dbc18c..77a60294ce 100644
--- a/testsuite/tests/typecheck/should_fail/T8034.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8034.stderr
@@ -1,12 +1,11 @@
-
-T8034.hs:6:3: error:
- Couldn't match type ‘F a0’ with ‘F a’
- NB: ‘F’ is a type function, and may not be injective
- The type variable ‘a0’ is ambiguous
- Expected type: F a -> F a
- Actual type: F a0 -> F a0
- In the ambiguity check for the type signature for ‘foo’:
- foo :: forall a. C a => F a -> F a
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- When checking the class method: foo :: forall a. C a => F a -> F a
- In the class declaration for ‘C’
+
+T8034.hs:6:3: error:
+ Couldn't match type ‘F a0’ with ‘F a’
+ NB: ‘F’ is a type function, and may not be injective
+ The type variable ‘a0’ is ambiguous
+ Expected type: F a -> F a
+ Actual type: F a0 -> F a0
+ In the ambiguity check for ‘foo’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the class method: foo :: forall a. C a => F a -> F a
+ In the class declaration for ‘C’
diff --git a/testsuite/tests/typecheck/should_fail/T8142.stderr b/testsuite/tests/typecheck/should_fail/T8142.stderr
index 93b2bf4914..9ae86c5524 100644
--- a/testsuite/tests/typecheck/should_fail/T8142.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8142.stderr
@@ -5,9 +5,10 @@ T8142.hs:6:18: error:
The type variable ‘g0’ is ambiguous
Expected type: Nu ((,) t) -> Nu g
Actual type: Nu ((,) t0) -> Nu g0
- When checking that ‘h’ has the inferred type
+ In the ambiguity check for the inferred type for ‘h’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
h :: forall t (g :: * -> *). Nu ((,) t) -> Nu g
- Probable cause: the inferred type is ambiguous
In an equation for ‘tracer’:
tracer
= h
diff --git a/testsuite/tests/typecheck/should_fail/T8392a.stderr b/testsuite/tests/typecheck/should_fail/T8392a.stderr
index 290ae86a00..6795d9bd94 100644
--- a/testsuite/tests/typecheck/should_fail/T8392a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8392a.stderr
@@ -1,8 +1,8 @@
-T8392a.hs:6:8:
+T8392a.hs:6:8: error:
Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
- the type signature for: foo :: (Int ~ Bool) => a -> a
- In the ambiguity check for the type signature for ‘foo’:
- foo :: forall a. (Int ~ Bool) => a -> a
- In the type signature for ‘foo’: foo :: (Int ~ Bool) => a -> a
+ the type signature for:
+ foo :: (Int ~ Bool) => a -> a
+ In the ambiguity check for ‘foo’
+ In the type signature: foo :: (Int ~ Bool) => a -> a
diff --git a/testsuite/tests/typecheck/should_fail/T8450.stderr b/testsuite/tests/typecheck/should_fail/T8450.stderr
index 9cc70fa0df..5697e4db2b 100644
--- a/testsuite/tests/typecheck/should_fail/T8450.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8450.stderr
@@ -1,9 +1,11 @@
-T8450.hs:8:7:
- Couldn't match expected type ‘a’ with actual type ‘()’
+T8450.hs:8:7: error:
+ • Couldn't match expected type ‘a’ with actual type ‘()’
‘a’ is a rigid type variable bound by
- the type signature for: run :: a at T8450.hs:7:15
- In the expression: runEffect $ (undefined :: Either a ())
- In an equation for ‘run’:
- run = runEffect $ (undefined :: Either a ())
- Relevant bindings include run :: a (bound at T8450.hs:8:1)
+ the type signature for:
+ run :: forall a. a
+ at T8450.hs:7:15
+ • In the expression: runEffect $ (undefined :: Either a ())
+ In an equation for ‘run’:
+ run = runEffect $ (undefined :: Either a ())
+ • Relevant bindings include run :: a (bound at T8450.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T8603.stderr b/testsuite/tests/typecheck/should_fail/T8603.stderr
index 2aaf55b3ff..a3d17ceb56 100644
--- a/testsuite/tests/typecheck/should_fail/T8603.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8603.stderr
@@ -1,21 +1,30 @@
T8603.hs:13:10: error:
- No instance for (Applicative RV)
- arising from the superclasses of an instance declaration
- In the instance declaration for ‘Monad RV’
+ • No instance for (Applicative RV)
+ arising from the superclasses of an instance declaration
+ • In the instance declaration for ‘Monad RV’
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)
- The function ‘lift’ is applied to two arguments,
- but its type ‘([a0] -> StateT s RV t0)
- -> t1 ((->) [a0]) (StateT s RV t0)’
- has only one
- In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
- In the expression:
- do { prize <- lift uniform [1, 2, ....];
- return False }
+ • Couldn't match kind ‘* -> *’ with ‘*’
+ When matching types
+ t1 :: (* -> *) -> * -> *
+ (->) :: * -> * -> *
+ Expected type: [Integer] -> StateT s RV t0
+ Actual type: t1 ((->) [a0]) (StateT s RV t0)
+ • The function ‘lift’ is applied to two arguments,
+ but its type ‘([a0] -> StateT s RV t0)
+ -> t1 ((->) [a0]) (StateT s RV t0)’
+ has only one
+ In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
+ In the expression:
+ do { prize <- lift uniform [1, 2, ....];
+ return False }
+
+T8603.hs:29:22: error:
+ • Couldn't match type ‘RV a0’ with ‘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]
+ • Relevant bindings include
+ testRVState1 :: RVState s Bool (bound at T8603.hs:28:1)
diff --git a/testsuite/tests/typecheck/should_fail/T8806.stderr b/testsuite/tests/typecheck/should_fail/T8806.stderr
index ab88b7f2eb..0131dbd929 100644
--- a/testsuite/tests/typecheck/should_fail/T8806.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8806.stderr
@@ -1,8 +1,8 @@
-
-T8806.hs:5:6:
- Expected a constraint, but ‘Int’ has kind ‘*’
- In the type signature for ‘f’: f :: Int => Int
-
-T8806.hs:8:7:
- Illegal constraint: Int => Show a
- In the type signature for ‘g’: 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
diff --git a/testsuite/tests/typecheck/should_fail/T8883.stderr b/testsuite/tests/typecheck/should_fail/T8883.stderr
index 3f0a43033b..b18a97acb1 100644
--- a/testsuite/tests/typecheck/should_fail/T8883.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8883.stderr
@@ -2,7 +2,7 @@
T8883.hs:20:1: error:
Non type-variable argument in the constraint: Functor (PF a)
(Use FlexibleContexts to permit this)
- When checking that ‘fold’ has the inferred type
+ When checking the inferred type
fold :: forall b a.
(Functor (PF a), Regular a) =>
(PF a b -> b) -> a -> b
diff --git a/testsuite/tests/typecheck/should_fail/T9196.stderr b/testsuite/tests/typecheck/should_fail/T9196.stderr
index 6f5a204edd..fd10f24875 100644
--- a/testsuite/tests/typecheck/should_fail/T9196.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9196.stderr
@@ -1,8 +1,8 @@
-
-T9196.hs:4:7:
- Illegal constraint: forall a. Eq a
- In the type signature for ‘f’: f :: (forall a. Eq a) => a -> a
-
-T9196.hs:7:7:
- Illegal constraint: Eq a => Ord a
- In the type signature for ‘g’: 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 ‘Eq a => Ord a’ has kind ‘*’
+ 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 5f16dcaedd..2f1d0a2dae 100644
--- a/testsuite/tests/typecheck/should_fail/T9201.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9201.stderr
@@ -2,5 +2,5 @@
T9201.hs:6:17: error:
The first argument of ‘f’ should have kind ‘x1’,
but ‘a’ has kind ‘y1’
- In the type ‘d a (f a)’
+ In the type signature: ret :: d a (f a)
In the class declaration for ‘MonoidalCCC’
diff --git a/testsuite/tests/typecheck/should_fail/mc19.stderr b/testsuite/tests/typecheck/should_fail/mc19.stderr
index f8ca03f2f8..8cdd4f456b 100644
--- a/testsuite/tests/typecheck/should_fail/mc19.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc19.stderr
@@ -1,9 +1,11 @@
-
-mc19.hs:10:31:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context: [a] -> [a] at mc19.hs:10:10
- Expected type: [a] -> [a]
- Actual type: [a] -> [[a]]
- In the expression: inits
- In a stmt of a monad comprehension: then inits
+
+mc19.hs:10:31: error:
+ Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [a]
+ at mc19.hs:10:10
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ In the expression: inits
+ In a stmt of a monad comprehension: then inits
diff --git a/testsuite/tests/typecheck/should_fail/mc21.stderr b/testsuite/tests/typecheck/should_fail/mc21.stderr
index 950506543a..3017d2221c 100644
--- a/testsuite/tests/typecheck/should_fail/mc21.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc21.stderr
@@ -1,9 +1,11 @@
-
-mc21.hs:12:26:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context: [a] -> [[a]] at mc21.hs:11:9
- Expected type: [a] -> [[a]]
- Actual type: [[a]] -> [[a]]
- In the expression: take 5
- In a stmt of a monad comprehension: then group using take 5
+
+mc21.hs:12:26: error:
+ Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [[a]]
+ at mc21.hs:11:9
+ Expected type: [a] -> [[a]]
+ Actual type: [[a]] -> [[a]]
+ In the expression: take 5
+ In a stmt of a monad comprehension: then group using take 5
diff --git a/testsuite/tests/typecheck/should_fail/mc22.stderr b/testsuite/tests/typecheck/should_fail/mc22.stderr
index aab0c1bdc3..1c6dc386dd 100644
--- a/testsuite/tests/typecheck/should_fail/mc22.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc22.stderr
@@ -1,19 +1,22 @@
-mc22.hs:9:9:
+mc22.hs:9:9: error:
No instance for (Functor t) arising from a use of ‘fmap’
Possible fix:
add (Functor t) to the context of
- a type expected by the context: (a -> b) -> t a -> t b
+ a type expected by the context:
+ (a -> b) -> t a -> t b
or the inferred type of foo :: [t [Char]]
In the expression: fmap
In a stmt of a monad comprehension: then group using take 5
In the expression:
[x + 1 | x <- ["Hello", "World"], then group using take 5]
-mc22.hs:10:26:
+mc22.hs:10:26: error:
Couldn't match type ‘a’ with ‘t a’
- ‘a’ is a rigid type variable bound by
- a type expected by the context: [a] -> [t a] at mc22.hs:9:9
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [t a]
+ at mc22.hs:9:9
Expected type: [a] -> [t a]
Actual type: [t a] -> [t a]
In the expression: take 5
diff --git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index 90888af1b2..649acb0b07 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ -10,3 +10,4 @@ tcfail032.hs:14:8:
Relevant bindings include
x :: t (bound at tcfail032.hs:14:3)
f :: t -> a -> Int (bound at tcfail032.hs:14:1)
+
diff --git a/testsuite/tests/typecheck/should_fail/tcfail034.stderr b/testsuite/tests/typecheck/should_fail/tcfail034.stderr
index f984848ea7..1a8d6d7802 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail034.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail034.stderr
@@ -1,12 +1,14 @@
-
-tcfail034.hs:17:13:
- Could not deduce (Integral a) arising from a use of ‘mod’
- from the context: (Num a, Eq a)
- bound by the type signature for: test :: (Num a, Eq a) => a -> Bool
- at tcfail034.hs:16:7-32
- Possible fix:
- add (Integral a) to the context of
- the type signature for: test :: (Num a, Eq a) => a -> Bool
- In the first argument of ‘(==)’, namely ‘(x `mod` 3)’
- In the expression: (x `mod` 3) == 0
- In an equation for ‘test’: test x = (x `mod` 3) == 0
+
+tcfail034.hs:17:13: error:
+ Could not deduce (Integral a) arising from a use of ‘mod’
+ from the context: (Num a, Eq a)
+ bound by the type signature for:
+ test :: (Num a, Eq a) => a -> Bool
+ at tcfail034.hs:16:1-32
+ Possible fix:
+ add (Integral a) to the context of
+ the type signature for:
+ test :: (Num a, Eq a) => a -> Bool
+ In the first argument of ‘(==)’, namely ‘(x `mod` 3)’
+ In the expression: (x `mod` 3) == 0
+ In an equation for ‘test’: test x = (x `mod` 3) == 0
diff --git a/testsuite/tests/typecheck/should_fail/tcfail057.stderr b/testsuite/tests/typecheck/should_fail/tcfail057.stderr
index 9323ae7579..07a8116173 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail057.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail057.stderr
@@ -1,4 +1,5 @@
tcfail057.hs:5:7: error:
- Constraint ‘RealFrac a’ used as a type
- In the type signature for ‘f’: f :: (RealFrac a) -> a -> a
+ • Constraint ‘RealFrac a’ used as a type
+ • In the type signature:
+ f :: (RealFrac a) -> a -> a
diff --git a/testsuite/tests/typecheck/should_fail/tcfail058.stderr b/testsuite/tests/typecheck/should_fail/tcfail058.stderr
index 74db76afd8..6fcd4ea85d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail058.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail058.stderr
@@ -1,5 +1,5 @@
-
-tcfail058.hs:6:7:
- Expecting one more argument to ‘Array a’
- Expected a constraint, but ‘Array a’ has kind ‘* -> *’
- In the type signature for ‘f’: f :: (Array a) => a -> b
+
+tcfail058.hs:6:7: error:
+ Expecting one more argument to ‘Array a’
+ Expected a constraint, but ‘Array a’ has kind ‘* -> *’
+ In the type signature: f :: (Array a) => a -> b
diff --git a/testsuite/tests/typecheck/should_fail/tcfail063.stderr b/testsuite/tests/typecheck/should_fail/tcfail063.stderr
index 45bdaa36e2..d4185fe5aa 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail063.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail063.stderr
@@ -1,5 +1,5 @@
-
-tcfail063.hs:6:9:
- Expecting one more argument to ‘Num’
- Expected a constraint, but ‘Num’ has kind ‘* -> Constraint’
- In the type signature for ‘moby’: moby :: Num => Int -> a -> Int
+
+tcfail063.hs:6:9: error:
+ Expecting one more argument to ‘Num’
+ Expected a constraint, but ‘Num’ has kind ‘* -> Constraint’
+ In the type signature: moby :: Num => Int -> a -> Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail065.stderr b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
index ddb40dd491..65befaf29e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail065.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
@@ -1,13 +1,14 @@
-
-tcfail065.hs:29:20:
- Couldn't match expected type ‘x’ with actual type ‘x1’
- ‘x1’ is a rigid type variable bound by
- the type signature for: setX :: x1 -> X x -> X x
- at tcfail065.hs:29:3
- ‘x’ is a rigid type variable bound by
- the instance declaration at tcfail065.hs:28:10
- In the first argument of ‘X’, namely ‘x’
- In the expression: X x
- Relevant bindings include
- x :: x1 (bound at tcfail065.hs:29:8)
- setX :: x1 -> X x -> X x (bound at tcfail065.hs:29:3)
+
+tcfail065.hs:29:20: error:
+ • Couldn't match expected type ‘x’ with actual type ‘x1’
+ ‘x1’ is a rigid type variable bound by
+ the type signature for:
+ setX :: forall x1. x1 -> X x -> X x
+ at tcfail065.hs:29:3
+ ‘x’ is a rigid type variable bound by
+ the instance declaration at tcfail065.hs:28:10
+ • In the first argument of ‘X’, namely ‘x’
+ In the expression: X x
+ • Relevant bindings include
+ x :: x1 (bound at tcfail065.hs:29:8)
+ setX :: x1 -> X x -> X x (bound at tcfail065.hs:29:3)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail067.stderr b/testsuite/tests/typecheck/should_fail/tcfail067.stderr
index e539ea881f..0095d757d5 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail067.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail067.stderr
@@ -1,76 +1,79 @@
-
-tcfail067.hs:1:14: Warning:
- -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
-
-tcfail067.hs:12:16:
- No instance for (Ord a) arising from a use of ‘SubRange’
- Possible fix:
- add (Ord a) to the context of
- the type signature for: subRangeValue :: SubRange a -> a
- In the pattern: SubRange (lower, upper) value
- In an equation for ‘subRangeValue’:
- subRangeValue (SubRange (lower, upper) value) = value
-
-tcfail067.hs:15:11:
- No instance for (Ord a) arising from a use of ‘SubRange’
- Possible fix:
- add (Ord a) to the context of
- the type signature for: subRange :: SubRange a -> (a, a)
- In the pattern: SubRange r value
- In an equation for ‘subRange’: subRange (SubRange r value) = r
-
-tcfail067.hs:46:12:
- Could not deduce (Ord a) arising from a use of ‘SubRange’
- from the context: Show a
- bound by the type signature for:
- showRange :: Show a => SubRange a -> String
- at tcfail067.hs:45:14-43
- Possible fix:
- add (Ord a) to the context of
- the type signature for: showRange :: Show a => SubRange a -> String
- In the pattern: SubRange (lower, upper) value
- In an equation for ‘showRange’:
- showRange (SubRange (lower, upper) value)
- = show value ++ " :" ++ show lower ++ ".." ++ show upper
-
-tcfail067.hs:61:12:
- Could not deduce (Ord a) arising from a use of ‘numSubRangeNegate’
- from the context: Num a
- bound by the instance declaration at tcfail067.hs:60:10-34
- Possible fix:
- add (Ord a) to the context of the instance declaration
- In the expression: numSubRangeNegate
- In an equation for ‘negate’: negate = numSubRangeNegate
- In the instance declaration for ‘Num (SubRange a)’
-
-tcfail067.hs:65:19:
- Could not deduce (Ord a) arising from a use of ‘SubRange’
- from the context: Num a
- bound by the instance declaration at tcfail067.hs:60:10-34
- Possible fix:
- add (Ord a) to the context of the instance declaration
- In the expression:
- SubRange (fromInteger a, fromInteger a) (fromInteger a)
- In an equation for ‘fromInteger’:
- fromInteger a
- = SubRange (fromInteger a, fromInteger a) (fromInteger a)
- In the instance declaration for ‘Num (SubRange a)’
-
-tcfail067.hs:74:5:
- Could not deduce (Ord a) arising from a use of ‘SubRange’
- from the context: Num a
- bound by the type signature for:
- numSubRangeBinOp :: Num a =>
- (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
- at tcfail067.hs:(71,21)-(72,58)
- Possible fix:
- add (Ord a) to the context of
- the type signature for:
- numSubRangeBinOp :: Num a =>
- (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
- In the expression: SubRange (result, result) result
- In an equation for ‘numSubRangeBinOp’:
- numSubRangeBinOp op a b
- = SubRange (result, result) result
- where
- result = (subRangeValue a) `op` (subRangeValue b)
+
+tcfail067.hs:1:14: warning:
+ -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail067.hs:12:16: error:
+ No instance for (Ord a) arising from a use of ‘SubRange’
+ Possible fix:
+ add (Ord a) to the context of
+ the type signature for:
+ subRangeValue :: SubRange a -> a
+ In the pattern: SubRange (lower, upper) value
+ In an equation for ‘subRangeValue’:
+ subRangeValue (SubRange (lower, upper) value) = value
+
+tcfail067.hs:15:11: error:
+ No instance for (Ord a) arising from a use of ‘SubRange’
+ Possible fix:
+ add (Ord a) to the context of
+ the type signature for:
+ subRange :: SubRange a -> (a, a)
+ In the pattern: SubRange r value
+ In an equation for ‘subRange’: subRange (SubRange r value) = r
+
+tcfail067.hs:46:12: error:
+ Could not deduce (Ord a) arising from a use of ‘SubRange’
+ from the context: Show a
+ bound by the type signature for:
+ showRange :: Show a => SubRange a -> String
+ at tcfail067.hs:45:1-43
+ Possible fix:
+ add (Ord a) to the context of
+ the type signature for:
+ showRange :: Show a => SubRange a -> String
+ In the pattern: SubRange (lower, upper) value
+ In an equation for ‘showRange’:
+ showRange (SubRange (lower, upper) value)
+ = show value ++ " :" ++ show lower ++ ".." ++ show upper
+
+tcfail067.hs:61:12: error:
+ Could not deduce (Ord a) arising from a use of ‘numSubRangeNegate’
+ from the context: Num a
+ bound by the instance declaration at tcfail067.hs:60:10-34
+ Possible fix:
+ add (Ord a) to the context of the instance declaration
+ In the expression: numSubRangeNegate
+ In an equation for ‘negate’: negate = numSubRangeNegate
+ In the instance declaration for ‘Num (SubRange a)’
+
+tcfail067.hs:65:19: error:
+ Could not deduce (Ord a) arising from a use of ‘SubRange’
+ from the context: Num a
+ bound by the instance declaration at tcfail067.hs:60:10-34
+ Possible fix:
+ add (Ord a) to the context of the instance declaration
+ In the expression:
+ SubRange (fromInteger a, fromInteger a) (fromInteger a)
+ In an equation for ‘fromInteger’:
+ fromInteger a
+ = SubRange (fromInteger a, fromInteger a) (fromInteger a)
+ In the instance declaration for ‘Num (SubRange a)’
+
+tcfail067.hs:74:5: error:
+ Could not deduce (Ord a) arising from a use of ‘SubRange’
+ from the context: Num a
+ bound by the type signature for:
+ numSubRangeBinOp :: Num a =>
+ (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
+ at tcfail067.hs:(71,1)-(72,58)
+ Possible fix:
+ add (Ord a) to the context of
+ the type signature for:
+ numSubRangeBinOp :: Num a =>
+ (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
+ In the expression: SubRange (result, result) result
+ In an equation for ‘numSubRangeBinOp’:
+ numSubRangeBinOp op a b
+ = SubRange (result, result) result
+ where
+ result = (subRangeValue a) `op` (subRangeValue b)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail068.stderr b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
index 330b1dceb0..f80a2cf1bb 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail068.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
@@ -1,70 +1,78 @@
-tcfail068.hs:14:9:
- Couldn't match type ‘s1’ with ‘s’
+tcfail068.hs:14:9: error:
+ • Couldn't match type ‘s1’ with ‘s’
‘s1’ is a rigid type variable bound by
- a type expected by the context: ST s1 (IndTree s a)
- at tcfail068.hs:13:9
+ a type expected by the context:
+ forall s1. ST s1 (IndTree s a)
+ at tcfail068.hs:13:9
‘s’ is a rigid type variable bound by
- the type signature for:
- itgen :: Constructed a => (Int, Int) -> a -> IndTree s a
- at tcfail068.hs:11:10
- Expected type: ST s1 (IndTree s a)
- Actual type: ST s1 (STArray s1 (Int, Int) a)
- In the first argument of ‘runST’, namely
- ‘(newSTArray ((1, 1), n) x)’
- In the expression: runST (newSTArray ((1, 1), n) x)
- Relevant bindings include
- itgen :: (Int, Int) -> a -> IndTree s a
- (bound at tcfail068.hs:12:1)
+ the type signature for:
+ itgen :: forall a s.
+ Constructed a =>
+ (Int, Int) -> a -> IndTree s a
+ at tcfail068.hs:11:10
+ Expected type: ST s1 (IndTree s a)
+ Actual type: ST s1 (STArray s1 (Int, Int) a)
+ • In the first argument of ‘runST’, namely
+ ‘(newSTArray ((1, 1), n) x)’
+ In the expression: runST (newSTArray ((1, 1), n) x)
+ • Relevant bindings include
+ itgen :: (Int, Int) -> a -> IndTree s a
+ (bound at tcfail068.hs:12:1)
-tcfail068.hs:19:21:
- Couldn't match type ‘s’ with ‘s1’
+tcfail068.hs:19:21: error:
+ • Couldn't match type ‘s’ with ‘s1’
‘s’ is a rigid type variable bound by
- the type signature for:
- itiap :: Constructed a =>
+ the type signature for:
+ itiap :: forall a s.
+ Constructed a =>
(Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:16:10
+ at tcfail068.hs:16:10
‘s1’ is a rigid type variable bound by
- a type expected by the context: ST s1 (IndTree s a)
- at tcfail068.hs:18:9
- Expected type: STArray s1 (Int, Int) a
- Actual type: IndTree s a
- In the first argument of ‘readSTArray’, namely ‘arr’
- In the first argument of ‘(>>=)’, namely ‘readSTArray arr i’
- Relevant bindings include
- arr :: IndTree s a (bound at tcfail068.hs:17:11)
- itiap :: (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
- (bound at tcfail068.hs:17:1)
+ a type expected by the context:
+ forall s1. ST s1 (IndTree s a)
+ at tcfail068.hs:18:9
+ Expected type: STArray s1 (Int, Int) a
+ Actual type: IndTree s a
+ • In the first argument of ‘readSTArray’, namely ‘arr’
+ In the first argument of ‘(>>=)’, namely ‘readSTArray arr i’
+ • Relevant bindings include
+ arr :: IndTree s a (bound at tcfail068.hs:17:11)
+ itiap :: (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+ (bound at tcfail068.hs:17:1)
-tcfail068.hs:24:36:
- Couldn't match type ‘s’ with ‘s1’
+tcfail068.hs:24:36: error:
+ • Couldn't match type ‘s’ with ‘s1’
‘s’ is a rigid type variable bound by
- the type signature for:
- itrap :: Constructed a =>
+ the type signature for:
+ itrap :: forall a s.
+ Constructed a =>
((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:23:10
+ at tcfail068.hs:23:10
‘s1’ is a rigid type variable bound by
- a type expected by the context: ST s1 (IndTree s a)
- at tcfail068.hs:24:29
- Expected type: ST s1 (IndTree s a)
- Actual type: ST s (IndTree s a)
- In the first argument of ‘runST’, namely ‘(itrap' i k)’
- In the expression: runST (itrap' i k)
- Relevant bindings include
- itrap' :: Int -> Int -> ST s (IndTree s a)
- (bound at tcfail068.hs:26:9)
- itrapsnd :: Int -> Int -> ST s (IndTree s a)
- (bound at tcfail068.hs:29:9)
- arr :: IndTree s a (bound at tcfail068.hs:24:23)
- itrap :: ((Int, Int), (Int, Int))
- -> (a -> a) -> IndTree s a -> IndTree s a
- (bound at tcfail068.hs:24:1)
+ a type expected by the context:
+ forall s1. ST s1 (IndTree s a)
+ at tcfail068.hs:24:29
+ Expected type: ST s1 (IndTree s a)
+ Actual type: ST s (IndTree s a)
+ • In the first argument of ‘runST’, namely ‘(itrap' i k)’
+ In the expression: runST (itrap' i k)
+ • Relevant bindings include
+ itrap' :: Int -> Int -> ST s (IndTree s a)
+ (bound at tcfail068.hs:26:9)
+ itrapsnd :: Int -> Int -> ST s (IndTree s a)
+ (bound at tcfail068.hs:29:9)
+ arr :: IndTree s a (bound at tcfail068.hs:24:23)
+ itrap :: ((Int, Int), (Int, Int))
+ -> (a -> a) -> IndTree s a -> IndTree s a
+ (bound at tcfail068.hs:24:1)
-tcfail068.hs:36:46:
- Couldn't match type ‘s’ with ‘s1’
+tcfail068.hs:36:46: error:
+ • Couldn't match type ‘s’ with ‘s1’
‘s’ is a rigid type variable bound by
- the type signature for:
- itrapstate :: Constructed b =>
+ the type signature for:
+ itrapstate :: forall b a c s.
+ Constructed b =>
((Int, Int), (Int, Int))
-> (a -> b -> (a, b))
-> ((Int, Int) -> c -> a)
@@ -72,25 +80,26 @@ tcfail068.hs:36:46:
-> c
-> IndTree s b
-> (c, IndTree s b)
- at tcfail068.hs:34:15
+ at tcfail068.hs:34:15
‘s1’ is a rigid type variable bound by
- a type expected by the context: ST s1 (c, IndTree s b)
- at tcfail068.hs:36:40
- Expected type: ST s1 (c, IndTree s b)
- Actual type: ST s (c, IndTree s b)
- In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
- In the expression: runST (itrapstate' i k s)
- Relevant bindings include
- itrapstate' :: Int -> Int -> c -> ST s (c, IndTree s b)
- (bound at tcfail068.hs:38:9)
- itrapstatesnd :: Int -> Int -> c -> ST s (c, IndTree s b)
- (bound at tcfail068.hs:41:9)
- arr :: IndTree s b (bound at tcfail068.hs:36:34)
- itrapstate :: ((Int, Int), (Int, Int))
- -> (a -> b -> (a, b))
- -> ((Int, Int) -> c -> a)
- -> (a -> c)
- -> c
- -> IndTree s b
- -> (c, IndTree s b)
- (bound at tcfail068.hs:36:1)
+ a type expected by the context:
+ forall s1. ST s1 (c, IndTree s b)
+ at tcfail068.hs:36:40
+ Expected type: ST s1 (c, IndTree s b)
+ Actual type: ST s (c, IndTree s b)
+ • In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
+ In the expression: runST (itrapstate' i k s)
+ • Relevant bindings include
+ itrapstate' :: Int -> Int -> c -> ST s (c, IndTree s b)
+ (bound at tcfail068.hs:38:9)
+ itrapstatesnd :: Int -> Int -> c -> ST s (c, IndTree s b)
+ (bound at tcfail068.hs:41:9)
+ arr :: IndTree s b (bound at tcfail068.hs:36:34)
+ itrapstate :: ((Int, Int), (Int, Int))
+ -> (a -> b -> (a, b))
+ -> ((Int, Int) -> c -> a)
+ -> (a -> c)
+ -> c
+ -> IndTree s b
+ -> (c, IndTree s b)
+ (bound at tcfail068.hs:36:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail072.stderr b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
index 68d7283244..fa6752b37b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail072.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
@@ -4,7 +4,7 @@ tcfail072.hs:23:13: error:
from the context: (Ord p, Ord q)
bound by the type signature for:
g :: (Ord p, Ord q) => AB p q -> Bool
- at tcfail072.hs:22:6-38
+ at tcfail072.hs:22:1-38
The type variable ‘p0’ is ambiguous
These potential instances exist:
instance Ord Ordering -- Defined in ‘GHC.Classes’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail076.stderr b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
index 869b9472f3..8283ef0458 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail076.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
@@ -1,16 +1,18 @@
-tcfail076.hs:18:82:
- Couldn't match type ‘res’ with ‘res1’
+tcfail076.hs:18:82: error:
+ • Couldn't match type ‘res’ with ‘res1’
‘res’ is a rigid type variable bound by
- a type expected by the context: (a -> m res) -> m res
- at tcfail076.hs:18:28
+ a type expected by the context:
+ forall res. (a -> m res) -> m res
+ at tcfail076.hs:18:28
‘res1’ is a rigid type variable bound by
- a type expected by the context: (b -> m res1) -> m res1
- at tcfail076.hs:18:64
- Expected type: m res1
- Actual type: m res
- In the expression: cont a
- In the first argument of ‘KContT’, namely ‘(\ cont' -> cont a)’
- Relevant bindings include
- cont' :: b -> m res1 (bound at tcfail076.hs:18:73)
- cont :: a -> m res (bound at tcfail076.hs:18:37)
+ a type expected by the context:
+ forall res1. (b -> m res1) -> m res1
+ at tcfail076.hs:18:64
+ Expected type: m res1
+ Actual type: m res
+ • In the expression: cont a
+ In the first argument of ‘KContT’, namely ‘(\ cont' -> cont a)’
+ • Relevant bindings include
+ cont' :: b -> m res1 (bound at tcfail076.hs:18:73)
+ cont :: a -> m res (bound at tcfail076.hs:18:37)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail078.stderr b/testsuite/tests/typecheck/should_fail/tcfail078.stderr
index 9266b951f1..8a7837df00 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail078.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail078.stderr
@@ -1,4 +1,4 @@
-
-tcfail078.hs:5:6:
- ‘Integer’ is applied to too many type arguments
- In the type signature for ‘f’: f :: Integer i => i
+
+tcfail078.hs:5:6: error:
+ ‘Integer’ is applied to too many type arguments
+ In the type signature: f :: Integer i => i
diff --git a/testsuite/tests/typecheck/should_fail/tcfail080.stderr b/testsuite/tests/typecheck/should_fail/tcfail080.stderr
index 3b8d8e9eb9..21ca3aa8a6 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail080.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail080.stderr
@@ -1,10 +1,12 @@
-
-tcfail080.hs:27:1:
- Could not deduce (Collection c0 a)
- from the context: Collection c a
- bound by the inferred type for ‘q’: Collection c a => a -> Bool
- at tcfail080.hs:27:1-27
- The type variable ‘c0’ is ambiguous
- When checking that ‘q’ has the inferred type
- q :: forall (c :: * -> *) a. Collection c a => a -> Bool
- Probable cause: the inferred type is ambiguous
+
+tcfail080.hs:27:1: error:
+ Could not deduce (Collection c0 a)
+ from the context: Collection c a
+ bound by the inferred type for ‘q’:
+ Collection c a => a -> Bool
+ at tcfail080.hs:27:1-27
+ The type variable ‘c0’ is ambiguous
+ In the ambiguity check for the inferred type for ‘q’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
+ q :: forall (c :: * -> *) a. Collection c a => a -> Bool
diff --git a/testsuite/tests/typecheck/should_fail/tcfail097.stderr b/testsuite/tests/typecheck/should_fail/tcfail097.stderr
index e4a611774d..9fbd7c4d87 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail097.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail097.stderr
@@ -1,11 +1,11 @@
-
-tcfail097.hs:5:6:
- Could not deduce (Eq a0)
- from the context: Eq a
- bound by the type signature for: f :: Eq a => Int -> Int
- at tcfail097.hs:5:6-23
- The type variable ‘a0’ is ambiguous
- In the ambiguity check for the type signature for ‘f’:
- f :: forall a. Eq a => Int -> Int
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘f’: f :: Eq a => Int -> Int
+
+tcfail097.hs:5:6: error:
+ Could not deduce (Eq a0)
+ from the context: Eq a
+ bound by the type signature for:
+ f :: Eq a => Int -> Int
+ at tcfail097.hs:5:6-23
+ The type variable ‘a0’ is ambiguous
+ In the ambiguity check for ‘f’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature: f :: Eq a => Int -> Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail098.stderr b/testsuite/tests/typecheck/should_fail/tcfail098.stderr
index 1d95319566..0b2baf0f51 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail098.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail098.stderr
@@ -1,11 +1,10 @@
-
-tcfail098.hs:12:10:
- Could not deduce (Bar a0)
- from the context: Bar a
- bound by an instance declaration: Bar a => Bar Bool
- at tcfail098.hs:12:10-26
- The type variable ‘a0’ is ambiguous
- In the ambiguity check for an instance declaration:
- forall a. Bar a => Bar Bool
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the instance declaration for ‘Bar Bool’
+
+tcfail098.hs:12:10: error:
+ Could not deduce (Bar a0)
+ from the context: Bar a
+ bound by an instance declaration: Bar a => Bar Bool
+ at tcfail098.hs:12:10-26
+ The type variable ‘a0’ is ambiguous
+ In the ambiguity check for an instance declaration
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the instance declaration for ‘Bar Bool’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail101.stderr b/testsuite/tests/typecheck/should_fail/tcfail101.stderr
index b88b77475e..7c10f4aebe 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail101.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail101.stderr
@@ -1,4 +1,4 @@
tcfail101.hs:9:6: error:
The type synonym ‘A’ should have 1 argument, but has been given none
- In the type signature for ‘f’: f :: T A
+ In the type signature: f :: T A
diff --git a/testsuite/tests/typecheck/should_fail/tcfail102.stderr b/testsuite/tests/typecheck/should_fail/tcfail102.stderr
index 6bd3750138..1f034ed39d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail102.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail102.stderr
@@ -1,13 +1,13 @@
-
-tcfail102.hs:1:14: Warning:
- -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
-
-tcfail102.hs:9:15:
- Could not deduce (Integral (Ratio a)) arising from a use of ‘p’
- from the context: Integral a
- bound by the type signature for:
- f :: Integral a => P (Ratio a) -> P (Ratio a)
- at tcfail102.hs:8:6-45
- In the ‘p’ field of a record
- In the expression: x {p = p x}
- In an equation for ‘f’: f x = x {p = p x}
+
+tcfail102.hs:1:14: warning:
+ -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail102.hs:9:15: error:
+ Could not deduce (Integral (Ratio a)) arising from a use of ‘p’
+ from the context: Integral a
+ bound by the type signature for:
+ f :: Integral a => P (Ratio a) -> P (Ratio a)
+ at tcfail102.hs:8:1-45
+ In the ‘p’ field of a record
+ In the expression: x {p = p x}
+ In an equation for ‘f’: f x = x {p = p x}
diff --git a/testsuite/tests/typecheck/should_fail/tcfail103.stderr b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
index 17a434f0ae..627ef1158c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail103.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
@@ -1,10 +1,14 @@
-tcfail103.hs:15:23:
+tcfail103.hs:15:23: error:
Couldn't match type ‘t’ with ‘s’
- ‘t’ is a rigid type variable bound by
- the type signature for: f :: ST t Int at tcfail103.hs:10:5
- ‘s’ is a rigid type variable bound by
- the type signature for: g :: ST s Int at tcfail103.hs:13:14
+ ‘t’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall t. ST t Int
+ at tcfail103.hs:10:5
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ g :: forall s. ST s Int
+ at tcfail103.hs:13:14
Expected type: STRef s Int
Actual type: STRef t Int
In the first argument of ‘readSTRef’, namely ‘v’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail107.stderr b/testsuite/tests/typecheck/should_fail/tcfail107.stderr
index 85f9a2de07..68b82627b8 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail107.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail107.stderr
@@ -1,5 +1,5 @@
tcfail107.hs:13:9: error:
The type synonym ‘Const’ should have 2 arguments, but has been given 1
- In the type signature for ‘test’:
+ In the type signature:
test :: Thing (Const Int) -> Thing (Const Int)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail110.stderr b/testsuite/tests/typecheck/should_fail/tcfail110.stderr
index cb60a79d93..a9b070e46d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail110.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail110.stderr
@@ -1,6 +1,5 @@
-
-tcfail110.hs:8:30:
- Expecting one more argument to ‘Foo a’
- Expected a type, but ‘Foo a’ has kind ‘* -> *’
- In the type signature for ‘bar’:
- bar :: String -> (forall a. Foo a) -> IO ()
+
+tcfail110.hs:8:30: error:
+ Expecting one more argument to ‘Foo a’
+ Expected a type, but ‘Foo a’ has kind ‘* -> *’
+ In the type signature: bar :: String -> (forall a. Foo a) -> IO ()
diff --git a/testsuite/tests/typecheck/should_fail/tcfail113.stderr b/testsuite/tests/typecheck/should_fail/tcfail113.stderr
index 8584008cd3..06837f6f73 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail113.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail113.stderr
@@ -1,14 +1,14 @@
-
-tcfail113.hs:12:7:
- Expecting one more argument to ‘Maybe’
- Expected kind ‘*’, but ‘Maybe’ has kind ‘* -> *’
- In the type signature for ‘f’: f :: [Maybe]
-
-tcfail113.hs:15:8:
- The first argument of ‘T’ should have kind ‘* -> *’,
- but ‘Int’ has kind ‘*’
- In the type signature for ‘g’: g :: T Int
-
-tcfail113.hs:18:6:
- ‘Int’ is applied to too many type arguments
- In the type signature for ‘h’: h :: Int Int
+
+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
diff --git a/testsuite/tests/typecheck/should_fail/tcfail116.stderr b/testsuite/tests/typecheck/should_fail/tcfail116.stderr
index abefc61eb8..723e6dba9a 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail116.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail116.stderr
@@ -1,12 +1,12 @@
-tcfail116.hs:6:5:
+tcfail116.hs:6:5: error:
Could not deduce (Foo a0)
from the context: Foo a
- bound by the type signature for: bug :: Foo a => ()
+ bound by the type signature for:
+ bug :: Foo a => ()
at tcfail116.hs:6:5-13
The type variable ‘a0’ is ambiguous
- In the ambiguity check for the type signature for ‘bug’:
- bug :: forall a. Foo a => ()
+ In the ambiguity check for ‘bug’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the class method: bug :: forall a. Foo a => ()
In the class declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail127.stderr b/testsuite/tests/typecheck/should_fail/tcfail127.stderr
index 32af3d8382..feda55fc82 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail127.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail127.stderr
@@ -1,5 +1,5 @@
-
-tcfail127.hs:3:8: error:
- Illegal polymorphic or qualified type: Num a => a -> a
- GHC doesn't yet support impredicative polymorphism
- In the type signature for ‘foo’: foo :: IO (Num a => a -> a)
+
+tcfail127.hs:3:8: error:
+ Illegal polymorphic or qualified type: Num a => a -> a
+ GHC doesn't yet support impredicative polymorphism
+ In the type signature: foo :: IO (Num a => a -> a)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail131.stderr b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
index 3a209ab5e0..03bdc72eff 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail131.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
@@ -1,10 +1,12 @@
-
-tcfail131.hs:7:9:
- Couldn't match expected type ‘b’ with actual type ‘Integer’
- ‘b’ is a rigid type variable bound by
- the type signature for: g :: Num b => b -> b at tcfail131.hs:6:8
- In the expression: f x x
- In an equation for ‘g’: g x = f x x
- Relevant bindings include
- x :: b (bound at tcfail131.hs:7:5)
- g :: b -> b (bound at tcfail131.hs:7:3)
+
+tcfail131.hs:7:9: error:
+ • Couldn't match expected type ‘b’ with actual type ‘Integer’
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ g :: forall b. Num b => b -> b
+ at tcfail131.hs:6:8
+ • In the expression: f x x
+ In an equation for ‘g’: g x = f x x
+ • Relevant bindings include
+ x :: b (bound at tcfail131.hs:7:5)
+ g :: b -> b (bound at tcfail131.hs:7:3)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail134.stderr b/testsuite/tests/typecheck/should_fail/tcfail134.stderr
index b73d2f38a9..4ade82b8e6 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail134.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail134.stderr
@@ -1,6 +1,6 @@
-
-tcfail134.hs:5:33:
- Expecting one more argument to ‘XML’
- Expected a type, but ‘XML’ has kind ‘* -> Constraint’
- In the type ‘a -> XML’
- In the class declaration for ‘XML’
+
+tcfail134.hs:5:33: error:
+ Expecting one more argument to ‘XML’
+ Expected a type, but ‘XML’ has kind ‘* -> Constraint’
+ In the type signature: toXML :: a -> XML
+ In the class declaration for ‘XML’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail135.stderr b/testsuite/tests/typecheck/should_fail/tcfail135.stderr
index 251284365c..bf953347d3 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail135.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail135.stderr
@@ -1,6 +1,6 @@
-
-tcfail135.hs:6:23:
- Expecting one more argument to ‘f’
- Expected a type, but ‘f’ has kind ‘k0 -> *’
- In the type ‘f a -> f’
- In the class declaration for ‘Foo’
+
+tcfail135.hs:6:23: error:
+ Expecting one more argument to ‘f’
+ Expected a type, but ‘f’ has kind ‘k0 -> *’
+ In the type signature: baa :: f a -> f
+ In the class declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail142.stderr b/testsuite/tests/typecheck/should_fail/tcfail142.stderr
index c6553c1de6..1c854acc35 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail142.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail142.stderr
@@ -1,11 +1,12 @@
-
-tcfail142.hs:18:8:
- Could not deduce (Bar a0 r)
- from the context: Bar a r
- bound by the type signature for: bar :: Bar a r => r -> ()
- at tcfail142.hs:18:8-25
- The type variable ‘a0’ is ambiguous
- In the ambiguity check for the type signature for ‘bar’:
- bar :: forall r a. Bar a r => r -> ()
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature for ‘bar’: bar :: Bar a r => r -> ()
+
+tcfail142.hs:18:8: error:
+ Could not deduce (Bar a0 r)
+ from the context: Bar a r
+ bound by the type signature for:
+ bar :: Bar a r => r -> ()
+ at tcfail142.hs:18:8-25
+ The type variable ‘a0’ is ambiguous
+ In the ambiguity check for ‘bar’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ In the type signature:
+ bar :: Bar a r => r -> ()
diff --git a/testsuite/tests/typecheck/should_fail/tcfail153.stderr b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
index ec46f782ad..8034a804fc 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail153.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
@@ -1,8 +1,10 @@
-tcfail153.hs:6:7:
+tcfail153.hs:6:7: error:
Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for: f :: a -> [a] at tcfail153.hs:5:6
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. a -> [a]
+ at tcfail153.hs:5:6
Expected type: [a]
Actual type: [Bool]
In the expression: g x
diff --git a/testsuite/tests/typecheck/should_fail/tcfail158.stderr b/testsuite/tests/typecheck/should_fail/tcfail158.stderr
index e359c8bdb2..4110f87366 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail158.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail158.stderr
@@ -1,5 +1,5 @@
-
-tcfail158.hs:14:19:
- Expecting one more argument to ‘Val v’
- Expected a type, but ‘Val v’ has kind ‘* -> *’
- In the type signature for ‘bar’: bar :: forall v. Val v
+
+tcfail158.hs:14:19: error:
+ Expecting one more argument to ‘Val v’
+ Expected a type, but ‘Val v’ has kind ‘* -> *’
+ In the type signature: bar :: forall v. Val v
diff --git a/testsuite/tests/typecheck/should_fail/tcfail160.stderr b/testsuite/tests/typecheck/should_fail/tcfail160.stderr
index 7a740403d8..7e17d5c476 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail160.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail160.stderr
@@ -1,5 +1,5 @@
-
-tcfail160.hs:7:8:
- The first argument of ‘T’ should have kind ‘* -> *’,
- but ‘Int’ has kind ‘*’
- In the type signature for ‘g’: g :: T Int
+
+tcfail160.hs:7:8: error:
+ The first argument of ‘T’ should have kind ‘* -> *’,
+ but ‘Int’ has kind ‘*’
+ 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 90e1c2ec5e..afe989206f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail161.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail161.stderr
@@ -1,5 +1,5 @@
-
-tcfail161.hs:5:7:
- Expecting one more argument to ‘Maybe’
- Expected kind ‘*’, but ‘Maybe’ has kind ‘* -> *’
- In the type signature for ‘f’: f :: [Maybe]
+
+tcfail161.hs:5:7: error:
+ Expecting one more argument to ‘Maybe’
+ Expected kind ‘*’, but ‘Maybe’ has kind ‘* -> *’
+ In the type signature: f :: [Maybe]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.stderr b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
index 77bc7416b5..fec5748461 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
@@ -1,11 +1,11 @@
-tcfail174.hs:9:10:
+tcfail174.hs:9:10: error:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a0 -> a0’
In the first argument of ‘Base’, namely ‘id’
In the expression: Base id
-tcfail174.hs:13:14:
+tcfail174.hs:13:14: error:
Couldn't match type ‘a’ with ‘a1’
because type variable ‘a1’ would escape its scope
This (rigid, skolem) type variable is bound by
@@ -18,12 +18,15 @@ tcfail174.hs:13:14:
Relevant bindings include
h1 :: Capture a (bound at tcfail174.hs:13:1)
-tcfail174.hs:16:14:
+tcfail174.hs:16:14: error:
Couldn't match type ‘a’ with ‘b’
- ‘a’ is a rigid type variable bound by
- the type forall a1. a1 -> a1 at tcfail174.hs:1:1
- ‘b’ is a rigid type variable bound by
- the type signature for: h2 :: Capture b at tcfail174.hs:15:7
+ ‘a’ is a rigid type variable bound by
+ the type forall a1. a1 -> a1
+ at tcfail174.hs:1:1
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ h2 :: forall b. Capture b
+ at tcfail174.hs:15:7
Expected type: Capture (forall x. x -> b)
Actual type: Capture (forall a. a -> a)
In the first argument of ‘Capture’, namely ‘g’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail175.stderr b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
index 50a2424fcc..82da98bc0c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail175.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
@@ -1,10 +1,12 @@
-
-tcfail175.hs:11:1:
- Couldn't match expected type ‘String -> String -> String’
- with actual type ‘a’
- ‘a’ is a rigid type variable bound by
- the type signature for: evalRHS :: Int -> a at tcfail175.hs:10:12
- The equation(s) for ‘evalRHS’ have three arguments,
- but its type ‘Int -> a’ has only one
- Relevant bindings include
- evalRHS :: Int -> a (bound at tcfail175.hs:11:1)
+
+tcfail175.hs:11:1: error:
+ • Couldn't match expected type ‘String -> String -> String’
+ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ evalRHS :: forall a. Int -> a
+ at tcfail175.hs:10:12
+ • The equation(s) for ‘evalRHS’ have three arguments,
+ but its type ‘Int -> a’ has only one
+ • Relevant bindings include
+ evalRHS :: Int -> a (bound at tcfail175.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail179.stderr b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
index 14d2eae435..a50e75e6be 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail179.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
@@ -1,17 +1,19 @@
-
-tcfail179.hs:14:39:
- Couldn't match expected type ‘s’ with actual type ‘x’
- ‘x’ is a rigid type variable bound by
- a pattern with constructor:
- T :: forall s x. (s -> (x -> s) -> (x, s, Int)) -> T s,
- in a case alternative
- at tcfail179.hs:14:14
- ‘s’ is a rigid type variable bound by
- the type signature for: run :: T s -> Int at tcfail179.hs:12:8
- In the first argument of ‘g’, namely ‘x’
- In the expression: g x id
- Relevant bindings include
- x :: x (bound at tcfail179.hs:14:26)
- g :: s -> (x -> s) -> (x, s, Int) (bound at tcfail179.hs:14:16)
- ts :: T s (bound at tcfail179.hs:13:5)
- run :: T s -> Int (bound at tcfail179.hs:13:1)
+
+tcfail179.hs:14:39: error:
+ • Couldn't match expected type ‘s’ with actual type ‘x’
+ ‘x’ is a rigid type variable bound by
+ a pattern with constructor:
+ T :: forall s x. (s -> (x -> s) -> (x, s, Int)) -> T s,
+ in a case alternative
+ at tcfail179.hs:14:14
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ run :: forall s. T s -> Int
+ at tcfail179.hs:12:8
+ • In the first argument of ‘g’, namely ‘x’
+ In the expression: g x id
+ • Relevant bindings include
+ x :: x (bound at tcfail179.hs:14:26)
+ g :: s -> (x -> s) -> (x, s, Int) (bound at tcfail179.hs:14:16)
+ ts :: T s (bound at tcfail179.hs:13:5)
+ run :: T s -> Int (bound at tcfail179.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
index 47aeccc586..6d483798b1 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
@@ -12,6 +12,5 @@ tcfail181.hs:17:9: error:
instance Monad ((->) r) -- Defined in ‘GHC.Base’
...plus two others
(use -fprint-potential-instances to see them all)
- In the expression: foo
In the expression: foo {bar = return True}
In an equation for ‘wog’: wog x = foo {bar = return True}
diff --git a/testsuite/tests/typecheck/should_fail/tcfail191.stderr b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
index d9237443df..bd1b04ca80 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail191.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
@@ -1,9 +1,11 @@
-
-tcfail191.hs:11:26:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context: [a] -> [[a]] at tcfail191.hs:10:9
- Expected type: [a] -> [[a]]
- Actual type: [[a]] -> [[a]]
- In the expression: take 5
- In a stmt of a list comprehension: then group using take 5
+
+tcfail191.hs:11:26: error:
+ Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [[a]]
+ at tcfail191.hs:10:9
+ Expected type: [a] -> [[a]]
+ Actual type: [[a]] -> [[a]]
+ In the expression: take 5
+ In a stmt of a list comprehension: then group using take 5
diff --git a/testsuite/tests/typecheck/should_fail/tcfail193.stderr b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
index d2f3f26d92..bd8ef5348a 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail193.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
@@ -1,9 +1,11 @@
-
-tcfail193.hs:10:31:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context: [a] -> [a] at tcfail193.hs:10:10
- Expected type: [a] -> [a]
- Actual type: [a] -> [[a]]
- In the expression: inits
- In a stmt of a list comprehension: then inits
+
+tcfail193.hs:10:31: error:
+ Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [a]
+ at tcfail193.hs:10:10
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ In the expression: inits
+ In a stmt of a list comprehension: then inits
diff --git a/testsuite/tests/typecheck/should_fail/tcfail196.stderr b/testsuite/tests/typecheck/should_fail/tcfail196.stderr
index 723c91de5e..bcb2c32700 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail196.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail196.stderr
@@ -1,5 +1,4 @@
-
-tcfail196.hs:5:8:
- Illegal polymorphic or qualified type: forall a. a
- In the type signature for ‘bar’:
- bar :: Num (forall a. a) => Int -> Int
+
+tcfail196.hs:5:8: error:
+ Illegal polymorphic or qualified type: forall a. a
+ 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 c15af60329..8b814870f2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail197.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail197.stderr
@@ -1,5 +1,5 @@
-
-tcfail197.hs:5:8: error:
- Illegal polymorphic or qualified type: forall a. a
- GHC doesn't yet support impredicative polymorphism
- In the type signature for ‘foo’: foo :: [forall a. a] -> Int
+
+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
diff --git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index 0609229ae8..03efc08ff2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ -1,15 +1,16 @@
tcfail201.hs:17:58: error:
- Couldn't match expected type ‘a’ with actual type ‘HsDoc id0’
+ • 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 a1 b. c (a1 -> b) -> a1 -> c b)
+ the type signature for:
+ gfoldl' :: forall a (c :: * -> *).
+ (forall a1 b. c (a1 -> b) -> a1 -> c b)
-> (forall g. g -> c g) -> a -> c a
- at tcfail201.hs:15:12
- In the first argument of ‘z’, namely ‘DocEmpty’
- In the expression: z DocEmpty
- Relevant bindings include
- hsDoc :: a (bound at tcfail201.hs:16:13)
- gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
- -> (forall g. g -> c g) -> a -> c a
- (bound at tcfail201.hs:16:1)
+ at tcfail201.hs:15:12
+ • In the first argument of ‘z’, namely ‘DocEmpty’
+ In the expression: z DocEmpty
+ • Relevant bindings include
+ hsDoc :: a (bound at tcfail201.hs:16:13)
+ gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
+ -> (forall g. g -> c g) -> a -> c a
+ (bound at tcfail201.hs:16:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail206.stderr b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
index 5090ee165f..687619c9eb 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail206.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
@@ -1,22 +1,24 @@
-tcfail206.hs:5:5:
+tcfail206.hs:5:5: error:
Couldn't match type ‘Bool’ with ‘Int’
Expected type: Bool -> (Int, Bool)
Actual type: Bool -> (Bool, Bool)
In the expression: (, True)
In an equation for ‘a’: a = (, True)
-tcfail206.hs:8:5:
+tcfail206.hs:8:5: error:
Couldn't match type ‘(Integer, Int)’ with ‘Bool -> (Int, Bool)’
Expected type: Int -> Bool -> (Int, Bool)
Actual type: Int -> (Integer, Int)
In the expression: (1,)
In an equation for ‘b’: b = (1,)
-tcfail206.hs:11:5:
+tcfail206.hs:11:5: error:
Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for: c :: a -> (a, Bool) at tcfail206.hs:10:6
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ c :: forall a. a -> (a, Bool)
+ at tcfail206.hs:10:6
Expected type: a -> (a, Bool)
Actual type: a -> (a, a)
In the expression: (True || False,)
@@ -24,25 +26,27 @@ tcfail206.hs:11:5:
Relevant bindings include
c :: a -> (a, Bool) (bound at tcfail206.hs:11:1)
-tcfail206.hs:14:5:
+tcfail206.hs:14:5: error:
Couldn't match type ‘Bool’ with ‘Int’
Expected type: Bool -> (# Int, Bool #)
Actual type: Bool -> (# Bool, Bool #)
In the expression: (# , True #)
In an equation for ‘d’: d = (# , True #)
-tcfail206.hs:17:5:
+tcfail206.hs:17:5: error:
Couldn't match type ‘(# Integer, Int #)’
- with ‘Bool -> (# Int, Bool #)’
+ with ‘Bool -> (# Int, Bool #)’
Expected type: Int -> Bool -> (# Int, Bool #)
Actual type: Int -> (# Integer, Int #)
In the expression: (# 1, #)
In an equation for ‘e’: e = (# 1, #)
-tcfail206.hs:20:5:
+tcfail206.hs:20:5: error:
Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for: f :: a -> (# a, Bool #) at tcfail206.hs:19:6
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. a -> (# a, Bool #)
+ at tcfail206.hs:19:6
Expected type: a -> (# a, Bool #)
Actual type: a -> (# a, a #)
In the expression: (# True || False, #)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail208.stderr b/testsuite/tests/typecheck/should_fail/tcfail208.stderr
index 4b88fc0e58..dd290d942c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail208.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail208.stderr
@@ -1,9 +1,9 @@
-
-tcfail208.hs:4:19:
- Could not deduce (Eq (m a)) arising from a use of ‘==’
- from the context: (Monad m, Eq a)
- bound by the type signature for:
- f :: (Monad m, Eq a) => a -> m a -> Bool
- at tcfail208.hs:3:6-40
- In the expression: (return x == y)
- In an equation for ‘f’: f x y = (return x == y)
+
+tcfail208.hs:4:19: error:
+ Could not deduce (Eq (m a)) arising from a use of ‘==’
+ from the context: (Monad m, Eq a)
+ bound by the type signature for:
+ f :: (Monad m, Eq a) => a -> m a -> Bool
+ at tcfail208.hs:3:1-40
+ In the expression: (return x == y)
+ In an equation for ‘f’: f x y = (return x == y)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail209a.stderr b/testsuite/tests/typecheck/should_fail/tcfail209a.stderr
index 446d76f421..d3da3df44c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail209a.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail209a.stderr
@@ -1,6 +1,5 @@
-
-tcfail209a.hs:3:6:
- Illegal tuple constraint: (Show a, Num a)
- (Use ConstraintKinds to permit this)
- In the type signature for ‘g’:
- g :: ((Show a, Num a), Eq a) => a -> a
+
+tcfail209a.hs:3:6: error:
+ Illegal tuple constraint: (Show a, Num a)
+ (Use ConstraintKinds to permit this)
+ In the type signature: g :: ((Show a, Num a), Eq a) => a -> a
diff --git a/testsuite/tests/typecheck/should_fail/tcfail212.stderr b/testsuite/tests/typecheck/should_fail/tcfail212.stderr
index 72e5fe8104..e14e62bddf 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail212.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail212.stderr
@@ -1,10 +1,10 @@
-
-tcfail212.hs:10:7:
- Expecting one more argument to ‘Maybe’
- The first argument of a tuple should have kind ‘*’,
- but ‘Maybe’ has kind ‘* -> *’
- In the type signature for ‘f’: f :: (Maybe, Either Int)
-
-tcfail212.hs:13:7:
- Expecting a lifted type, but ‘Int#’ is unlifted
- In the type signature for ‘g’: g :: (Int#, Int#)
+
+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#)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail215.stderr b/testsuite/tests/typecheck/should_fail/tcfail215.stderr
index 2157561827..df27691960 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail215.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail215.stderr
@@ -1,4 +1,4 @@
-
-tcfail215.hs:8:15:
- Expecting a lifted type, but ‘Int#’ is unlifted
- In the type signature for ‘foo’: foo :: (?x :: Int#) => Int
+
+tcfail215.hs:8:15: error:
+ Expecting a lifted type, but ‘Int#’ is unlifted
+ In the type signature: foo :: (?x :: Int#) => Int
diff --git a/testsuite/tests/typecheck/should_run/Defer01.hs b/testsuite/tests/typecheck/should_run/Defer01.hs
index 368db9873f..f6c69dcfa7 100755
--- a/testsuite/tests/typecheck/should_run/Defer01.hs
+++ b/testsuite/tests/typecheck/should_run/Defer01.hs
@@ -30,10 +30,10 @@ d = 1
e = 'p'
f = e 'q'
-h :: a -> (Char,Char)
+h :: a -> (Char,Char)
h x = (x,'c')
-data T a where
+data T a where
K :: a -> T a
i a = seq (not (K a)) ()
@@ -48,6 +48,5 @@ k x = x
l :: IO ()
l = putChar >> putChar 'p'
-
main :: IO ()
main = print "No errors!"
diff --git a/testsuite/tests/typecheck/should_run/T7861.stderr b/testsuite/tests/typecheck/should_run/T7861.stderr
index 2f8ae153ba..e0aac9a558 100644
--- a/testsuite/tests/typecheck/should_run/T7861.stderr
+++ b/testsuite/tests/typecheck/should_run/T7861.stderr
@@ -1,9 +1,9 @@
T7861: T7861.hs:10:5: error:
Couldn't match type ‘a’ with ‘[a]’
‘a’ is a rigid type variable bound by
- the type signature for:
- f :: (forall b. a) -> a
- at T7861.hs:9:6
+ the type signature for:
+ f :: forall a. (forall b. a) -> a
+ at T7861.hs:9:6
Expected type: (forall b. a) -> a
Actual type: (forall b. a) -> [a]
In the expression: doA
diff --git a/testsuite/tests/typecheck/should_run/tcrun008.hs b/testsuite/tests/typecheck/should_run/tcrun008.hs
index 80097a8f24..daabdf8fda 100644
--- a/testsuite/tests/typecheck/should_run/tcrun008.hs
+++ b/testsuite/tests/typecheck/should_run/tcrun008.hs
@@ -14,13 +14,10 @@ instance Foo Bool where
bar x = [x, not x]
data Record = R {
- blub :: Foo a => a -> [a]
+ blub :: forall a. Foo a => a -> [a]
}
main = do { let r = R {blub = bar}
- ; print (blub r (3::Int))
- ; print (blub r True)
- }
-
-
-
+ ; print (blub r (3::Int))
+ ; print (blub r True)
+ }