diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-07-10 16:25:27 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-07-10 16:25:27 +0100 |
commit | c0b66697cafb42390d5eebb1d3d63a2e3fc0110c (patch) | |
tree | cbaf29cd63ed5cebb9bbe3473958a635a8486c16 /testsuite/tests/typecheck/should_fail | |
parent | 488f34cf98f8d147ca4f9292925f0337d2ee2332 (diff) | |
download | haskell-c0b66697cafb42390d5eebb1d3d63a2e3fc0110c.tar.gz |
Accept error wibbles
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
14 files changed, 111 insertions, 301 deletions
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 404d868333..1884c234e0 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -234,6 +234,7 @@ test('tcfail207', normal, compile_fail, ['']) test('T5084', normal, compile_fail, ['']) test('tcfail208', normal, compile_fail, ['']) test('tcfail209', normal, compile_fail, ['']) +test('tcfail209a', normal, compile_fail, ['']) test('tcfail210', normal, compile_fail, ['']) test('tcfail211', normal, compile_fail, ['']) test('tcfail212', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/fd-loop.stderr b/testsuite/tests/typecheck/should_fail/fd-loop.stderr index 9f93b6d9bc..3158a10077 100644 --- a/testsuite/tests/typecheck/should_fail/fd-loop.stderr +++ b/testsuite/tests/typecheck/should_fail/fd-loop.stderr @@ -1,12 +1,12 @@ - -fd-loop.hs:12:10: - Variable occurs more often in a constraint than in the instance head - in the constraint: C a b - (Use -XUndecidableInstances to permit this) - In the instance declaration for `Eq (T a)' - -fd-loop.hs:12:10: - Variable occurs more often in a constraint than in the instance head - in the constraint: Eq b - (Use -XUndecidableInstances to permit this) - In the instance declaration for `Eq (T a)' +
+fd-loop.hs:12:10:
+ Variable `b' occurs more often than in the instance head
+ in the constraint: C a b
+ (Use -XUndecidableInstances to permit this)
+ In the instance declaration for `Eq (T a)'
+
+fd-loop.hs:12:10:
+ Variable `b' occurs more often than in the instance head
+ in the constraint: Eq b
+ (Use -XUndecidableInstances to permit this)
+ In the instance declaration for `Eq (T a)'
diff --git a/testsuite/tests/typecheck/should_fail/mc22.stderr b/testsuite/tests/typecheck/should_fail/mc22.stderr index d14684a3d6..6a3474c64f 100644 --- a/testsuite/tests/typecheck/should_fail/mc22.stderr +++ b/testsuite/tests/typecheck/should_fail/mc22.stderr @@ -1,38 +1,10 @@ - -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) - Note: there is a potential instance available: - instance Integral a => Num (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - 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) - Note: there are several potential instances: - instance Functor ((,) a) -- Defined in `GHC.Base' - instance Functor ((->) r) -- Defined in `GHC.Base' - instance Functor IO -- Defined in `GHC.Base' - ...plus one other - 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 +
+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 980d55c78a..632bac92c8 100644 --- a/testsuite/tests/typecheck/should_fail/mc23.stderr +++ b/testsuite/tests/typecheck/should_fail/mc23.stderr @@ -1,51 +1,9 @@ - -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) - Note: there are several potential instances: - instance Enum Double -- Defined in `GHC.Float' - instance Enum Float -- Defined in `GHC.Float' - instance Integral a => Enum (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus 7 others - 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) - Note: there are several potential instances: - instance Num Double -- Defined in `GHC.Float' - instance Num Float -- Defined in `GHC.Float' - instance Integral a => Num (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus three others - 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) - Note: there are several potential instances: - instance Monad ((->) r) -- Defined in `GHC.Base' - instance Monad IO -- Defined in `GHC.Base' - instance Monad [] -- Defined in `GHC.Base' - 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 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 +
+mc23.hs:9:29:
+ 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 8e1e3824b1..a2b11e2465 100644 --- a/testsuite/tests/typecheck/should_fail/mc24.stderr +++ b/testsuite/tests/typecheck/should_fail/mc24.stderr @@ -1,54 +1,9 @@ - -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) - Note: there are several potential instances: - instance Enum Double -- Defined in `GHC.Float' - instance Enum Float -- Defined in `GHC.Float' - instance Integral a => Enum (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus 7 others - 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) - Note: there are several potential instances: - instance Num Double -- Defined in `GHC.Float' - instance Num Float -- Defined in `GHC.Float' - instance Integral a => Num (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus three others - 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) - Note: there are several potential instances: - instance Monad ((->) r) -- Defined in `GHC.Base' - instance Monad IO -- Defined in `GHC.Base' - instance Monad [] -- Defined in `GHC.Base' - 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 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 +
+mc24.hs:10:31:
+ 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 53ebd6d9c8..643f35278d 100644 --- a/testsuite/tests/typecheck/should_fail/mc25.stderr +++ b/testsuite/tests/typecheck/should_fail/mc25.stderr @@ -1,50 +1,8 @@ - -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) - Note: there are several potential instances: - instance Enum Double -- Defined in `GHC.Float' - instance Enum Float -- Defined in `GHC.Float' - instance Integral a => Enum (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus 7 others - 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) - Note: there are several potential instances: - instance Num Double -- Defined in `GHC.Float' - instance Num Float -- Defined in `GHC.Float' - instance Integral a => Num (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus three others - 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) - Note: there are several potential instances: - instance Functor ((,) a) -- Defined in `GHC.Base' - instance Functor ((->) r) -- Defined in `GHC.Base' - instance Functor IO -- Defined in `GHC.Base' - ...plus one other - 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 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] +
+mc25.hs:9:46:
+ 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/tcfail154.stderr b/testsuite/tests/typecheck/should_fail/tcfail154.stderr index f8f3d69a4c..ca8a2978f1 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail154.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail154.stderr @@ -1,6 +1,6 @@ - -tcfail154.hs:12:10: - Variable occurs more often in a constraint than in the instance head - in the constraint: C a a - (Use -XUndecidableInstances to permit this) - In the instance declaration for `Eq (T a)' +
+tcfail154.hs:12:10:
+ Variable `a' occurs more often than in the instance head
+ in the constraint: C a a
+ (Use -XUndecidableInstances to permit this)
+ In the instance declaration for `Eq (T a)'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail157.stderr b/testsuite/tests/typecheck/should_fail/tcfail157.stderr index c68f957652..304b76511a 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail157.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail157.stderr @@ -1,12 +1,12 @@ - -tcfail157.hs:27:10: - Variable occurs more often in a constraint than in the instance head - in the constraint: E m a b - (Use -XUndecidableInstances to permit this) - In the instance declaration for `Foo m (a -> ())' - -tcfail157.hs:27:10: - Variable occurs more often in a constraint than in the instance head - in the constraint: Foo m b - (Use -XUndecidableInstances to permit this) - In the instance declaration for `Foo m (a -> ())' +
+tcfail157.hs:27:10:
+ Variable `b' occurs more often than in the instance head
+ in the constraint: E m a b
+ (Use -XUndecidableInstances to permit this)
+ In the instance declaration for `Foo m (a -> ())'
+
+tcfail157.hs:27:10:
+ Variable `b' occurs more often than in the instance head
+ in the constraint: Foo m b
+ (Use -XUndecidableInstances to permit this)
+ In the instance declaration for `Foo m (a -> ())'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr index 0e00427aa5..8110f2e309 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr @@ -1,13 +1,16 @@ - -tcfail181.hs:17:9: - 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) - Note: there are several potential instances: - instance Monad ((->) r) -- Defined in `GHC.Base' - instance Monad IO -- Defined in `GHC.Base' - instance Monad [] -- Defined in `GHC.Base' - In the expression: foo - In the expression: foo {bar = return True} - In an equation for `wog': wog x = foo {bar = return True} +
+tcfail181.hs:17:9:
+ Could not deduce (Monad m0) arising from a use of `foo'
+ from the context (Monad m)
+ bound by the inferred type of
+ wog :: Monad m => t -> Something (m Bool) e
+ at tcfail181.hs:17:1-30
+ The type variable `m0' is ambiguous
+ Possible fix: add a type signature that fixes these type variable(s)
+ Note: there are several potential instances:
+ instance Monad ((->) r) -- Defined in `GHC.Base'
+ instance Monad IO -- Defined in `GHC.Base'
+ instance Monad [] -- Defined in `GHC.Base'
+ 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/tcfail194.stderr b/testsuite/tests/typecheck/should_fail/tcfail194.stderr index 0e7a63713d..620fa75b52 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail194.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail194.stderr @@ -1,38 +1,9 @@ - -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) - Note: there are several potential instances: - instance Enum Double -- Defined in `GHC.Float' - instance Enum Float -- Defined in `GHC.Float' - instance Integral a => Enum (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus 7 others - 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) - Note: there are several potential instances: - instance Num Double -- Defined in `GHC.Float' - instance Num Float -- Defined in `GHC.Float' - instance Integral a => Num (GHC.Real.Ratio a) - -- Defined in `GHC.Real' - ...plus three others - 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 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 +
+tcfail194.hs:9:29:
+ 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/tcfail209.hs b/testsuite/tests/typecheck/should_fail/tcfail209.hs index 4b83a4441a..f4f0922231 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail209.hs +++ b/testsuite/tests/typecheck/should_fail/tcfail209.hs @@ -5,5 +5,3 @@ type Showish = Show f :: (Showish a) => a -> a f = undefined -g :: ((Show a, Num a), Eq a) => a -> a -g = undefined diff --git a/testsuite/tests/typecheck/should_fail/tcfail209.stderr b/testsuite/tests/typecheck/should_fail/tcfail209.stderr index b5329ff6dc..d0a59e9701 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail209.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail209.stderr @@ -1,11 +1,5 @@ - -tcfail209.hs:5:6: - Illegal irreducible constraint Showish a - (Use -XConstraintKinds to permit this) - In the type signature for `f': f :: Showish a => a -> a - -tcfail209.hs:8:6: - Illegal tuple constraint (Show a, Num a) - (Use -XConstraintKinds to permit this) - In the type signature for `g': - g :: ((Show a, Num a), Eq a) => a -> a +
+tcfail209.hs:3:1:
+ Illegal constraint synonym of kind: `* -> Constraint'
+ (Use -XConstraintKinds to permit this)
+ In the type declaration for `Showish'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail213.stderr b/testsuite/tests/typecheck/should_fail/tcfail213.stderr index a999e21666..9208711389 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail213.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail213.stderr @@ -1,7 +1,7 @@ - -tcfail213.hs:8:1: - Illegal irreducible constraint F a - in superclass/instance head context (Use -XUndecidableInstances to permit this) - In the context: (F a) - While checking the super-classes of class `C' - In the class declaration for `C' +
+tcfail213.hs:8:1:
+ Illegal constraint `F a' in a superclass/instance context
+ (Use -XUndecidableInstances to permit this)
+ In the context: (F a)
+ While checking the super-classes of class `C'
+ In the class declaration for `C'
diff --git a/testsuite/tests/typecheck/should_fail/tcfail214.stderr b/testsuite/tests/typecheck/should_fail/tcfail214.stderr index c924e50a19..d8df299f56 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail214.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail214.stderr @@ -1,7 +1,7 @@ - -tcfail214.hs:9:10: - Illegal irreducible constraint F a - in superclass/instance head context (Use -XUndecidableInstances to permit this) - In the context: (F a) - While checking an instance declaration - In the instance declaration for `C [a]' +
+tcfail214.hs:9:10:
+ Illegal constraint `F a' in a superclass/instance context
+ (Use -XUndecidableInstances to permit this)
+ In the context: (F a)
+ While checking an instance declaration
+ In the instance declaration for `C [a]'
|