summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-03-10 11:46:50 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-03-10 16:05:21 +0000
commit48d1866e9051e52b80c9c88547bd66d66483f1d5 (patch)
tree72047939e1bad05062f7518db97b6c999d32c948 /testsuite/tests/typecheck
parent7e96526ac2ef5987ecb03217d3d616b6281c1441 (diff)
downloadhaskell-48d1866e9051e52b80c9c88547bd66d66483f1d5.tar.gz
Improve error messages for skolems
In error messages like this • Couldn't match type ‘c’ with ‘f0 (a -> b)’ ‘c’ is a rigid type variable bound by the type signature for: f :: ((a -> b) -> b) -> forall c. c -> a we need to take case both to actually show that 'forall c', and to make sure that its name lines with the 'c' in the error message. This has been shaky for some time, and this commit puts it on solid ground. See TcRnTypes: Note [SigSkol SkolemInfo] The main changes are * SigSkol gets an extra field that records the way in which the type signature was skolemised. * The type in SigSkol is now the /un/-skolemised version * pprSkolemInfo uses the info to make the tidy type line up nicely Lots of error message wibbles!
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/should_compile/T7220a.stderr7
-rw-r--r--testsuite/tests/typecheck/should_compile/T9834.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/tc168.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/ClassOperator.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T10534.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T11947a.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T11948.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T12151.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T12918b.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T1897a.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T2714.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T3592.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T5300.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/T7279.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T7437.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T7453.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T7869.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail032.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail034.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail067.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail072.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail080.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail097.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail098.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail102.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail116.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail125.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail142.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail171.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail198.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail208.stderr2
32 files changed, 65 insertions, 63 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T7220a.stderr b/testsuite/tests/typecheck/should_compile/T7220a.stderr
index 6e25e7a8f1..a1e865f131 100644
--- a/testsuite/tests/typecheck/should_compile/T7220a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T7220a.stderr
@@ -3,13 +3,12 @@ T7220a.hs:17:6: error:
• Could not deduce (C a b)
from the context: (C a0 b, TF b ~ Y)
bound by the type signature for:
- f :: (C a0 b, TF b ~ Y) => b
+ f :: forall b. (C a0 b, TF b ~ Y) => b
at T7220a.hs:17:6-44
Possible fix:
add (C a b) to the context of
the type signature for:
- f :: (C a0 b, TF b ~ Y) => b
+ f :: forall b. (C a0 b, TF b ~ Y) => b
• In the ambiguity check for ‘f’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- f :: (forall b. (C a b, TF b ~ Y) => b) -> X
+ In the type signature: f :: (forall b. (C a b, TF b ~ Y) => b) -> X
diff --git a/testsuite/tests/typecheck/should_compile/T9834.stderr b/testsuite/tests/typecheck/should_compile/T9834.stderr
index 8fb1db79a8..303b1defe6 100644
--- a/testsuite/tests/typecheck/should_compile/T9834.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9834.stderr
@@ -30,9 +30,7 @@ T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
at T9834.hs:22:11-74
‘a1’ is a rigid type variable bound by
a type expected by the context:
- forall (q :: * -> *) a1.
- Applicative q =>
- Comp p q a1 -> Comp p q a1
+ forall (q :: * -> *). Applicative q => Nat (Comp p q) (Comp p q)
at T9834.hs:23:10-19
Expected type: Comp p q a1 -> Comp p q a1
Actual type: Comp p q a -> Comp p q a
diff --git a/testsuite/tests/typecheck/should_compile/T9939.stderr b/testsuite/tests/typecheck/should_compile/T9939.stderr
index c4866790c8..2ebc927006 100644
--- a/testsuite/tests/typecheck/should_compile/T9939.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9939.stderr
@@ -2,19 +2,19 @@
T9939.hs:6:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq a
• In the type signature for:
- f1 :: (Eq a, Ord a) => a -> a -> Bool
+ f1 :: forall a. (Eq a, Ord a) => a -> a -> Bool
T9939.hs:10:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq a
• In the type signature for:
- f2 :: (Eq a, Ord a) => a -> a -> Bool
+ f2 :: forall a. (Eq a, Ord a) => a -> a -> Bool
T9939.hs:14:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq b
• In the type signature for:
- f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
+ f3 :: forall a b. (Eq a, a ~ b, Eq b) => a -> b -> Bool
T9939.hs:21:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq a
• In the type signature for:
- f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
+ f4 :: forall a b. (Eq a, Eq b) => a -> b -> Equal a b -> Bool
diff --git a/testsuite/tests/typecheck/should_compile/tc168.stderr b/testsuite/tests/typecheck/should_compile/tc168.stderr
index 121d95f2d2..d36c58dd11 100644
--- a/testsuite/tests/typecheck/should_compile/tc168.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc168.stderr
@@ -1,12 +1,12 @@
tc168.hs:17:1: error:
- • Could not deduce (C a1 (a, b0))
- from the context: C a1 (a, b)
+ • Could not deduce (C a (a1, b0))
+ from the context: C a (a1, b)
bound by the inferred type for ‘g’:
- C a1 (a, b) => a1 -> a
+ forall a a1 b. C a (a1, b) => a -> a1
at tc168.hs:17:1-16
The type variable ‘b0’ is ambiguous
• In the ambiguity check for the inferred type for ‘g’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the inferred type
- g :: forall b a1 a2. C a2 (a1, b) => a2 -> a1
+ g :: forall a1 a2 b. C a1 (a2, b) => a1 -> a2
diff --git a/testsuite/tests/typecheck/should_fail/ClassOperator.stderr b/testsuite/tests/typecheck/should_fail/ClassOperator.stderr
index 30791286c2..890783d3c1 100644
--- a/testsuite/tests/typecheck/should_fail/ClassOperator.stderr
+++ b/testsuite/tests/typecheck/should_fail/ClassOperator.stderr
@@ -3,7 +3,7 @@ ClassOperator.hs:12:3: error:
• Could not deduce (a ><> b0)
from the context: (a ><> b)
bound by the type signature for:
- (**>) :: (a ><> b) => a -> a -> ()
+ (**>) :: forall a b. (a ><> b) => a -> a -> ()
at ClassOperator.hs:12:3-44
The type variable ‘b0’ is ambiguous
• In the ambiguity check for ‘**>’
@@ -16,7 +16,7 @@ ClassOperator.hs:12:3: error:
• Could not deduce (a ><> b0)
from the context: (a ><> b)
bound by the type signature for:
- (**<) :: (a ><> b) => a -> a -> ()
+ (**<) :: forall a b. (a ><> b) => a -> a -> ()
at ClassOperator.hs:12:3-44
The type variable ‘b0’ is ambiguous
• In the ambiguity check for ‘**<’
@@ -29,7 +29,7 @@ ClassOperator.hs:12:3: error:
• Could not deduce (a ><> b0)
from the context: (a ><> b)
bound by the type signature for:
- (>**) :: (a ><> b) => a -> a -> ()
+ (>**) :: forall a b. (a ><> b) => a -> a -> ()
at ClassOperator.hs:12:3-44
The type variable ‘b0’ is ambiguous
• In the ambiguity check for ‘>**’
@@ -42,7 +42,7 @@ ClassOperator.hs:12:3: error:
• Could not deduce (a ><> b0)
from the context: (a ><> b)
bound by the type signature for:
- (<**) :: (a ><> b) => a -> a -> ()
+ (<**) :: forall a b. (a ><> b) => a -> a -> ()
at ClassOperator.hs:12:3-44
The type variable ‘b0’ is ambiguous
• In the ambiguity check for ‘<**’
diff --git a/testsuite/tests/typecheck/should_fail/T10534.stderr b/testsuite/tests/typecheck/should_fail/T10534.stderr
index ef42727c9e..86020af877 100644
--- a/testsuite/tests/typecheck/should_fail/T10534.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10534.stderr
@@ -3,7 +3,7 @@ T10534a.hs:10:9: error:
• Could not deduce: Coercible a b arising from a use of ‘coerce’
from the context: Coercible (DF a) (DF b)
bound by the type signature for:
- silly :: Coercible (DF a) (DF b) => a -> b
+ silly :: forall a b. Coercible (DF a) (DF b) => a -> b
at T10534a.hs:9:1-42
‘a’ is a rigid type variable bound by
the type signature for:
diff --git a/testsuite/tests/typecheck/should_fail/T11947a.stderr b/testsuite/tests/typecheck/should_fail/T11947a.stderr
index 4f6a4a7505..9ca1da0ee0 100644
--- a/testsuite/tests/typecheck/should_fail/T11947a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T11947a.stderr
@@ -3,7 +3,7 @@ T11947a.hs:4:19: error:
• Could not deduce (RealFloat a0)
from the context: RealFloat a
bound by the type signature for:
- theFloatDigits :: RealFloat a => Int
+ theFloatDigits :: forall a. RealFloat a => Int
at T11947a.hs:4:19-46
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘theFloatDigits’
diff --git a/testsuite/tests/typecheck/should_fail/T11948.stderr b/testsuite/tests/typecheck/should_fail/T11948.stderr
index 4e683f898a..457ac2af4f 100644
--- a/testsuite/tests/typecheck/should_fail/T11948.stderr
+++ b/testsuite/tests/typecheck/should_fail/T11948.stderr
@@ -3,7 +3,7 @@ T11948.hs:21:18: error:
• Could not deduce (Bar (F zq) zq) arising from a use of ‘bar’
from the context: Bar (Foo (F zq)) (Foo zq)
bound by the type signature for:
- bug :: Bar (Foo (F zq)) (Foo zq) => Foo (F zq) -> Foo zq
+ bug :: forall zq. Bar (Foo (F zq)) (Foo zq) => Foo (F zq) -> Foo zq
at T11948.hs:(19,1)-(20,38)
• In the expression: bar sk :: Foo zq
In an equation for ‘x’: x = bar sk :: Foo zq
diff --git a/testsuite/tests/typecheck/should_fail/T12151.stderr b/testsuite/tests/typecheck/should_fail/T12151.stderr
index 17d484e0ea..4b233d8b64 100644
--- a/testsuite/tests/typecheck/should_fail/T12151.stderr
+++ b/testsuite/tests/typecheck/should_fail/T12151.stderr
@@ -9,7 +9,7 @@ T12151.hs:9:13: error:
• Could not deduce (Put a0)
from the context: Put a
bound by the type signature for:
- put :: Put a => t
+ put :: forall a. Put a => forall t. t
at T12151.hs:9:13-15
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘put’
diff --git a/testsuite/tests/typecheck/should_fail/T12918b.stderr b/testsuite/tests/typecheck/should_fail/T12918b.stderr
index cc62c75aac..92aa85e9f3 100644
--- a/testsuite/tests/typecheck/should_fail/T12918b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T12918b.stderr
@@ -17,7 +17,7 @@ T12918b.hs:12:11: error:
• Could not deduce (Foo1 a0)
from the context: Foo1 a
bound by the type signature for:
- bar2 :: Foo1 a => x
+ bar2 :: forall a. Foo1 a => forall x. x
at T12918b.hs:12:11-14
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘bar2’
diff --git a/testsuite/tests/typecheck/should_fail/T1897a.stderr b/testsuite/tests/typecheck/should_fail/T1897a.stderr
index e188a55598..61de72d6a6 100644
--- a/testsuite/tests/typecheck/should_fail/T1897a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1897a.stderr
@@ -3,7 +3,7 @@ T1897a.hs:9:1: error:
• Could not deduce (Wob a0 b)
from the context: Wob a b
bound by the inferred type for ‘foo’:
- Wob a b => b -> [b]
+ forall a b. Wob a b => b -> [b]
at T1897a.hs:9:1-24
The type variable ‘a0’ is ambiguous
• In the ambiguity check for the inferred type for ‘foo’
diff --git a/testsuite/tests/typecheck/should_fail/T2714.stderr b/testsuite/tests/typecheck/should_fail/T2714.stderr
index c016586cc4..9b3fc34c52 100644
--- a/testsuite/tests/typecheck/should_fail/T2714.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2714.stderr
@@ -1,10 +1,10 @@
T2714.hs:8:5: error:
- • Couldn't match type ‘a’ with ‘f0 b’
- ‘a’ is a rigid type variable bound by
+ • Couldn't match type ‘c’ with ‘f0 (a -> b)’
+ ‘c’ is a rigid type variable bound by
the type signature for:
- f :: forall a b. ((a -> b) -> b) -> forall c. c -> a
- at T2714.hs:7:1-42
+ f :: ((a -> b) -> b) -> forall c. c -> a
+ at T2714.hs:8:1-9
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/T3592.stderr b/testsuite/tests/typecheck/should_fail/T3592.stderr
index 7fe7f6d115..ab03985faa 100644
--- a/testsuite/tests/typecheck/should_fail/T3592.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3592.stderr
@@ -4,7 +4,7 @@ T3592.hs:8:5: error:
Possible fix:
add (Show a) to the context of
the type signature for:
- f :: T a -> String
+ f :: forall a. T a -> String
• In the expression: show
In an equation for ‘f’: f = show
@@ -13,6 +13,6 @@ T3592.hs:11:7: error:
Possible fix:
add (Show a) to the context of
the type signature for:
- g :: T a -> String
+ g :: forall a. T a -> String
• In the expression: show x
In an equation for ‘g’: g x = show x
diff --git a/testsuite/tests/typecheck/should_fail/T5300.stderr b/testsuite/tests/typecheck/should_fail/T5300.stderr
index 589da0a5c4..a80839455e 100644
--- a/testsuite/tests/typecheck/should_fail/T5300.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5300.stderr
@@ -3,7 +3,9 @@ T5300.hs:11:7: error:
• Could not deduce (C1 a b c0)
from the context: (Monad m, C1 a b c)
bound by the type signature for:
- f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
+ f1 :: forall (m :: * -> *) a b c.
+ (Monad m, C1 a b c) =>
+ a -> StateT (T b) m a
at T5300.hs:11:7-50
The type variable ‘c0’ is ambiguous
• In the ambiguity check for ‘f1’
@@ -15,7 +17,8 @@ T5300.hs:14:7: error:
• Could not deduce (C1 a1 b1 c10)
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) =>
+ f2 :: forall (m :: * -> *) a1 b1 c1 a2 b2 c2.
+ (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
at T5300.hs:14:7-69
The type variable ‘c10’ is ambiguous
diff --git a/testsuite/tests/typecheck/should_fail/T7279.stderr b/testsuite/tests/typecheck/should_fail/T7279.stderr
index 1825bca574..eed8878170 100644
--- a/testsuite/tests/typecheck/should_fail/T7279.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7279.stderr
@@ -3,7 +3,7 @@ T7279.hs:6:10: error:
• Could not deduce (Show b0)
from the context: (Eq a, Show b)
bound by an instance declaration:
- (Eq a, Show b) => Eq (T a)
+ forall a b. (Eq a, Show b) => Eq (T a)
at T7279.hs:6:10-35
The type variable ‘b0’ is ambiguous
• In the ambiguity check for an instance declaration
diff --git a/testsuite/tests/typecheck/should_fail/T7437.stderr b/testsuite/tests/typecheck/should_fail/T7437.stderr
index d305cee426..d6663df40e 100644
--- a/testsuite/tests/typecheck/should_fail/T7437.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7437.stderr
@@ -11,7 +11,9 @@ T7437.hs:14:13: error:
• Could not deduce (Put a0)
from the context: (Put a, Generic t, GPut (Rep t))
bound by the type signature for:
- put :: (Put a, Generic t, GPut (Rep t)) => t -> [()]
+ put :: forall a.
+ Put a =>
+ forall t. (Generic t, GPut (Rep t)) => t -> [()]
at T7437.hs:14:13-15
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘put’
diff --git a/testsuite/tests/typecheck/should_fail/T7453.stderr b/testsuite/tests/typecheck/should_fail/T7453.stderr
index 9157e116f5..518d6fad05 100644
--- a/testsuite/tests/typecheck/should_fail/T7453.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7453.stderr
@@ -4,7 +4,7 @@ T7453.hs:9:15: error:
because type variable ‘t’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- z :: Id t
+ z :: forall t. Id t
at T7453.hs:8:11-19
Expected type: Id t
Actual type: Id p
@@ -32,7 +32,7 @@ T7453.hs:15:15: error:
because type variable ‘t1’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- z :: () -> t1
+ z :: forall t1. () -> t1
at T7453.hs:14:11-22
Expected type: () -> t1
Actual type: () -> p
@@ -60,7 +60,7 @@ T7453.hs:21:15: error:
because type variable ‘t1’ would escape its scope
This (rigid, skolem) type variable is bound by
the type signature for:
- z :: t1
+ z :: forall t1. t1
at T7453.hs:20:11-16
• In the expression: v
In an equation for ‘z’:
diff --git a/testsuite/tests/typecheck/should_fail/T7869.stderr b/testsuite/tests/typecheck/should_fail/T7869.stderr
index 00ea8e7438..4cf1cfaf67 100644
--- a/testsuite/tests/typecheck/should_fail/T7869.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7869.stderr
@@ -4,7 +4,7 @@ T7869.hs:3:12: error:
because type variable ‘b1’ would escape its scope
This (rigid, skolem) type variable is bound by
an expression type signature:
- [a1] -> b1
+ forall a1 b1. [a1] -> b1
at T7869.hs:3:20-27
Expected type: [a1] -> b1
Actual type: [a] -> b
diff --git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index d2912b2b94..14be02dc45 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ -4,7 +4,7 @@ tcfail032.hs:14:8: error:
because type variable ‘a1’ would escape its scope
This (rigid, skolem) type variable is bound by
an expression type signature:
- Eq a1 => a1 -> Int
+ forall a1. Eq a1 => a1 -> Int
at tcfail032.hs:14:13-30
• In the expression: (x :: (Eq a) => a -> Int)
In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail034.stderr b/testsuite/tests/typecheck/should_fail/tcfail034.stderr
index baf68da924..9158fd2014 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail034.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail034.stderr
@@ -3,12 +3,12 @@ tcfail034.hs:17:11: error:
• Could not deduce (Integral a) arising from a use of ‘mod’
from the context: (Num a, Eq a)
bound by the type signature for:
- test :: (Num a, Eq a) => a -> Bool
+ test :: forall a. (Num a, Eq a) => a -> Bool
at tcfail034.hs:16:1-32
Possible fix:
add (Integral a) to the context of
the type signature for:
- test :: (Num a, Eq a) => a -> Bool
+ test :: forall a. (Num a, Eq a) => a -> Bool
• In the first argument of ‘(==)’, namely ‘(x `mod` 3)’
In the expression: (x `mod` 3) == 0
In an equation for ‘test’: test x = (x `mod` 3) == 0
diff --git a/testsuite/tests/typecheck/should_fail/tcfail067.stderr b/testsuite/tests/typecheck/should_fail/tcfail067.stderr
index df7e0248c9..8ffb02faf0 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail067.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail067.stderr
@@ -7,7 +7,7 @@ tcfail067.hs:12:16: error:
Possible fix:
add (Ord a) to the context of
the type signature for:
- subRangeValue :: SubRange a -> a
+ subRangeValue :: forall a. SubRange a -> a
• In the pattern: SubRange (lower, upper) value
In an equation for ‘subRangeValue’:
subRangeValue (SubRange (lower, upper) value) = value
@@ -17,7 +17,7 @@ tcfail067.hs:15:11: error:
Possible fix:
add (Ord a) to the context of
the type signature for:
- subRange :: SubRange a -> (a, a)
+ subRange :: forall a. SubRange a -> (a, a)
• In the pattern: SubRange r value
In an equation for ‘subRange’: subRange (SubRange r value) = r
@@ -25,12 +25,12 @@ tcfail067.hs:46:12: error:
• Could not deduce (Ord a) arising from a use of ‘SubRange’
from the context: Show a
bound by the type signature for:
- showRange :: Show a => SubRange a -> String
+ showRange :: forall a. Show a => SubRange a -> String
at tcfail067.hs:45:1-43
Possible fix:
add (Ord a) to the context of
the type signature for:
- showRange :: Show a => SubRange a -> String
+ showRange :: forall a. Show a => SubRange a -> String
• In the pattern: SubRange (lower, upper) value
In an equation for ‘showRange’:
showRange (SubRange (lower, upper) value)
@@ -64,13 +64,15 @@ tcfail067.hs:74:5: error:
• Could not deduce (Ord a) arising from a use of ‘SubRange’
from the context: Num a
bound by the type signature for:
- numSubRangeBinOp :: Num a =>
+ numSubRangeBinOp :: forall a.
+ Num a =>
(a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
at tcfail067.hs:(71,1)-(72,58)
Possible fix:
add (Ord a) to the context of
the type signature for:
- numSubRangeBinOp :: Num a =>
+ numSubRangeBinOp :: forall a.
+ Num a =>
(a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
• In the expression: SubRange (result, result) result
In an equation for ‘numSubRangeBinOp’:
diff --git a/testsuite/tests/typecheck/should_fail/tcfail072.stderr b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
index 1d005be670..15c4556480 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail072.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail072.stderr
@@ -3,7 +3,7 @@ tcfail072.hs:23:13: error:
• Could not deduce (Ord p0) 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
+ g :: forall p q. (Ord p, Ord q) => AB p q -> Bool
at tcfail072.hs:22:1-38
The type variable ‘p0’ is ambiguous
These potential instances exist:
diff --git a/testsuite/tests/typecheck/should_fail/tcfail080.stderr b/testsuite/tests/typecheck/should_fail/tcfail080.stderr
index 68e120232e..2fd7240182 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail080.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail080.stderr
@@ -3,7 +3,7 @@ tcfail080.hs:27:1: error:
• Could not deduce (Collection c0 a)
from the context: Collection c a
bound by the inferred type for ‘q’:
- Collection c a => a -> Bool
+ forall (c :: * -> *) a. Collection c a => a -> Bool
at tcfail080.hs:27:1-27
The type variable ‘c0’ is ambiguous
• In the ambiguity check for the inferred type for ‘q’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail097.stderr b/testsuite/tests/typecheck/should_fail/tcfail097.stderr
index f5940edaf2..bc8d9a0cf1 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail097.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail097.stderr
@@ -3,10 +3,9 @@ tcfail097.hs:5:6: error:
• Could not deduce (Eq a0)
from the context: Eq a
bound by the type signature for:
- f :: Eq a => Int -> Int
+ f :: forall a. Eq a => Int -> Int
at tcfail097.hs:5:6-23
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘f’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- f :: Eq a => Int -> Int
+ In the type signature: f :: Eq a => Int -> Int
diff --git a/testsuite/tests/typecheck/should_fail/tcfail098.stderr b/testsuite/tests/typecheck/should_fail/tcfail098.stderr
index bc59975806..503c3e3898 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail098.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail098.stderr
@@ -3,7 +3,7 @@ tcfail098.hs:12:10: error:
• Could not deduce (Bar a0)
from the context: Bar a
bound by an instance declaration:
- Bar a => Bar Bool
+ forall a. Bar a => Bar Bool
at tcfail098.hs:12:10-26
The type variable ‘a0’ is ambiguous
• In the ambiguity check for an instance declaration
diff --git a/testsuite/tests/typecheck/should_fail/tcfail102.stderr b/testsuite/tests/typecheck/should_fail/tcfail102.stderr
index 7cf8b4fbcb..b7fd16d740 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail102.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail102.stderr
@@ -6,7 +6,7 @@ tcfail102.hs:9:15: error:
• Could not deduce (Integral (Ratio a)) arising from a use of ‘p’
from the context: Integral a
bound by the type signature for:
- f :: Integral a => P (Ratio a) -> P (Ratio a)
+ f :: forall a. Integral a => P (Ratio a) -> P (Ratio a)
at tcfail102.hs:8:1-45
• In the ‘p’ field of a record
In the expression: x {p = p x}
diff --git a/testsuite/tests/typecheck/should_fail/tcfail116.stderr b/testsuite/tests/typecheck/should_fail/tcfail116.stderr
index 48976d17ae..952512686e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail116.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail116.stderr
@@ -3,7 +3,7 @@ tcfail116.hs:6:5: error:
• Could not deduce (Foo a0)
from the context: Foo a
bound by the type signature for:
- bug :: Foo a => ()
+ bug :: forall a. Foo a => ()
at tcfail116.hs:6:5-13
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘bug’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail125.stderr b/testsuite/tests/typecheck/should_fail/tcfail125.stderr
index 7946e88932..7fe5275d8f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail125.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail125.stderr
@@ -7,6 +7,6 @@ tcfail125.hs:11:4: error:
Possible fix:
add (Show a) to the context of
the type signature for:
- f :: Obs a -> String
+ f :: forall a. Obs a -> String
• In the pattern: LiftObs _ _
In an equation for ‘f’: f (LiftObs _ _) = "yes"
diff --git a/testsuite/tests/typecheck/should_fail/tcfail142.stderr b/testsuite/tests/typecheck/should_fail/tcfail142.stderr
index 3f52ef5f80..ac36ffb5e0 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail142.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail142.stderr
@@ -3,10 +3,9 @@ tcfail142.hs:18:8: error:
• Could not deduce (Bar a0 r)
from the context: Bar a r
bound by the type signature for:
- bar :: Bar a r => r -> ()
+ bar :: forall a r. Bar a r => r -> ()
at tcfail142.hs:18:8-25
The type variable ‘a0’ is ambiguous
• In the ambiguity check for ‘bar’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- In the type signature:
- bar :: Bar a r => r -> ()
+ In the type signature: bar :: Bar a r => r -> ()
diff --git a/testsuite/tests/typecheck/should_fail/tcfail171.stderr b/testsuite/tests/typecheck/should_fail/tcfail171.stderr
index 076a3394d4..e5e90903bb 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail171.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail171.stderr
@@ -4,6 +4,6 @@ tcfail171.hs:9:10: error:
Possible fix:
add (PrintfArg a) to the context of
the type signature for:
- phex :: a -> b
+ phex :: forall a b. a -> b
• 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/tcfail198.stderr b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
index 373c570863..e8c3852b1c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail198.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
@@ -4,7 +4,7 @@ tcfail198.hs:6:36: error:
because type variable ‘a1’ would escape its scope
This (rigid, skolem) type variable is bound by
an expression type signature:
- a1
+ forall a1. a1
at tcfail198.hs:6:41
• In the expression: x :: a
In the second argument of ‘(++)’, namely ‘[x :: a]’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail208.stderr b/testsuite/tests/typecheck/should_fail/tcfail208.stderr
index 45642a7548..d8b48cf2eb 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail208.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail208.stderr
@@ -3,7 +3,7 @@ tcfail208.hs:4:10: error:
• Could not deduce (Eq (m a)) arising from a use of ‘==’
from the context: (Monad m, Eq a)
bound by the type signature for:
- f :: (Monad m, Eq a) => a -> m a -> Bool
+ f :: forall (m :: * -> *) a. (Monad m, Eq a) => a -> m a -> Bool
at tcfail208.hs:3:1-40
• In the expression: (return x == y)
In an equation for ‘f’: f x y = (return x == y)