summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-01-12 15:13:32 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2012-01-12 15:13:32 +0000
commit4c68c2f97b25d58e7e1be03891ceff90d48d0936 (patch)
tree7ca2f8ab2b81edad9ec151fe900c373da1ff31e6 /testsuite/tests/typecheck
parentad0e1c9c577ee87a5da8fcf8530ddede06e94de4 (diff)
downloadhaskell-4c68c2f97b25d58e7e1be03891ceff90d48d0936.tar.gz
Lots of error message wibbling, following the
major TcErrors refactoring
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/prog001/typecheck.prog001.stderr-ghc8
-rw-r--r--testsuite/tests/typecheck/should_compile/FD2.stderr50
-rw-r--r--testsuite/tests/typecheck/should_compile/T2494.stderr46
-rw-r--r--testsuite/tests/typecheck/should_compile/T4912.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/tc168.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc211.stderr31
-rw-r--r--testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr143
-rw-r--r--testsuite/tests/typecheck/should_fail/T1897a.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/T1899.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/T2414.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/T2688.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T2714.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T2846b.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T3102.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/T3613.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T3950.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/T5236.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/T5300.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/T5573a.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T5684.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/T5689.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/mc19.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/mc21.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/mc22.stderr41
-rw-r--r--testsuite/tests/typecheck/should_fail/mc23.stderr32
-rw-r--r--testsuite/tests/typecheck/should_fail/mc24.stderr35
-rw-r--r--testsuite/tests/typecheck/should_fail/mc25.stderr34
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail001.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail005.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail008.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail010.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail016.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail018.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail040.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail043.stderr58
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail065.stderr22
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail067.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail068.stderr188
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail072.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail076.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail080.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail080.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail099.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail103.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail104.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail128.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail133.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail140.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail142.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail143.stderr33
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail153.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail168.hs1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail168.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail171.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.stderr60
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail175.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail177.stderr162
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail178.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail179.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail181.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail186.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail189.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail191.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail192.stderr39
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail193.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail194.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail198.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail201.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail206.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail206.stderr95
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail207.stderr2
-rwxr-xr-xtestsuite/tests/typecheck/should_run/Defer01.hs53
-rw-r--r--testsuite/tests/typecheck/should_run/Defer01.stdout1
-rwxr-xr-x[-rw-r--r--]testsuite/tests/typecheck/should_run/all.T3
-rw-r--r--testsuite/tests/typecheck/should_run/tcrun041.hs2
76 files changed, 1077 insertions, 628 deletions
diff --git a/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr-ghc b/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr-ghc
index ea4c0e88f6..04d55b4447 100644
--- a/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr-ghc
+++ b/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr-ghc
@@ -1,4 +1,4 @@
-
-B.hs:7:10:
- Warning: No explicit method nor default method for `row'
- In the instance declaration for `Matrix Bool Val'
+
+B.hs:7:10:
+ Warning: No explicit method or default declaration for `row'
+ In the instance declaration for `Matrix Bool Val'
diff --git a/testsuite/tests/typecheck/should_compile/FD2.stderr b/testsuite/tests/typecheck/should_compile/FD2.stderr
index 4dd98e2c77..2b2fee3eb9 100644
--- a/testsuite/tests/typecheck/should_compile/FD2.stderr
+++ b/testsuite/tests/typecheck/should_compile/FD2.stderr
@@ -1,25 +1,25 @@
-
-FD2.hs:26:36:
- Could not deduce (e1 ~ e)
- from the context (Foldable a)
- bound by the class declaration for `Foldable'
- at FD2.hs:(17,1)-(26,39)
- or from (Elem a e)
- bound by the type signature for
- foldr1 :: Elem a e => (e -> e -> e) -> a -> e
- at FD2.hs:(22,3)-(26,39)
- or from (Elem a e1)
- bound by the type signature for
- mf :: Elem a e1 => e1 -> Maybe e1 -> Maybe e1
- at FD2.hs:(25,12)-(26,39)
- `e1' is a rigid type variable bound by
- the type signature for
- mf :: Elem a e1 => e1 -> Maybe e1 -> Maybe e1
- at FD2.hs:25:12
- `e' is a rigid type variable bound by
- the type signature for
- foldr1 :: Elem a e => (e -> e -> e) -> a -> e
- at FD2.hs:22:3
- In the first argument of `f', namely `x'
- In the first argument of `Just', namely `(f x y)'
- In the expression: Just (f x y)
+
+FD2.hs:26:36:
+ Could not deduce (e ~ e1)
+ from the context (Foldable a)
+ bound by the class declaration for `Foldable'
+ at FD2.hs:(17,1)-(26,39)
+ or from (Elem a e)
+ bound by the type signature for
+ foldr1 :: Elem a e => (e -> e -> e) -> a -> e
+ at FD2.hs:(22,3)-(26,39)
+ or from (Elem a e1)
+ bound by the type signature for
+ mf :: Elem a e1 => e1 -> Maybe e1 -> Maybe e1
+ at FD2.hs:(25,12)-(26,39)
+ `e' is a rigid type variable bound by
+ the type signature for
+ foldr1 :: Elem a e => (e -> e -> e) -> a -> e
+ at FD2.hs:22:3
+ `e1' is a rigid type variable bound by
+ the type signature for
+ mf :: Elem a e1 => e1 -> Maybe e1 -> Maybe e1
+ at FD2.hs:25:12
+ In the first argument of `f', namely `x'
+ In the first argument of `Just', namely `(f x y)'
+ In the expression: Just (f x y)
diff --git a/testsuite/tests/typecheck/should_compile/T2494.stderr b/testsuite/tests/typecheck/should_compile/T2494.stderr
index 5e5661e74a..765858e198 100644
--- a/testsuite/tests/typecheck/should_compile/T2494.stderr
+++ b/testsuite/tests/typecheck/should_compile/T2494.stderr
@@ -1,22 +1,24 @@
-
-T2494.hs:15:7:
- Couldn't match type `b' with `a'
- `b' is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:14:46
- `a' is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:13:46
- Expected type: Maybe (m b) -> Maybe (m b)
- Actual type: Maybe (m a) -> Maybe (m a)
- In the first argument of `foo', namely `f'
- In the expression: foo f (foo g x)
-
-T2494.hs:15:30:
- Couldn't match type `b' with `a'
- `b' is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:14:46
- `a' is a rigid type variable bound by
- the RULE "foo/foo" at T2494.hs:13:46
- Expected type: Maybe (m b) -> Maybe (m a)
- Actual type: Maybe (m b) -> Maybe (m b)
- In the second argument of `(.)', namely `g'
- In the first argument of `foo', namely `(f . g)'
+
+T2494.hs:15:7:
+ Couldn't match type `b' with `a'
+ `b' is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:14:46
+ `a' is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:13:46
+ Expected type: Maybe (m b) -> Maybe (m b)
+ Actual type: Maybe (m a) -> Maybe (m a)
+ In the first argument of `foo', namely `f'
+ In the expression: foo f (foo g x)
+ When checking the transformation rule "foo/foo"
+
+T2494.hs:15:30:
+ Couldn't match type `b' with `a'
+ `b' is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:14:46
+ `a' is a rigid type variable bound by
+ the RULE "foo/foo" at T2494.hs:13:46
+ Expected type: Maybe (m b) -> Maybe (m a)
+ Actual type: Maybe (m b) -> Maybe (m b)
+ In the second argument of `(.)', namely `g'
+ In the first argument of `foo', namely `(f . g)'
+ In the expression: foo (f . g) x
diff --git a/testsuite/tests/typecheck/should_compile/T4912.stderr b/testsuite/tests/typecheck/should_compile/T4912.stderr
index c944dc1260..50d2deb3cd 100644
--- a/testsuite/tests/typecheck/should_compile/T4912.stderr
+++ b/testsuite/tests/typecheck/should_compile/T4912.stderr
@@ -1,4 +1,4 @@
-T4912.hs:10:10: Warning: orphan instance: instance Foo TheirData
+T4912.hs:10:10: Warning: Orphan instance: instance Foo TheirData
-T4912.hs:13:10: Warning: orphan instance: instance Bar OurData
+T4912.hs:13:10: Warning: Orphan instance: instance Bar OurData
diff --git a/testsuite/tests/typecheck/should_compile/tc168.stderr b/testsuite/tests/typecheck/should_compile/tc168.stderr
index 3a97b3f097..cbaa0aceeb 100644
--- a/testsuite/tests/typecheck/should_compile/tc168.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc168.stderr
@@ -5,6 +5,8 @@ tc168.hs:17:1:
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
+ Possible fix: add a type signature that fixes these type variable(s)
Possible fix: add an instance declaration for (C a1 (a, b0))
When checking that `g'
has the inferred type `forall a b a1. C a1 (a, b) => a1 -> a'
diff --git a/testsuite/tests/typecheck/should_compile/tc211.stderr b/testsuite/tests/typecheck/should_compile/tc211.stderr
index 30d986c456..e6c5675422 100644
--- a/testsuite/tests/typecheck/should_compile/tc211.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc211.stderr
@@ -1,25 +1,24 @@
tc211.hs:15:22:
- Couldn't match expected type `a -> a'
- with actual type `forall a1. a1 -> a1'
- Expected type: [a -> a]
- Actual type: [forall a1. a1 -> a1]
+ Couldn't match type `forall a1. a1 -> a1' with `a -> a'
+ Expected type: [a -> a]
+ Actual type: [forall a. a -> a]
In the first argument of `head', namely `foo'
In the first argument of `(:) ::
(forall a. a -> a)
-> [forall a. a -> a] -> [forall a. a -> a]', namely
`(head foo)'
+ In the expression:
+ ((:) ::
+ (forall a. a -> a) -> [forall a. a -> a] -> [forall a. a -> a])
+ (head foo) foo
tc211.hs:70:9:
- Couldn't match expected type `a -> a'
- with actual type `forall a1. a1 -> a1'
- Expected type: List (forall a1. a1 -> a1)
- -> (forall a1. a1 -> a1)
- -> a
- -> a
- Actual type: List (forall a1. a1 -> a1)
- -> (forall a1. a1 -> a1)
- -> forall a1. a1 -> a1
+ Couldn't match type `forall a1. a1 -> a1' with `a -> a'
+ Expected type: List (forall a. a -> a)
+ -> (forall a. a -> a) -> a -> a
+ Actual type: List (forall a. a -> a)
+ -> (forall a. a -> a) -> forall a. a -> a
In the expression:
foo2 ::
List (forall a. a -> a) -> (forall a. a -> a) -> (forall a. a -> a)
@@ -28,3 +27,9 @@ tc211.hs:70:9:
List (forall a. a -> a)
-> (forall a. a -> a) -> (forall a. a -> a))
xs1 (\ x -> x)
+ In an equation for `bar4':
+ bar4
+ = (foo2 ::
+ List (forall a. a -> a)
+ -> (forall a. a -> a) -> (forall a. a -> a))
+ xs1 (\ x -> x)
diff --git a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
index 193d356190..f5a49c89d0 100644
--- a/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
+++ b/testsuite/tests/typecheck/should_fail/FrozenErrorTests.stderr
@@ -1,73 +1,70 @@
-
-FrozenErrorTests.hs:11:1:
- Couldn't match type `a' with `T a'
- `a' is a rigid type variable bound by
- the type signature for foo :: a ~ T a => a -> a
- at FrozenErrorTests.hs:11:1
- Inaccessible code in
- the type signature for foo :: a ~ T a => a -> a
-
-FrozenErrorTests.hs:14:12:
- Couldn't match type `b' with `T b'
- `b' is a rigid type variable bound by
- a pattern with constructor
- MkT2 :: forall a b. b ~ T b => b -> T a,
- in a case alternative
- at FrozenErrorTests.hs:14:12
- Inaccessible code in
- a pattern with constructor
- MkT2 :: forall a b. b ~ T b => b -> T a,
- in a case alternative
- In the pattern: MkT2 y
- In a case alternative: MkT2 y -> ()
- In the expression: case x of { MkT2 y -> () }
-
-FrozenErrorTests.hs:19:12:
- Couldn't match type `Int' with `Bool'
- Inaccessible code in
- a pattern with constructor
- MkT3 :: forall a. a ~ Bool => T a,
- in a case alternative
- In the pattern: MkT3
- In a case alternative: MkT3 -> ()
- In the expression: case x of { MkT3 -> () }
-
-FrozenErrorTests.hs:33:9:
- Occurs check: cannot construct the infinite type: a0 = [a0]
- In the expression: goo1 False undefined
- In an equation for `test1': test1 = goo1 False undefined
-
-FrozenErrorTests.hs:36:15:
- Couldn't match type `[Int]' with `Int'
- In the first argument of `goo2', namely `(goo1 False undefined)'
- In the expression: goo2 (goo1 False undefined)
- In an equation for `test2': test2 = goo2 (goo1 False undefined)
-
-FrozenErrorTests.hs:37:9:
- Couldn't match type `Int' with `[Int]'
- In the expression: goo1 False (goo2 undefined)
- In an equation for `test3': test3 = goo1 False (goo2 undefined)
-
-FrozenErrorTests.hs:52:15:
- Occurs check: cannot construct the infinite type:
- c0 = T2 (T2 c0 c0) c0
- In the first argument of `goo4', namely `(goo3 False undefined)'
- In the expression: goo4 (goo3 False undefined)
- In an equation for `test4': test4 = goo4 (goo3 False undefined)
-
-FrozenErrorTests.hs:52:15:
- Couldn't match type `T2 c0' with `M'
- In the first argument of `goo4', namely `(goo3 False undefined)'
- In the expression: goo4 (goo3 False undefined)
- In an equation for `test4': test4 = goo4 (goo3 False undefined)
-
-FrozenErrorTests.hs:53:9:
- Occurs check: cannot construct the infinite type:
- c0 = T2 (T2 c0 c0) c0
- In the expression: goo3 False (goo4 undefined)
- In an equation for `test5': test5 = goo3 False (goo4 undefined)
-
-FrozenErrorTests.hs:53:9:
- Couldn't match type `T2 c0' with `M'
- In the expression: goo3 False (goo4 undefined)
- In an equation for `test5': test5 = goo3 False (goo4 undefined)
+
+FrozenErrorTests.hs:11:1:
+ Couldn't match type `a' with `T a'
+ `a' is a rigid type variable bound by
+ the type signature for foo :: a ~ T a => a -> a
+ at FrozenErrorTests.hs:11:1
+ Inaccessible code in
+ the type signature for foo :: a ~ T a => a -> a
+
+FrozenErrorTests.hs:14:12:
+ Couldn't match type `b' with `T b'
+ `b' is a rigid type variable bound by
+ a pattern with constructor
+ MkT2 :: forall a b. b ~ T b => b -> T a,
+ in a case alternative
+ at FrozenErrorTests.hs:14:12
+ Inaccessible code in
+ a pattern with constructor
+ MkT2 :: forall a b. b ~ T b => b -> T a,
+ in a case alternative
+ In the pattern: MkT2 y
+ In a case alternative: MkT2 y -> ()
+ In the expression: case x of { MkT2 y -> () }
+
+FrozenErrorTests.hs:19:12:
+ Couldn't match type `Int' with `Bool'
+ Inaccessible code in
+ a pattern with constructor
+ MkT3 :: forall a. a ~ Bool => T a,
+ in a case alternative
+ In the pattern: MkT3
+ In a case alternative: MkT3 -> ()
+ In the expression: case x of { MkT3 -> () }
+
+FrozenErrorTests.hs:33:9:
+ Occurs check: cannot construct the infinite type: a0 = [a0]
+ Expected type: [a0]
+ Actual type: F a0 Bool
+ In the expression: goo1 False undefined
+ In an equation for `test1': test1 = goo1 False undefined
+
+FrozenErrorTests.hs:36:15:
+ Couldn't match type `[Int]' with `Int'
+ Expected type: [[Int]]
+ Actual type: F [Int] Bool
+ In the first argument of `goo2', namely `(goo1 False undefined)'
+ In the expression: goo2 (goo1 False undefined)
+ In an equation for `test2': test2 = goo2 (goo1 False undefined)
+
+FrozenErrorTests.hs:37:9:
+ Couldn't match type `Int' with `[Int]'
+ Expected type: [[Int]]
+ Actual type: F [Int] Bool
+ In the expression: goo1 False (goo2 undefined)
+ In an equation for `test3': test3 = goo1 False (goo2 undefined)
+
+FrozenErrorTests.hs:52:15:
+ Couldn't match type `T2 c0 c0' with `M (T2 (T2 c0 c0) c0)'
+ Expected type: T2 (M (T2 (T2 c0 c0) c0)) (T2 (T2 c0 c0) c0)
+ Actual type: F (T2 (T2 c0 c0) c0) Bool
+ In the first argument of `goo4', namely `(goo3 False undefined)'
+ In the expression: goo4 (goo3 False undefined)
+ In an equation for `test4': test4 = goo4 (goo3 False undefined)
+
+FrozenErrorTests.hs:53:9:
+ Couldn't match type `T2 c0 c0' with `M (T2 (T2 c0 c0) c0)'
+ Expected type: T2 (M (T2 (T2 c0 c0) c0)) (T2 (T2 c0 c0) c0)
+ Actual type: F (T2 (T2 c0 c0) c0) Bool
+ In the expression: goo3 False (goo4 undefined)
+ In an equation for `test5': test5 = goo3 False (goo4 undefined)
diff --git a/testsuite/tests/typecheck/should_fail/T1897a.stderr b/testsuite/tests/typecheck/should_fail/T1897a.stderr
index bbbf8260bd..6e5ee1c7a9 100644
--- a/testsuite/tests/typecheck/should_fail/T1897a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1897a.stderr
@@ -1,8 +1,12 @@
T1897a.hs:9:1:
- Ambiguous type variable `a0' in the constraint:
- (Wob a0 b) arising from the ambiguity check for `foo'
- Probable fix: add a type signature that fixes these type variable(s)
+ Could not deduce (Wob a0 b)
+ arising from the ambiguity check for `foo'
+ 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
+ Possible fix: add a type signature that fixes these type variable(s)
When checking that `foo'
has the inferred type `forall a b. Wob a b => b -> [b]'
Probable cause: the inferred type is ambiguous
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index b0c017351a..5779301745 100644
--- a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ -1,10 +1,11 @@
-
-T1899.hs:14:36:
- 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:10:2
- Expected type: [Proposition a0]
- Actual type: [a]
- In the first argument of `Auxiliary', namely `varSet'
- In the first argument of `Prop', namely `(Auxiliary varSet)'
+
+T1899.hs:14:36:
+ 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:10:2
+ Expected type: [Proposition a0]
+ Actual type: [a]
+ In the first argument of `Auxiliary', namely `varSet'
+ In the first argument of `Prop', namely `(Auxiliary varSet)'
+ In the expression: Prop (Auxiliary varSet)
diff --git a/testsuite/tests/typecheck/should_fail/T2414.stderr b/testsuite/tests/typecheck/should_fail/T2414.stderr
index 030bf6e52a..5fa8f0060a 100644
--- a/testsuite/tests/typecheck/should_fail/T2414.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2414.stderr
@@ -5,3 +5,4 @@ T2414.hs:9:13:
Actual type: b0 -> Maybe b0
In the first argument of `unfoldr', namely `Just'
In the expression: unfoldr Just
+ In an equation for `f': f = unfoldr Just
diff --git a/testsuite/tests/typecheck/should_fail/T2688.stderr b/testsuite/tests/typecheck/should_fail/T2688.stderr
index a658d7395d..aa896569b9 100644
--- a/testsuite/tests/typecheck/should_fail/T2688.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2688.stderr
@@ -1,13 +1,13 @@
-
-T2688.hs:8:22:
- Could not deduce (s ~ v)
- from the context (VectorSpace v s)
- bound by the class declaration for `VectorSpace'
- at T2688.hs:(5,1)-(8,23)
- `s' is a rigid type variable bound by
- the class declaration for `VectorSpace' at T2688.hs:5:21
- `v' is a rigid type variable bound by
- the class declaration for `VectorSpace' at T2688.hs:5:19
- In the second argument of `(/)', namely `s'
- In the second argument of `(*^)', namely `(1 / s)'
- In the expression: v *^ (1 / s)
+
+T2688.hs:8:22:
+ Could not deduce (v ~ s)
+ from the context (VectorSpace v s)
+ bound by the class declaration for `VectorSpace'
+ at T2688.hs:(5,1)-(8,23)
+ `v' is a rigid type variable bound by
+ the class declaration for `VectorSpace' at T2688.hs:5:19
+ `s' is a rigid type variable bound by
+ the class declaration for `VectorSpace' at T2688.hs:5:21
+ In the second argument of `(/)', namely `s'
+ In the second argument of `(*^)', namely `(1 / s)'
+ In the expression: v *^ (1 / s)
diff --git a/testsuite/tests/typecheck/should_fail/T2714.stderr b/testsuite/tests/typecheck/should_fail/T2714.stderr
index da355fc738..18e36fa800 100644
--- a/testsuite/tests/typecheck/should_fail/T2714.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2714.stderr
@@ -14,8 +14,6 @@ T2714.hs:8:5:
`c' is a rigid type variable bound by
the type signature for f :: ((a -> b) -> b) -> c -> a
at T2714.hs:8:1
- Expected type: c
- Actual type: f0 (a -> b)
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/T2846b.stderr b/testsuite/tests/typecheck/should_fail/T2846b.stderr
index 79527c15b7..de90637c2a 100644
--- a/testsuite/tests/typecheck/should_fail/T2846b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2846b.stderr
@@ -2,6 +2,8 @@
T2846b.hs:5:5:
No instance for (Show (Num a0 => a0))
arising from a use of `show'
+ The type variable `a0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
Possible fix: add an instance declaration for (Show (Num a0 => a0))
In the expression: show ([1, 2, 3] :: [Num a => a])
In an equation for `f': f = show ([1, 2, 3] :: [Num a => a])
diff --git a/testsuite/tests/typecheck/should_fail/T3102.stderr b/testsuite/tests/typecheck/should_fail/T3102.stderr
index cf3483870d..0cf9d52187 100644
--- a/testsuite/tests/typecheck/should_fail/T3102.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3102.stderr
@@ -7,3 +7,4 @@ T3102.hs:11:12:
Actual type: ((?p::Int) => a0) -> String
In the first argument of `f', namely `t'
In the expression: f t
+ In an equation for `result': result = f t
diff --git a/testsuite/tests/typecheck/should_fail/T3613.stderr b/testsuite/tests/typecheck/should_fail/T3613.stderr
index feb46416df..1373b7143d 100644
--- a/testsuite/tests/typecheck/should_fail/T3613.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3613.stderr
@@ -1,12 +1,16 @@
T3613.hs:14:20:
- Couldn't match expected type `Maybe a0' with actual type `IO ()'
+ Couldn't match type `IO' with `Maybe'
+ Expected type: Maybe ()
+ Actual type: IO ()
In the first argument of `(>>)', namely `bar'
In the first argument of `fooThen', namely `(bar >> undefined)'
In the expression: fooThen (bar >> undefined)
T3613.hs:17:24:
- Couldn't match expected type `Maybe a0' with actual type `IO ()'
+ Couldn't match type `IO' with `Maybe'
+ Expected type: Maybe ()
+ Actual type: IO ()
In a stmt of a 'do' block: bar
In the first argument of `fooThen', namely
`(do { bar;
diff --git a/testsuite/tests/typecheck/should_fail/T3950.stderr b/testsuite/tests/typecheck/should_fail/T3950.stderr
index 8e6f948524..c8d8340885 100644
--- a/testsuite/tests/typecheck/should_fail/T3950.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3950.stderr
@@ -1,7 +1,13 @@
-
-T3950.hs:15:13:
- Couldn't match expected type `Id p' with actual type `Id p x0'
- Expected type: w (Id p)
- Actual type: Sealed (Id p x0)
- In the first argument of `Just', namely rp'
- In the expression: Just rp'
+
+T3950.hs:15:13:
+ Couldn't match type `Id p0 x0' with `Id p'
+ Expected type: w (Id p)
+ Actual type: Sealed (Id p0 x0)
+ In the first argument of `Just', namely rp'
+ In the expression: Just rp'
+ In an equation for `rp':
+ rp _
+ = Just rp'
+ where
+ rp' :: Sealed (Id p x)
+ rp' = undefined
diff --git a/testsuite/tests/typecheck/should_fail/T5236.stderr b/testsuite/tests/typecheck/should_fail/T5236.stderr
index 76f6de2353..a2da439690 100644
--- a/testsuite/tests/typecheck/should_fail/T5236.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5236.stderr
@@ -1,20 +1,10 @@
-
-T5236.hs:17:5:
- Couldn't match type `A' with `B'
- When using functional dependencies to combine
- Id A A,
- arising from the dependency `a -> b'
- in the instance declaration at T5236.hs:10:10
- Id A B, arising from a use of `loop' at T5236.hs:17:5-8
- In the expression: loop
- In an equation for `f': f = loop
-
-T5236.hs:17:5:
- Couldn't match type `B' with `A'
- When using functional dependencies to combine
- Id B B,
- arising from the dependency `b -> a'
- in the instance declaration at T5236.hs:11:10
- Id A B, arising from a use of `loop' at T5236.hs:17:5-8
- In the expression: loop
- In an equation for `f': f = loop
+
+T5236.hs:17:5:
+ Couldn't match type `A' with `B'
+ When using functional dependencies to combine
+ Id A A,
+ arising from the dependency `a -> b'
+ in the instance declaration at T5236.hs:10:10
+ Id A B, arising from a use of `loop' at T5236.hs:17:5-8
+ In the expression: loop
+ In an equation for `f': f = loop
diff --git a/testsuite/tests/typecheck/should_fail/T5300.stderr b/testsuite/tests/typecheck/should_fail/T5300.stderr
index bc3bc066b5..a051692bc5 100644
--- a/testsuite/tests/typecheck/should_fail/T5300.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5300.stderr
@@ -1,8 +1,13 @@
T5300.hs:15:9:
- Ambiguous type variable `c0' in the constraint:
- (C1 a1 b2 c0) arising from a use of `f1'
- Probable fix: add a type signature that fixes these type variable(s)
+ Could not deduce (C1 a1 b2 c0) arising from a use of `f1'
+ from the context (Monad m, C1 a1 b1 c1, C2 a2 b2 c2)
+ bound by the type signature for
+ f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
+ a1 -> StateT (T b2) m a2
+ at T5300.hs:15:1-36
+ The type variable `c0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
In the first argument of `(>>=)', namely `f1 fm'
In the expression: f1 fm >>= return . undefined
In an equation for `f2': f2 fm = f1 fm >>= return . undefined
diff --git a/testsuite/tests/typecheck/should_fail/T5573a.stderr b/testsuite/tests/typecheck/should_fail/T5573a.stderr
index 7c599cc047..52aa99ae71 100644
--- a/testsuite/tests/typecheck/should_fail/T5573a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5573a.stderr
@@ -3,7 +3,7 @@ T5573a.hs:11:16:
Couldn't match kind `ArgKind' against `(#)'
Kind incompatibility when matching types:
t0 :: ArgKind
- (# t1, t2 #) :: (#)
+ (# t0, t1 #) :: (#)
In the expression: (# True, False #)
In the expression: (# x, (# True, False #) #)
@@ -11,6 +11,6 @@ T5573a.hs:14:6:
Couldn't match kind `ArgKind' against `(#)'
Kind incompatibility when matching types:
t0 :: ArgKind
- (# t1, t2 #) :: (#)
+ (# t0, t1 #) :: (#)
In the pattern: (# x, y #)
In an equation for `foo3': foo3 (# x, y #) = x
diff --git a/testsuite/tests/typecheck/should_fail/T5684.stderr b/testsuite/tests/typecheck/should_fail/T5684.stderr
index 0d029786b0..0aa8b17973 100644
--- a/testsuite/tests/typecheck/should_fail/T5684.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5684.stderr
@@ -1,20 +1,10 @@
-
-T5684.hs:24:12:
- No instance for (B Char b5)
- arising from a use of `op'
- Possible fix: add an instance declaration for (B Char b5)
- In the expression: op 'c' undefined
- In the expression:
- [op False False, op 'c' undefined, op True undefined]
- In an equation for `flop1':
- flop1 = [op False False, op 'c' undefined, op True undefined]
-
-T5684.hs:53:12:
- No instance for (A Bool)
- arising from a use of `op'
- Possible fix: add an instance declaration for (A Bool)
- In the expression: op False False
- In the expression:
- [op True undefined, op False False, op 'c' undefined]
- In an equation for `flop6':
- flop6 = [op True undefined, op False False, op 'c' undefined]
+
+T5684.hs:53:12:
+ No instance for (A Bool)
+ arising from a use of `op'
+ Possible fix: add an instance declaration for (A Bool)
+ In the expression: op False False
+ In the expression:
+ [op True undefined, op False False, op 'c' undefined]
+ In an equation for `flop6':
+ flop6 = [op True undefined, op False False, op 'c' undefined]
diff --git a/testsuite/tests/typecheck/should_fail/T5689.stderr b/testsuite/tests/typecheck/should_fail/T5689.stderr
index cad433a2ca..28f9c01940 100644
--- a/testsuite/tests/typecheck/should_fail/T5689.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5689.stderr
@@ -1,7 +1,7 @@
-
-T5689.hs:10:36:
- Couldn't match type `t' with `Bool'
- In the expression: v
- In the expression: if v then False else True
- In the second argument of `writeIORef', namely
- `(\ v -> if v then False else True)'
+
+T5689.hs:10:36:
+ Couldn't match expected type `t' with actual type `Bool'
+ In the expression: v
+ In the expression: if v then False else True
+ In the second argument of `writeIORef', namely
+ `(\ v -> if v then False else True)'
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 3585f4ae7e..0459783281 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -67,7 +67,7 @@ test('tcfail076', normal, compile_fail, [''])
test('tcfail077', normal, compile_fail, [''])
test('tcfail078', normal, compile_fail, [''])
test('tcfail079', only_compiler_types(['ghc']), compile_fail, [''])
-test('tcfail080', if_compiler_type('ghc', expect_fail), compile_fail, [''])
+test('tcfail080', normal, compile_fail, [''])
test('tcfail082', normal, compile_fail, [''])
test('tcfail083', normal, compile_fail, [''])
test('tcfail084', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/mc19.stderr b/testsuite/tests/typecheck/should_fail/mc19.stderr
index b75e90a30d..7015d47d74 100644
--- a/testsuite/tests/typecheck/should_fail/mc19.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc19.stderr
@@ -1,9 +1,10 @@
-
-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:26
- 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:
+ 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:26
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ In the expression: inits
+ In a stmt of a monad comprehension: then inits
+ In the expression: [x | x <- [3, 2, 1], then inits]
diff --git a/testsuite/tests/typecheck/should_fail/mc21.stderr b/testsuite/tests/typecheck/should_fail/mc21.stderr
index 1e958c83d2..bd7bac1dd9 100644
--- a/testsuite/tests/typecheck/should_fail/mc21.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc21.stderr
@@ -1,9 +1,10 @@
-
-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:12:9
- Expected type: [a] -> [[a]]
- Actual type: [a] -> [a]
- In the return type of a call of `take'
- In the expression: take 5
+
+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:12:9
+ Expected type: [a] -> [[a]]
+ Actual type: [a] -> [a]
+ In the return type of a call of `take'
+ 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 57d9a01835..a309d3bf4b 100644
--- a/testsuite/tests/typecheck/should_fail/mc22.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc22.stderr
@@ -1,9 +1,32 @@
-
-mc22.hs:10:26:
- Couldn't match type `a' with `t0 a'
- `a' is a rigid type variable bound by
- a type expected by the context: [a] -> [t0 a] at mc22.hs:10:9
- Expected type: [a] -> [t0 a]
- Actual type: [a] -> [a]
- In the return type of a call of `take'
- In the expression: take 5
+
+mc22.hs:8:11:
+ No instance for (Num (t0 [Char]))
+ arising from a use of `+'
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ Possible fix: add an instance declaration for (Num (t0 [Char]))
+ In the expression: x + 1
+ In the expression:
+ [x + 1 | x <- ["Hello", "World"], then group using take 5]
+ In an equation for `foo':
+ foo = [x + 1 | x <- ["Hello", "World"], then group using take 5]
+
+mc22.hs:10:9:
+ No instance for (Functor t0)
+ arising from a use of `fmap'
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ 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:
+ Couldn't match type `a' with `t0 a'
+ `a' is a rigid type variable bound by
+ a type expected by the context: [a] -> [t0 a] at mc22.hs:10:9
+ Expected type: [a] -> [t0 a]
+ Actual type: [a] -> [a]
+ In the return type of a call of `take'
+ 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/mc23.stderr b/testsuite/tests/typecheck/should_fail/mc23.stderr
index ec632f8bdb..6e69a1df15 100644
--- a/testsuite/tests/typecheck/should_fail/mc23.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc23.stderr
@@ -1,8 +1,36 @@
+mc23.hs:9:15:
+ No instance for (Enum b0)
+ arising from the arithmetic sequence `1 .. 10'
+ The type variable `b0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In a stmt of a monad comprehension: x <- [1 .. 10]
+ In a stmt of a monad comprehension: then take 5 by x
+ In the expression: [x | x <- [1 .. 10], then take 5 by x]
+
+mc23.hs:9:16:
+ No instance for (Num b0)
+ arising from the literal `1'
+ The type variable `b0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: 1
+ In a stmt of a monad comprehension: x <- [1 .. 10]
+ In a stmt of a monad comprehension: then take 5 by x
+
+mc23.hs:9:24:
+ No instance for (Monad t0)
+ arising from a statement in a monad comprehension
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In a stmt of a monad comprehension: then take 5 by x
+ In the expression: [x | x <- [1 .. 10], then take 5 by x]
+ In an equation for `z': z = [x | x <- [1 .. 10], then take 5 by x]
+
mc23.hs:9:29:
- Couldn't match expected type `a -> t0' with actual type `[a0]'
- Expected type: (a -> t0) -> [a] -> t1 a
+ Couldn't match type `[a0]' with `a -> b0'
+ Expected type: (a -> b0) -> [a] -> t0 a
Actual type: [a0] -> [a0]
In the return type of a call of `take'
Probable cause: `take' is applied to too many arguments
In the expression: take 5
+ In a stmt of a monad comprehension: then take 5 by x
diff --git a/testsuite/tests/typecheck/should_fail/mc24.stderr b/testsuite/tests/typecheck/should_fail/mc24.stderr
index bee1592659..4856dc75ad 100644
--- a/testsuite/tests/typecheck/should_fail/mc24.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc24.stderr
@@ -1,8 +1,39 @@
+mc24.hs:9:14:
+ No instance for (Enum a1)
+ arising from the arithmetic sequence `1 .. 10'
+ The type variable `a1' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In a stmt of a monad comprehension: x <- [1 .. 10]
+ In a stmt of a monad comprehension: then group by x using take 2
+ In the expression:
+ [length x | x <- [1 .. 10], then group by x using take 2]
+
+mc24.hs:9:15:
+ No instance for (Num a1)
+ arising from the literal `1'
+ The type variable `a1' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: 1
+ In a stmt of a monad comprehension: x <- [1 .. 10]
+ In a stmt of a monad comprehension: then group by x using take 2
+
+mc24.hs:10:9:
+ No instance for (Monad t0)
+ arising from a statement in a monad comprehension
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In a stmt of a monad comprehension: then group by x using take 2
+ In the expression:
+ [length x | x <- [1 .. 10], then group by x using take 2]
+ In an equation for `foo':
+ foo = [length x | x <- [1 .. 10], then group by x using take 2]
+
mc24.hs:10:31:
- Couldn't match expected type `a -> t0' with actual type `[a0]'
- Expected type: (a -> t0) -> [a] -> t1 (t2 a)
+ Couldn't match type `[a0]' with `a -> a1'
+ Expected type: (a -> a1) -> [a] -> t0 [a]
Actual type: [a0] -> [a0]
In the return type of a call of `take'
Probable cause: `take' is applied to too many arguments
In the expression: take 2
+ In a stmt of a monad comprehension: then group by x using take 2
diff --git a/testsuite/tests/typecheck/should_fail/mc25.stderr b/testsuite/tests/typecheck/should_fail/mc25.stderr
index 7016fad147..71559fb3d2 100644
--- a/testsuite/tests/typecheck/should_fail/mc25.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc25.stderr
@@ -1,7 +1,35 @@
+mc25.hs:9:15:
+ No instance for (Enum t0)
+ arising from the arithmetic sequence `1 .. 10'
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In a stmt of a monad comprehension: x <- [1 .. 10]
+ In a stmt of a monad comprehension: then group by x using take
+ In the expression: [x | x <- [1 .. 10], then group by x using take]
+
+mc25.hs:9:16:
+ No instance for (Num t0)
+ arising from the literal `1'
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: 1
+ In a stmt of a monad comprehension: x <- [1 .. 10]
+ In a stmt of a monad comprehension: then group by x using take
+
+mc25.hs:9:24:
+ No instance for (Functor t1)
+ arising from a use of `fmap'
+ The type variable `t1' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: fmap
+ In a stmt of a monad comprehension: then group by x using take
+ In the expression: [x | x <- [1 .. 10], then group by x using take]
+
mc25.hs:9:46:
- Couldn't match expected type `a -> t0' with actual type `Int'
- Expected type: (a -> t0) -> [a] -> t1 (t2 a)
- Actual type: Int -> [a0] -> [a0]
+ Couldn't match type `Int' with `a -> t0'
+ Expected type: (a -> t0) -> [a] -> [t1 a]
+ Actual type: Int -> [a] -> [a]
In the expression: take
In a stmt of a monad comprehension: then group by x using take
+ In the expression: [x | x <- [1 .. 10], then group by x using take]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail001.stderr b/testsuite/tests/typecheck/should_fail/tcfail001.stderr
index 5fadcf6271..7c9b8ba27b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail001.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail001.stderr
@@ -1,5 +1,6 @@
tcfail001.hs:9:2:
+ Couldn't match expected type `[t0] -> [a0]' with actual type `[a]'
The equation(s) for `op' have one argument,
but its type `[a]' has none
In the instance declaration for `A [a]'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail005.stderr b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
index 8a158f5c8d..66e6fa9f69 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail005.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
@@ -1,5 +1,5 @@
tcfail005.hs:3:9:
- Couldn't match expected type `[t0]' with actual type `(t1, t2)'
+ Couldn't match expected type `[t0]' with actual type `(t1, Char)'
In the expression: (1, 'a')
In a pattern binding: (h : i) = (1, 'a')
diff --git a/testsuite/tests/typecheck/should_fail/tcfail008.stderr b/testsuite/tests/typecheck/should_fail/tcfail008.stderr
index 2d31ee6034..a6d97c71af 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail008.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail008.stderr
@@ -1,7 +1,24 @@
+tcfail008.hs:3:5:
+ No instance for (Num a0)
+ arising from the literal `1'
+ The type variable `a0' is ambiguous
+ Possible cause: the monomorphism restriction applied to the following:
+ o :: [a0] (bound at tcfail008.hs:3:1)
+ Probable fix: give these definition(s) an explicit type signature
+ or use -XNoMonomorphismRestriction
+ In the first argument of `(:)', namely `1'
+ In the expression: 1 : 2
+ In an equation for `o': o = 1 : 2
+
tcfail008.hs:3:7:
No instance for (Num [a0])
arising from the literal `2'
+ The type variable `a0' is ambiguous
+ Possible cause: the monomorphism restriction applied to the following:
+ o :: [a0] (bound at tcfail008.hs:3:1)
+ Probable fix: give these definition(s) an explicit type signature
+ or use -XNoMonomorphismRestriction
Possible fix: add an instance declaration for (Num [a0])
In the second argument of `(:)', namely `2'
In the expression: 1 : 2
diff --git a/testsuite/tests/typecheck/should_fail/tcfail010.stderr b/testsuite/tests/typecheck/should_fail/tcfail010.stderr
index 20a6d222a7..9371d51dcd 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail010.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail010.stderr
@@ -1,8 +1,13 @@
-
-tcfail010.hs:3:17:
- No instance for (Num [t0])
- arising from a use of `+'
- Possible fix: add an instance declaration for (Num [t0])
- In the expression: z + 2
- In the expression: \ (y : z) -> z + 2
- In an equation for `q': q = \ (y : z) -> z + 2
+
+tcfail010.hs:3:17:
+ No instance for (Num [t0])
+ arising from a use of `+'
+ The type variable `t0' is ambiguous
+ Possible cause: the monomorphism restriction applied to the following:
+ q :: [t0] -> [t0] (bound at tcfail010.hs:3:1)
+ Probable fix: give these definition(s) an explicit type signature
+ or use -XNoMonomorphismRestriction
+ Possible fix: add an instance declaration for (Num [t0])
+ In the expression: z + 2
+ In the expression: \ (y : z) -> z + 2
+ In an equation for `q': q = \ (y : z) -> z + 2
diff --git a/testsuite/tests/typecheck/should_fail/tcfail016.stderr b/testsuite/tests/typecheck/should_fail/tcfail016.stderr
index 6420918b37..6c1fa9ce62 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail016.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail016.stderr
@@ -1,7 +1,16 @@
tcfail016.hs:9:20:
- Couldn't match expected type `Expr t0'
- with actual type `AnnExpr t0'
+ Couldn't match type `(t0, Expr t0)' with `Expr t0'
+ Expected type: Expr t0
+ Actual type: AnnExpr t0
In the first argument of `g', namely `e1'
In the first argument of `(++)', namely `(g e1)'
In the expression: (g e1) ++ (g e2)
+
+tcfail016.hs:9:28:
+ Couldn't match type `(t0, Expr t0)' with `Expr t0'
+ Expected type: Expr t0
+ Actual type: AnnExpr t0
+ In the first argument of `g', namely `e2'
+ In the second argument of `(++)', namely `(g e2)'
+ In the expression: (g e1) ++ (g e2)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail018.stderr b/testsuite/tests/typecheck/should_fail/tcfail018.stderr
index 67ee509537..1aa13624e9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail018.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail018.stderr
@@ -2,6 +2,11 @@
tcfail018.hs:5:10:
No instance for (Num [t0])
arising from the literal `1'
+ The type variable `t0' is ambiguous
+ Possible cause: the monomorphism restriction applied to the following:
+ a :: t0 (bound at tcfail018.hs:5:2)
+ Probable fix: give these definition(s) an explicit type signature
+ or use -XNoMonomorphismRestriction
Possible fix: add an instance declaration for (Num [t0])
In the expression: 1
In a pattern binding: (a : []) = 1
diff --git a/testsuite/tests/typecheck/should_fail/tcfail040.stderr b/testsuite/tests/typecheck/should_fail/tcfail040.stderr
index 19020b609d..cd5ef7a742 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail040.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail040.stderr
@@ -1,8 +1,9 @@
-
-tcfail040.hs:19:5:
- Ambiguous type variable `a0' in the constraint:
- (ORD a0) arising from a use of `<<'
- Probable fix: add a type signature that fixes these type variable(s)
- In the first argument of `(===)', namely `(<<)'
- In the expression: (<<) === (<<)
- In an equation for `f': f = (<<) === (<<)
+
+tcfail040.hs:19:5:
+ No instance for (ORD a0)
+ arising from a use of `<<'
+ The type variable `a0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the first argument of `(===)', namely `(<<)'
+ In the expression: (<<) === (<<)
+ In an equation for `f': f = (<<) === (<<)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail043.stderr b/testsuite/tests/typecheck/should_fail/tcfail043.stderr
index 7cd3faf53e..cf161d4af2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail043.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail043.stderr
@@ -1,21 +1,37 @@
-
-tcfail043.hs:38:17:
- Ambiguous type variable `a0' in the constraints:
- (Ord_ a0) arising from a use of `gt' at tcfail043.hs:38:17-18
- (Eq_ a0) arising from a use of `eq' at tcfail043.hs:40:25-26
- Possible cause: the monomorphism restriction applied to the following:
- search :: a0 -> [a0] -> Bool (bound at tcfail043.hs:37:1)
- Probable fix: give these definition(s) an explicit type signature
- or use -XNoMonomorphismRestriction
- In the expression: gt (hd bs) a
- In the expression:
- if gt (hd bs) a then
- False
- else
- if eq a (hd bs) then True else search a (tl bs)
- In the expression:
- \ a bs
- -> if gt (hd bs) a then
- False
- else
- if eq a (hd bs) then True else search a (tl bs)
+
+tcfail043.hs:38:17:
+ No instance for (Ord_ a0)
+ arising from a use of `gt'
+ The type variable `a0' is ambiguous
+ Possible cause: the monomorphism restriction applied to the following:
+ search :: a0 -> [a0] -> Bool (bound at tcfail043.hs:37:1)
+ Probable fix: give these definition(s) an explicit type signature
+ or use -XNoMonomorphismRestriction
+ In the expression: gt (hd bs) a
+ In the expression:
+ if gt (hd bs) a then
+ False
+ else
+ if eq a (hd bs) then True else search a (tl bs)
+ In the expression:
+ \ a bs
+ -> if gt (hd bs) a then
+ False
+ else
+ if eq a (hd bs) then True else search a (tl bs)
+
+tcfail043.hs:40:25:
+ No instance for (Eq_ a0)
+ arising from a use of `eq'
+ The type variable `a0' is ambiguous
+ Possible cause: the monomorphism restriction applied to the following:
+ search :: a0 -> [a0] -> Bool (bound at tcfail043.hs:37:1)
+ Probable fix: give these definition(s) an explicit type signature
+ or use -XNoMonomorphismRestriction
+ In the expression: eq a (hd bs)
+ In the expression: if eq a (hd bs) then True else search a (tl bs)
+ In the expression:
+ if gt (hd bs) a then
+ False
+ else
+ if eq a (hd bs) then True else search a (tl bs)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail065.stderr b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
index 0621cd74d9..3e9aecf817 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail065.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
@@ -1,11 +1,11 @@
-
-tcfail065.hs:29:20:
- Couldn't match type `x1' with `x'
- `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:18
- In the first argument of `X', namely `x'
- In the expression: X x
- In an equation for `setX': setX x (X _) = X x
+
+tcfail065.hs:29:20:
+ Couldn't match expected type `x' with actual type `x1'
+ `x' is a rigid type variable bound by
+ the instance declaration at tcfail065.hs:28:18
+ `x1' is a rigid type variable bound by
+ the type signature for setX :: x1 -> X x -> X x
+ at tcfail065.hs:29:3
+ In the first argument of `X', namely `x'
+ In the expression: X x
+ In an equation for `setX': setX x (X _) = X x
diff --git a/testsuite/tests/typecheck/should_fail/tcfail067.stderr b/testsuite/tests/typecheck/should_fail/tcfail067.stderr
index 039a4e61f9..513f5e9977 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail067.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail067.stderr
@@ -30,12 +30,12 @@ tcfail067.hs:46:12:
= show value ++ " :" ++ show lower ++ ".." ++ show upper
tcfail067.hs:61:12:
- Could not deduce (Ord a, Show a)
+ Could not deduce (Show a, 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, Show a) to the context of the instance declaration
+ add (Show a, 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)'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail068.stderr b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
index 286d0e8e79..11d39617db 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail068.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
@@ -1,91 +1,97 @@
-
-tcfail068.hs:14:9:
- Could not deduce (s1 ~ s)
- from the context (Constructed a)
- bound by the type signature for
- itgen :: Constructed a => (Int, Int) -> a -> IndTree s a
- at tcfail068.hs:(12,1)-(14,31)
- `s1' is a rigid type variable bound by
- a type expected by the context: GHC.ST.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:12:1
- Expected type: GHC.ST.ST s (IndTree s1 a)
- Actual type: GHC.ST.ST s (STArray s (Int, Int) a)
- In the return type of a call of `newSTArray'
- In the first argument of `runST', namely
- `(newSTArray ((1, 1), n) x)'
-
-tcfail068.hs:19:21:
- Could not deduce (s ~ s1)
- from the context (Constructed a)
- bound by the type signature for
- itiap :: Constructed a =>
- (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:(17,1)-(21,19)
- `s' is a rigid type variable bound by
- the type signature for
- itiap :: Constructed a =>
- (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:17:1
- `s1' is a rigid type variable bound by
- a type expected by the context: GHC.ST.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'
-
-tcfail068.hs:24:35:
- Could not deduce (s ~ s1)
- from the context (Constructed a)
- bound by the type signature for
- itrap :: Constructed a =>
- ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:(24,1)-(32,41)
- `s' is a rigid type variable bound by
- the type signature for
- itrap :: Constructed a =>
- ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
- at tcfail068.hs:24:1
- `s1' is a rigid type variable bound by
- a type expected by the context: GHC.ST.ST s1 (IndTree s a)
- at tcfail068.hs:24:29
- Expected type: GHC.ST.ST s1 (IndTree s a)
- Actual type: GHC.ST.ST s (IndTree s a)
- In the return type of a call of itrap'
- In the first argument of `runST', namely `(itrap' i k)'
-
-tcfail068.hs:36:46:
- Could not deduce (s ~ s1)
- from the context (Constructed b)
- bound by the type signature for
- itrapstate :: Constructed b =>
- ((Int, Int), (Int, Int))
- -> (a -> b -> (a, b))
- -> ((Int, Int) -> c -> a)
- -> (a -> c)
- -> c
- -> IndTree s b
- -> (c, IndTree s b)
- at tcfail068.hs:(36,1)-(45,66)
- `s' is a rigid type variable bound by
- the type signature for
- itrapstate :: Constructed b =>
- ((Int, Int), (Int, Int))
- -> (a -> b -> (a, b))
- -> ((Int, Int) -> c -> a)
- -> (a -> c)
- -> c
- -> IndTree s b
- -> (c, IndTree s b)
- at tcfail068.hs:36:1
- `s1' is a rigid type variable bound by
- a type expected by the context: GHC.ST.ST s1 (c, IndTree s b)
- at tcfail068.hs:36:40
- Expected type: GHC.ST.ST s1 (c, IndTree s b)
- Actual type: GHC.ST.ST s (c, IndTree s b)
- In the return type of a call of itrapstate'
- In the first argument of `runST', namely `(itrapstate' i k s)'
+
+tcfail068.hs:14:9:
+ Could not deduce (s1 ~ s)
+ from the context (Constructed a)
+ bound by the type signature for
+ itgen :: Constructed a => (Int, Int) -> a -> IndTree s a
+ at tcfail068.hs:(12,1)-(14,31)
+ `s1' is a rigid type variable bound by
+ a type expected by the context: GHC.ST.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:12:1
+ Expected type: GHC.ST.ST s1 (IndTree s a)
+ Actual type: GHC.ST.ST s1 (STArray s1 (Int, Int) a)
+ In the return type of a call of `newSTArray'
+ In the first argument of `runST', namely
+ `(newSTArray ((1, 1), n) x)'
+ In the expression: runST (newSTArray ((1, 1), n) x)
+
+tcfail068.hs:19:21:
+ Could not deduce (s ~ s1)
+ from the context (Constructed a)
+ bound by the type signature for
+ itiap :: Constructed a =>
+ (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+ at tcfail068.hs:(17,1)-(21,19)
+ `s' is a rigid type variable bound by
+ the type signature for
+ itiap :: Constructed a =>
+ (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+ at tcfail068.hs:17:1
+ `s1' is a rigid type variable bound by
+ a type expected by the context: GHC.ST.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'
+ In the first argument of `runST', namely
+ `(readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)'
+
+tcfail068.hs:24:35:
+ Could not deduce (s ~ s1)
+ from the context (Constructed a)
+ bound by the type signature for
+ itrap :: Constructed a =>
+ ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
+ at tcfail068.hs:(24,1)-(32,41)
+ `s' is a rigid type variable bound by
+ the type signature for
+ itrap :: Constructed a =>
+ ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
+ at tcfail068.hs:24:1
+ `s1' is a rigid type variable bound by
+ a type expected by the context: GHC.ST.ST s1 (IndTree s a)
+ at tcfail068.hs:24:29
+ Expected type: GHC.ST.ST s1 (IndTree s a)
+ Actual type: GHC.ST.ST s (IndTree s a)
+ In the return type of a call of itrap'
+ In the first argument of `runST', namely `(itrap' i k)'
+ In the expression: runST (itrap' i k)
+
+tcfail068.hs:36:46:
+ Could not deduce (s ~ s1)
+ from the context (Constructed b)
+ bound by the type signature for
+ itrapstate :: Constructed b =>
+ ((Int, Int), (Int, Int))
+ -> (a -> b -> (a, b))
+ -> ((Int, Int) -> c -> a)
+ -> (a -> c)
+ -> c
+ -> IndTree s b
+ -> (c, IndTree s b)
+ at tcfail068.hs:(36,1)-(45,66)
+ `s' is a rigid type variable bound by
+ the type signature for
+ itrapstate :: Constructed b =>
+ ((Int, Int), (Int, Int))
+ -> (a -> b -> (a, b))
+ -> ((Int, Int) -> c -> a)
+ -> (a -> c)
+ -> c
+ -> IndTree s b
+ -> (c, IndTree s b)
+ at tcfail068.hs:36:1
+ `s1' is a rigid type variable bound by
+ a type expected by the context: GHC.ST.ST s1 (c, IndTree s b)
+ at tcfail068.hs:36:40
+ Expected type: GHC.ST.ST s1 (c, IndTree s b)
+ Actual type: GHC.ST.ST s (c, IndTree s b)
+ In the return type of a call of itrapstate'
+ In the first argument of `runST', namely `(itrapstate' i k s)'
+ In the expression: runST (itrapstate' i k s)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail072.stderr b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
index 469e75849a..4d6bd867b2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail072.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
@@ -1,14 +1,11 @@
tcfail072.hs:23:13:
- Ambiguous type variable `p0' in the constraint:
- (Ord p0) arising from a use of `g'
- Probable fix: add a type signature that fixes these type variable(s)
- In the expression: g A
- In an equation for `g': g (B _ _) = g A
-
-tcfail072.hs:23:13:
- Ambiguous type variable `q0' in the constraint:
- (Ord q0) arising from a use of `g'
- Probable fix: add a type signature that fixes these type variable(s)
+ Could not deduce (Ord p0, Ord q0) arising from a use of `g'
+ 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:23:1-15
+ The type variables `p0', `q0' are ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
In the expression: g A
In an equation for `g': g (B _ _) = g A
diff --git a/testsuite/tests/typecheck/should_fail/tcfail076.stderr b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
index 9c380de958..4ca4cf403b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail076.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
@@ -11,3 +11,4 @@ tcfail076.hs:18:82:
Actual type: m res
In the return type of a call of `cont'
In the expression: cont a
+ In the first argument of `KContT', namely `(\ cont' -> cont a)'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail080.hs b/testsuite/tests/typecheck/should_fail/tcfail080.hs
index b2a62cea54..fa77ad8242 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail080.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail080.hs
@@ -11,7 +11,9 @@
-- Of course, it'd be hard to fill in the "..." in this particular
-- case, but that relies on observations about the form of the types
-- of the class methods, surely beyond what a compiler should do.
--- That's why GHC accepts it
+--
+-- Still, the type is ambiguous because there's nothing to fix 'c'
+
module ShouldFail where
diff --git a/testsuite/tests/typecheck/should_fail/tcfail080.stderr b/testsuite/tests/typecheck/should_fail/tcfail080.stderr
index e69de29bb2..520078682b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail080.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail080.stderr
@@ -0,0 +1,14 @@
+
+tcfail080.hs:27:1:
+ Could not deduce (Collection c0 a)
+ arising from the ambiguity check for `q'
+ 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
+ Possible fix: add a type signature that fixes these type variable(s)
+ When checking that `q'
+ has the inferred type `forall (c :: * -> *) a.
+ Collection c a =>
+ a -> Bool'
+ Probable cause: the inferred type is ambiguous
diff --git a/testsuite/tests/typecheck/should_fail/tcfail099.stderr b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
index f97c5a1161..aa7eb99197 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail099.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
@@ -1,13 +1,13 @@
tcfail099.hs:9:20:
- Couldn't match type `t' with `a'
- `t' is a rigid type variable bound by
- the inferred type of call :: DS -> t -> Int at tcfail099.hs:9:1
+ Couldn't match expected type `a' with actual type `t'
`a' is a rigid type variable bound by
a pattern with constructor
C :: forall a. (a -> Int) -> DS,
in an equation for `call'
at tcfail099.hs:9:7
+ `t' is a rigid type variable bound by
+ the inferred type of call :: DS -> t -> Int at tcfail099.hs:9:1
In the first argument of `f', namely `arg'
In the expression: f arg
In an equation for `call': call (C f) arg = f arg
diff --git a/testsuite/tests/typecheck/should_fail/tcfail103.stderr b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
index 2602859db4..7d6e4dfd6c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail103.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
@@ -1,11 +1,12 @@
-
-tcfail103.hs:15:23:
- 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:11:1
- `s' is a rigid type variable bound by
- the type signature for g :: ST s Int at tcfail103.hs:15:9
- Expected type: STRef s Int
- Actual type: STRef t Int
- In the first argument of `readSTRef', namely `v'
- In the expression: readSTRef v
+
+tcfail103.hs:15:23:
+ 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:11:1
+ `s' is a rigid type variable bound by
+ the type signature for g :: ST s Int at tcfail103.hs:15:9
+ Expected type: STRef s Int
+ Actual type: STRef t Int
+ In the first argument of `readSTRef', namely `v'
+ In the expression: readSTRef v
+ In an equation for `g': g = readSTRef v
diff --git a/testsuite/tests/typecheck/should_fail/tcfail104.stderr b/testsuite/tests/typecheck/should_fail/tcfail104.stderr
index 8bd4608bde..5e6fc3bb1f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail104.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail104.stderr
@@ -1,6 +1,6 @@
tcfail104.hs:16:19:
- Couldn't match expected type `a0 -> a0'
+ Couldn't match expected type `Char -> Char'
with actual type `forall a. a -> a'
In the expression: x
In the expression: (\ x -> x)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail128.stderr b/testsuite/tests/typecheck/should_fail/tcfail128.stderr
index a3c99a9548..90793cf7d0 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail128.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail128.stderr
@@ -2,6 +2,8 @@
tcfail128.hs:18:16:
No instance for (Data.Array.Base.MArray b0 FlatVector IO)
arising from a use of `thaw'
+ The type variable `b0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
Possible fix:
add an instance declaration for
(Data.Array.Base.MArray b0 FlatVector IO)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail133.stderr b/testsuite/tests/typecheck/should_fail/tcfail133.stderr
index 2808159950..fb506dd7d1 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail133.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail133.stderr
@@ -2,9 +2,21 @@
tcfail133.hs:2:61:
Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+tcfail133.hs:68:7:
+ No instance for (Show a0)
+ arising from a use of `show'
+ The type variable `a0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: show
+ In the expression: show $ add (One :@ Zero) (One :@ One)
+ In an equation for `foo':
+ foo = show $ add (One :@ Zero) (One :@ One)
+
tcfail133.hs:68:14:
No instance for (AddDigit (Zero :@ (One :@ One)) One a0)
arising from a use of `add'
+ The type variable `a0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
Possible fix:
add an instance declaration for
(AddDigit (Zero :@ (One :@ One)) One a0)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail140.stderr b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
index bc888d2309..f24a2a7f82 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail140.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
@@ -1,22 +1,24 @@
tcfail140.hs:10:7:
+ Couldn't match expected type `a0 -> t0' with actual type `Int'
The function `f' is applied to two arguments,
but its type `Int -> Int' has only one
In the expression: f 3 9
In an equation for `bar': bar = f 3 9
tcfail140.hs:12:10:
+ Couldn't match expected type `a0 -> t0' with actual type `Int'
The operator `f' takes two arguments,
but its type `Int -> Int' has only one
In the expression: 3 `f` 4
In an equation for `rot': rot xs = 3 `f` 4
tcfail140.hs:14:15:
+ Couldn't match expected type `a0 -> b0' with actual type `Int'
The operator `f' takes two arguments,
but its type `Int -> Int' has only one
In the first argument of `map', namely `(3 `f`)'
In the expression: map (3 `f`) xs
- In an equation for `bot': bot xs = map (3 `f`) xs
tcfail140.hs:16:8:
Constructor `Just' should have 1 argument, but has been given none
@@ -25,5 +27,6 @@ tcfail140.hs:16:8:
In the expression: ((\ Just x -> x) :: Maybe a -> a) (Just 1)
tcfail140.hs:19:1:
+ Couldn't match expected type `t0 -> Bool' with actual type `Int'
The equation(s) for `g' have two arguments,
but its type `Int -> Int' has only one
diff --git a/testsuite/tests/typecheck/should_fail/tcfail142.stderr b/testsuite/tests/typecheck/should_fail/tcfail142.stderr
index cd0161658f..3fd20cc2f9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail142.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail142.stderr
@@ -1,8 +1,9 @@
tcfail142.hs:21:12:
- Ambiguous type variables `a0', `r0' in the constraint:
- (Bar a0 r0) arising from a use of `bar'
- Probable fix: add a type signature that fixes these type variable(s)
+ No instance for (Bar a0 r0)
+ arising from a use of `bar'
+ The type variables `a0', `r0' are ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
In the first argument of `foo', namely `bar'
In the expression: foo bar
In an equation for `test': test = foo bar
diff --git a/testsuite/tests/typecheck/should_fail/tcfail143.stderr b/testsuite/tests/typecheck/should_fail/tcfail143.stderr
index 2c3857e0ee..846f8c0252 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail143.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail143.stderr
@@ -1,22 +1,11 @@
-
-tcfail143.hs:29:9:
- Couldn't match type `S Z' with `Z'
- When using functional dependencies to combine
- MinMax a Z Z a,
- arising from the dependency `a b -> c d'
- in the instance declaration at tcfail143.hs:11:10
- MinMax (S Z) Z Z Z,
- arising from a use of `extend' at tcfail143.hs:29:9-16
- In the expression: n1 `extend` n0
- In an equation for `t2': t2 = n1 `extend` n0
-
-tcfail143.hs:29:9:
- Couldn't match type `Z' with `S Z'
- When using functional dependencies to combine
- MinMax Z Z Z Z,
- arising from the dependency `b c d -> a'
- in the instance declaration at tcfail143.hs:10:10
- MinMax (S Z) Z Z Z,
- arising from a use of `extend' at tcfail143.hs:29:9-16
- In the expression: n1 `extend` n0
- In an equation for `t2': t2 = n1 `extend` n0
+
+tcfail143.hs:29:9:
+ Couldn't match type `S Z' with `Z'
+ When using functional dependencies to combine
+ MinMax a Z Z a,
+ arising from the dependency `a b -> c d'
+ in the instance declaration at tcfail143.hs:11:10
+ MinMax (S Z) Z Z Z,
+ arising from a use of `extend' at tcfail143.hs:29:9-16
+ In the expression: n1 `extend` n0
+ In an equation for `t2': t2 = n1 `extend` n0
diff --git a/testsuite/tests/typecheck/should_fail/tcfail153.stderr b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
index 0b40df47d1..ca0b42b054 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail153.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
@@ -1,6 +1,6 @@
tcfail153.hs:6:9:
- Couldn't match type `a' with `Bool'
+ Couldn't match expected type `a' with actual type `Bool'
`a' is a rigid type variable bound by
the type signature for f :: a -> [a] at tcfail153.hs:6:1
In the first argument of `g', namely `x'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail168.hs b/testsuite/tests/typecheck/should_fail/tcfail168.hs
index 94a78a93b0..b6762d888d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail168.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail168.hs
@@ -63,4 +63,3 @@ foo = do
putChar 'a'
putChar 'a'
putChar 'a'
-
diff --git a/testsuite/tests/typecheck/should_fail/tcfail168.stderr b/testsuite/tests/typecheck/should_fail/tcfail168.stderr
index f16f65bdb1..a6a5064562 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail168.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail168.stderr
@@ -1,12 +1,17 @@
-tcfail168.hs:8:11:
- Couldn't match expected type `Char -> a0' with actual type `IO ()'
- In the return type of a call of `putChar'
- Probable cause: `putChar' is applied to too many arguments
- In a stmt of a 'do' block: putChar 'a'
+tcfail168.hs:7:11:
+ Couldn't match expected type `IO a0'
+ with actual type `Char -> IO ()'
+ In a stmt of a 'do' block: putChar
In the expression:
do { putChar;
putChar 'a';
putChar 'a';
putChar 'a';
.... }
+ In an equation for `foo':
+ foo
+ = do { putChar;
+ putChar 'a';
+ putChar 'a';
+ .... }
diff --git a/testsuite/tests/typecheck/should_fail/tcfail171.stderr b/testsuite/tests/typecheck/should_fail/tcfail171.stderr
index b4efd33e32..714edb1f12 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail171.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail171.stderr
@@ -1,6 +1,6 @@
tcfail171.hs:9:10:
- No instances for (PrintfType b, PrintfArg a)
+ No instances for (PrintfArg a, PrintfType b)
arising from a use of `printf'
In the expression: printf "0x%x" x
In an equation for `phex': phex x = printf "0x%x" x
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.stderr b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
index cf8c4cc9c0..89135d656e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
@@ -1,29 +1,31 @@
-
-tcfail174.hs:9:10:
- 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
- In an equation for `g': g = Base id
-
-tcfail174.hs:13:14:
- Couldn't match type `a' with `a1'
- `a' is a rigid type variable bound by
- the inferred type of h1 :: Capture a at tcfail174.hs:13:1
- `a1' is a rigid type variable bound by
- the type forall a. a -> a at tcfail174.hs:13:14
- Expected type: Capture (forall x. x -> a)
- Actual type: Capture (forall a. a -> a)
- In the first argument of `Capture', namely `g'
- In the expression: Capture g
-
-tcfail174.hs:16:14:
- Couldn't match type `a' with `b'
- `a' is a rigid type variable bound by
- the type forall a. a -> a at tcfail174.hs:16:14
- `b' is a rigid type variable bound by
- the type signature for h2 :: Capture b at tcfail174.hs:16:1
- Expected type: Capture (forall x. x -> b)
- Actual type: Capture (forall a. a -> a)
- In the first argument of `Capture', namely `g'
- In the expression: Capture g
+
+tcfail174.hs:9:10:
+ 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
+ In an equation for `g': g = Base id
+
+tcfail174.hs:13:14:
+ Couldn't match type `a' with `a1'
+ `a' is a rigid type variable bound by
+ the inferred type of h1 :: Capture a at tcfail174.hs:13:1
+ `a1' is a rigid type variable bound by
+ the type forall a1. a1 -> a1 at tcfail174.hs:13:14
+ Expected type: Capture (forall x. x -> a)
+ Actual type: Capture (forall a. a -> a)
+ In the first argument of `Capture', namely `g'
+ In the expression: Capture g
+ In an equation for `h1': h1 = Capture g
+
+tcfail174.hs:16:14:
+ Couldn't match type `a' with `b'
+ `a' is a rigid type variable bound by
+ the type forall a. a -> a at tcfail174.hs:16:14
+ `b' is a rigid type variable bound by
+ the type signature for h2 :: Capture b at tcfail174.hs:16:1
+ Expected type: Capture (forall x. x -> b)
+ Actual type: Capture (forall a. a -> a)
+ In the first argument of `Capture', namely `g'
+ In the expression: Capture g
+ In an equation for `h2': h2 = Capture g
diff --git a/testsuite/tests/typecheck/should_fail/tcfail175.stderr b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
index f181c00bcd..4fe5bfbe41 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail175.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
@@ -1,6 +1,7 @@
tcfail175.hs:11:1:
- Couldn't match type `a' with `String -> String -> String'
+ Couldn't match expected type `a'
+ with actual type `String -> String -> String'
`a' is a rigid type variable bound by
the type signature for evalRHS :: Int -> a at tcfail175.hs:11:1
The equation(s) for `evalRHS' have three arguments,
diff --git a/testsuite/tests/typecheck/should_fail/tcfail177.stderr b/testsuite/tests/typecheck/should_fail/tcfail177.stderr
index 3107d1e668..dc622daafa 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail177.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail177.stderr
@@ -7,3 +7,165 @@ tcfail177.hs:10:12:
[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
In an equation for `allTests':
allTests = foo [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", ....]
+
+tcfail177.hs:20:13:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:20:20:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:20:27:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:21:13:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:21:20:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:21:27:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:22:13:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:22:20:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:22:27:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:23:13:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:23:20:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:23:27:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:24:13:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:24:20:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:24:27:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:25:13:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:25:20:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+
+tcfail177.hs:25:27:
+ Couldn't match expected type `Bool' with actual type `[Char]'
+ In the expression: "Two"
+ In the first argument of `foo', namely
+ `[a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]'
+ In the expression:
+ foo
+ [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail178.stderr b/testsuite/tests/typecheck/should_fail/tcfail178.stderr
index 63119af75e..66773a2fea 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail178.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail178.stderr
@@ -1,10 +1,11 @@
tcfail178.hs:15:7:
- Couldn't match expected type `[a0]' with actual type `()'
+ Couldn't match type `()' with `[a0]'
Expected type: Bool -> [a0]
Actual type: Bool -> ()
In the first argument of `a', namely `y'
In the expression: a y
+ In an equation for `c': c = a y
tcfail178.hs:18:7:
Couldn't match expected type `Bool -> [a0]' with actual type `()'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail179.stderr b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
index 6d723db452..a24d404e15 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail179.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
@@ -1,13 +1,13 @@
-
-tcfail179.hs:14:39:
- Couldn't match type `x' with `s'
- `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:13:1
- In the first argument of `g', namely `x'
- In the expression: g x id
- In a pattern binding: (x, _, b) = g x id
+
+tcfail179.hs:14:39:
+ Couldn't match expected type `s' with actual type `x'
+ `s' is a rigid type variable bound by
+ the type signature for run :: T s -> Int at tcfail179.hs:13:1
+ `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
+ In the first argument of `g', namely `x'
+ In the expression: g x id
+ In a pattern binding: (x, _, b) = g x id
diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
index 59fe8b83af..25e6cbf2af 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
@@ -1,8 +1,9 @@
tcfail181.hs:17:9:
- Ambiguous type variable `m0' in the constraint:
- (Monad m0) arising from a use of `foo'
- Probable fix: add a type signature that fixes these type variable(s)
+ No instance for (Monad m0)
+ arising from a use of `foo'
+ The type variable `m0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
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/tcfail186.stderr b/testsuite/tests/typecheck/should_fail/tcfail186.stderr
index 3f4504b810..b22e672ae6 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail186.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail186.stderr
@@ -1,7 +1,8 @@
tcfail186.hs:7:9:
- Couldn't match expected type `PhantomSyn a0'
- with actual type `[Char]'
+ Couldn't match type `[Char]' with `Int'
+ Expected type: PhantomSyn a0
+ Actual type: [Char]
In the first argument of `f', namely `"hoo"'
In the expression: f "hoo"
In an equation for `foo': foo = f "hoo"
diff --git a/testsuite/tests/typecheck/should_fail/tcfail189.stderr b/testsuite/tests/typecheck/should_fail/tcfail189.stderr
index b3a6cb4b96..6364cc2d5b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail189.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail189.stderr
@@ -1,8 +1,9 @@
tcfail189.hs:10:31:
- Couldn't match expected type `a -> t0' with actual type `[a0]'
- Expected type: (a -> t0) -> [a] -> [[a]]
+ Couldn't match type `[a0]' with `a -> a1'
+ Expected type: (a -> a1) -> [a] -> [[a]]
Actual type: [a0] -> [a0]
In the return type of a call of `take'
Probable cause: `take' is applied to too many arguments
In the expression: take 2
+ In a stmt of a list comprehension: then group by x using take 2
diff --git a/testsuite/tests/typecheck/should_fail/tcfail191.stderr b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
index f69bd2c263..a276a04eae 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail191.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
@@ -1,9 +1,10 @@
-
-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:11:9
- Expected type: [a] -> [[a]]
- Actual type: [a] -> [a]
- In the return type of a call of `take'
- In the expression: take 5
+
+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:11:9
+ Expected type: [a] -> [[a]]
+ Actual type: [a] -> [a]
+ In the return type of a call of `take'
+ 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/tcfail192.stderr b/testsuite/tests/typecheck/should_fail/tcfail192.stderr
index 097c02fab5..349121975c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail192.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail192.stderr
@@ -1,19 +1,20 @@
-
-tcfail192.hs:8:11:
- No instance for (Num [[Char]])
- arising from a use of `+'
- Possible fix: add an instance declaration for (Num [[Char]])
- In the expression: x + 1
- In the expression:
- [x + 1 | x <- ["Hello", "World"], then group using take 5]
- In an equation for `foo':
- foo = [x + 1 | x <- ["Hello", "World"], then group using take 5]
-
-tcfail192.hs:10: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 tcfail192.hs:10:9
- Expected type: [a] -> [[a]]
- Actual type: [a] -> [a]
- In the return type of a call of `take'
- In the expression: take 5
+
+tcfail192.hs:8:11:
+ No instance for (Num [[Char]])
+ arising from a use of `+'
+ Possible fix: add an instance declaration for (Num [[Char]])
+ In the expression: x + 1
+ In the expression:
+ [x + 1 | x <- ["Hello", "World"], then group using take 5]
+ In an equation for `foo':
+ foo = [x + 1 | x <- ["Hello", "World"], then group using take 5]
+
+tcfail192.hs:10: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 tcfail192.hs:10:9
+ Expected type: [a] -> [[a]]
+ Actual type: [a] -> [a]
+ In the return type of a call of `take'
+ 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 988810e2f8..47375e8401 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail193.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
@@ -1,9 +1,10 @@
-
-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:26
- 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:
+ 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:26
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ In the expression: inits
+ In a stmt of a list comprehension: then inits
+ In the expression: [x | x <- [3, 2, 1], then inits]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail194.stderr b/testsuite/tests/typecheck/should_fail/tcfail194.stderr
index be6e37ec6b..c206bd51f3 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail194.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail194.stderr
@@ -1,8 +1,27 @@
+tcfail194.hs:9:15:
+ No instance for (Enum t0)
+ arising from the arithmetic sequence `1 .. 10'
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: [1 .. 10]
+ In a stmt of a list comprehension: x <- [1 .. 10]
+ In a stmt of a list comprehension: then take 5 by x
+
+tcfail194.hs:9:16:
+ No instance for (Num t0)
+ arising from the literal `1'
+ The type variable `t0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ In the expression: 1
+ In the expression: [1 .. 10]
+ In a stmt of a list comprehension: x <- [1 .. 10]
+
tcfail194.hs:9:29:
- Couldn't match expected type `a -> t0' with actual type `[a0]'
+ Couldn't match type `[a0]' with `a -> t0'
Expected type: (a -> t0) -> [a] -> [a]
Actual type: [a0] -> [a0]
In the return type of a call of `take'
Probable cause: `take' is applied to too many arguments
In the expression: take 5
+ In a stmt of a list comprehension: then take 5 by x
diff --git a/testsuite/tests/typecheck/should_fail/tcfail198.stderr b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
index 27fbf92f5a..bba13900de 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail198.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
@@ -1,10 +1,10 @@
tcfail198.hs:6:36:
- Couldn't match type `a' with `a1'
- `a' is a rigid type variable bound by
- the inferred type of f3 :: [a] -> [a] at tcfail198.hs:6:1
+ Couldn't match expected type `a1' with actual type `a'
`a1' is a rigid type variable bound by
an expression type signature: a1 at tcfail198.hs:6:36
+ `a' is a rigid type variable bound by
+ the inferred type of f3 :: [a] -> [a] at tcfail198.hs:6:1
In the expression: x :: a
In the second argument of `(++)', namely `[x :: a]'
In the expression: xs ++ [x :: a]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index 23dd02614b..f45b899b90 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ -1,15 +1,15 @@
-
-tcfail201.hs:18:28:
- Couldn't match type `a' with `HsDoc id0'
- `a' is a rigid type variable bound by
- the type signature for
- gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
- -> (forall g. g -> c g) -> a -> c a
- at tcfail201.hs:16:1
- In the pattern: DocParagraph hsDoc
- In a case alternative:
- (DocParagraph hsDoc) -> z DocParagraph `k` hsDoc
- In the expression:
- case hsDoc of {
- DocEmpty -> z DocEmpty
- (DocParagraph hsDoc) -> z DocParagraph `k` hsDoc }
+
+tcfail201.hs:18:28:
+ 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)
+ -> (forall g. g -> c g) -> a -> c a
+ at tcfail201.hs:16:1
+ In the pattern: DocParagraph hsDoc
+ In a case alternative:
+ (DocParagraph hsDoc) -> z DocParagraph `k` hsDoc
+ In the expression:
+ case hsDoc of {
+ DocEmpty -> z DocEmpty
+ (DocParagraph hsDoc) -> z DocParagraph `k` hsDoc }
diff --git a/testsuite/tests/typecheck/should_fail/tcfail206.hs b/testsuite/tests/typecheck/should_fail/tcfail206.hs
index a256bc3e34..95b0eba359 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail206.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail206.hs
@@ -1,5 +1,5 @@
{-# LANGUAGE TupleSections, UnboxedTuples #-}
-module Main where
+module ShouldCompile where
a :: Bool -> (Int, Bool)
a = ( , True)
@@ -18,5 +18,3 @@ e = (#1, #)
f :: a -> (#a, Bool#)
f = (#True || False, #)
-
-main = return () \ No newline at end of file
diff --git a/testsuite/tests/typecheck/should_fail/tcfail206.stderr b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
index f469475b9f..76b5c7ebd2 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail206.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
@@ -1,48 +1,47 @@
-
-tcfail206.hs:5:5:
- Couldn't match expected type `Int' with actual type `Bool'
- Expected type: Bool -> (Int, Bool)
- Actual type: Bool -> (Bool, t0)
- In the expression: (, True)
- In an equation for `a': a = (, True)
-
-tcfail206.hs:8:5:
- Couldn't match expected type `Bool -> (Int, Bool)'
- with actual type `(t0, Int)'
- Expected type: Int -> Bool -> (Int, Bool)
- Actual type: Int -> (t0, Int)
- In the expression: (1,)
- In an equation for `b': b = (1,)
-
-tcfail206.hs:11:5:
- 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:11:1
- Expected type: a -> (a, Bool)
- Actual type: a -> (a, a)
- In the expression: (True || False,)
- In an equation for `c': c = (True || False,)
-
-tcfail206.hs:14:5:
- Couldn't match expected type `Int' with actual type `Bool'
- Expected type: Bool -> (# Int, Bool #)
- Actual type: Bool -> (# Bool, t0 #)
- In the expression: (# , True #)
- In an equation for `d': d = (# , True #)
-
-tcfail206.hs:17:5:
- Couldn't match expected type `Bool -> (# Int, Bool #)'
- with actual type `(# t0, Int #)'
- Expected type: Int -> Bool -> (# Int, Bool #)
- Actual type: Int -> (# t0, Int #)
- In the expression: (# 1, #)
- In an equation for `e': e = (# 1, #)
-
-tcfail206.hs:20:5:
- 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:20:1
- Expected type: a -> (# a, Bool #)
- Actual type: a -> (# a, a #)
- In the expression: (# True || False, #)
- In an equation for `f': f = (# True || False, #)
+
+tcfail206.hs:5:5:
+ 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:
+ 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:
+ 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:11:1
+ Expected type: a -> (a, Bool)
+ Actual type: a -> (a, a)
+ In the expression: (True || False,)
+ In an equation for `c': c = (True || False,)
+
+tcfail206.hs:14:5:
+ 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:
+ 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 `e': e = (# 1, #)
+
+tcfail206.hs:20:5:
+ 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:20:1
+ Expected type: a -> (# a, Bool #)
+ Actual type: a -> (# a, a #)
+ In the expression: (# True || False, #)
+ In an equation for `f': f = (# True || False, #)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail207.stderr b/testsuite/tests/typecheck/should_fail/tcfail207.stderr
index 307b4044d5..3e96a0994e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail207.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail207.stderr
@@ -1,7 +1,7 @@
tcfail207.hs:5:7:
Couldn't match expected type `[Int] -> [Int]'
- with actual type `[a0]'
+ with actual type `[a1]'
In the return type of a call of `take'
Probable cause: `take' is applied to too many arguments
In the expression: take x []
diff --git a/testsuite/tests/typecheck/should_run/Defer01.hs b/testsuite/tests/typecheck/should_run/Defer01.hs
new file mode 100755
index 0000000000..368db9873f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/Defer01.hs
@@ -0,0 +1,53 @@
+-- Test -fdefer-type-errors
+-- Should compile and run
+
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE GADTs #-}
+{-# OPTIONS_GHC -fdefer-type-errors #-}
+
+module Main where
+
+t5624 :: IO ()
+t5624 = putStr "Hello World" >> putStr ','
+
+a :: Int
+a = 'p'
+
+data B = B
+b :: B -> Bool
+b x = x == x
+
+data C a where
+ C1 :: C Int
+ C2 :: Bool -> C Bool
+
+c :: C Int -> Bool
+c (C2 x) = True
+
+d :: a -> a
+d = 1
+
+e = 'p'
+f = e 'q'
+
+h :: a -> (Char,Char)
+h x = (x,'c')
+
+data T a where
+ K :: a -> T a
+
+i a = seq (not (K a)) ()
+
+class MyClass a where myOp :: a -> String
+
+j = myOp 23 -- Two errors, should not combine them
+
+k :: (Int ~ Bool) => Int -> Bool
+k x = x
+
+l :: IO ()
+l = putChar >> putChar 'p'
+
+
+main :: IO ()
+main = print "No errors!"
diff --git a/testsuite/tests/typecheck/should_run/Defer01.stdout b/testsuite/tests/typecheck/should_run/Defer01.stdout
new file mode 100644
index 0000000000..19c37779d6
--- /dev/null
+++ b/testsuite/tests/typecheck/should_run/Defer01.stdout
@@ -0,0 +1 @@
+"No errors!"
diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T
index aacdc7d082..d13b317222 100644..100755
--- a/testsuite/tests/typecheck/should_run/all.T
+++ b/testsuite/tests/typecheck/should_run/all.T
@@ -11,6 +11,7 @@ test('tcrun002', only_compiler_types(['ghc']), compile_and_run, [''])
test('tcrun003', normal, compile_and_run, [''])
test('tcrun004', normal, compile_and_run, [''])
test('tcrun005', normal, compile_and_run, [''])
+test('Defer01', normal, compile_and_run, [''])
# -----------------------------------------------------------------------------
# Skip everything else if fast is on
@@ -84,4 +85,4 @@ test('T3500a', normal, compile_and_run, [''])
test('T3500b', normal, compile_and_run, [''])
test('T4809', reqlib('mtl'), compile_and_run, [''])
test('T2722', normal, compile_and_run, [''])
-test('mc17', normal, compile_and_run, [''])
+test('mc17', normal, compile_and_run, ['']) \ No newline at end of file
diff --git a/testsuite/tests/typecheck/should_run/tcrun041.hs b/testsuite/tests/typecheck/should_run/tcrun041.hs
index f78141adc7..dbdebf7687 100644
--- a/testsuite/tests/typecheck/should_run/tcrun041.hs
+++ b/testsuite/tests/typecheck/should_run/tcrun041.hs
@@ -23,7 +23,7 @@ h = (# ,1, #)
unchanged :: a -> (# Int #)
-unchanged _binding = (# #) 1
+unchanged _binding = (# 1 #)
main = do