summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2015-12-24 14:33:19 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2015-12-24 14:37:39 -0500
commit2db18b8135335da2da9918b722699df684097be9 (patch)
tree660dd90916aa6568694bbe39cdab83c7af98c5d7 /testsuite/tests/typecheck/should_fail
parent48db13d279d592ed3044cbaf3513854bcb0d3dce (diff)
downloadhaskell-2db18b8135335da2da9918b722699df684097be9.tar.gz
Visible type application
This re-working of the typechecker algorithm is based on the paper "Visible type application", by Richard Eisenberg, Stephanie Weirich, and Hamidhasan Ahmed, to be published at ESOP'16. This patch introduces -XTypeApplications, which allows users to say, for example `id @Int`, which has type `Int -> Int`. See the changes to the user manual for details. This patch addresses tickets #10619, #5296, #10589.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
-rw-r--r--testsuite/tests/typecheck/should_fail/CustomTypeErrors01.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/ExpandSynsFail2.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/T10495.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/T10971d.stderr25
-rw-r--r--testsuite/tests/typecheck/should_fail/T11274.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T1899.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/T2414.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/T2534.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/T2688.stderr20
-rw-r--r--testsuite/tests/typecheck/should_fail/T2846b.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T3102.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/T3613.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/T3950.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/T5095.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T5689.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/T5853.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T6069.stderr39
-rw-r--r--testsuite/tests/typecheck/should_fail/T7264.stderr21
-rw-r--r--testsuite/tests/typecheck/should_fail/T7368.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/T7453.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/T7734.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/T7851.stderr19
-rw-r--r--testsuite/tests/typecheck/should_fail/T8142.stderr43
-rw-r--r--testsuite/tests/typecheck/should_fail/T8428.stderr16
-rw-r--r--testsuite/tests/typecheck/should_fail/T8603.stderr15
-rw-r--r--testsuite/tests/typecheck/should_fail/T9109.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/T9774.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/TcStaticPointersFail01.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/VtaFail.hs57
-rw-r--r--testsuite/tests/typecheck/should_fail/VtaFail.stderr94
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T3
-rw-r--r--testsuite/tests/typecheck/should_fail/mc19.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/mc21.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/mc22.stderr51
-rw-r--r--testsuite/tests/typecheck/should_fail/mc23.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/mc24.stderr18
-rw-r--r--testsuite/tests/typecheck/should_fail/mc25.stderr30
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail001.stderr13
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail002.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail004.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail005.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail007.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail010.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail013.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail014.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail016.stderr42
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail018.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail029.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail032.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail033.stderr17
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail034.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail065.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail068.stderr47
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail076.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail099.stderr1
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail103.stderr43
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail104.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail131.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail133.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail140.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail143.stderr14
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail153.stderr35
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail165.hs3
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail165.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail168.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.hs2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail174.stderr65
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail175.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail178.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail179.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail181.stderr29
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail185.stderr26
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail189.stderr16
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail191.stderr24
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail193.stderr23
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail198.stderr28
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail201.stderr11
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail204.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail206.stderr110
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail208.stderr18
81 files changed, 914 insertions, 636 deletions
diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors01.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors01.stderr
index d95de09530..18c45a12c0 100644
--- a/testsuite/tests/typecheck/should_fail/CustomTypeErrors01.stderr
+++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors01.stderr
@@ -1,5 +1,5 @@
-CustomTypeErrors01.hs:12:11: error:
- Values of type 'MyType' cannot be compared for equality.
- In the expression: x == MyType
- In an equation for ‘err’: err x = x == MyType
+CustomTypeErrors01.hs:12:9: error:
+ • Values of type 'MyType' cannot be compared for equality.
+ • In the expression: x == MyType
+ In an equation for ‘err’: err x = x == MyType
diff --git a/testsuite/tests/typecheck/should_fail/ExpandSynsFail2.stderr b/testsuite/tests/typecheck/should_fail/ExpandSynsFail2.stderr
index 6ded98e0bd..49e262cd3c 100644
--- a/testsuite/tests/typecheck/should_fail/ExpandSynsFail2.stderr
+++ b/testsuite/tests/typecheck/should_fail/ExpandSynsFail2.stderr
@@ -1,9 +1,12 @@
+
ExpandSynsFail2.hs:19:37: error:
- Couldn't match type ‘Int’ with ‘Bool’
- Expected type: ST s Foo
- Actual type: MyBarST s
- Type synonyms expanded:
- Expected type: ST s Int
- Actual type: ST s Bool
- In the first argument of ‘runST’, namely ‘barGen’
- In the second argument of ‘(==)’, namely ‘runST barGen’
+ • Couldn't match type ‘Int’ with ‘Bool’
+ Expected type: ST s Foo
+ Actual type: MyBarST s
+ Type synonyms expanded:
+ Expected type: ST s Int
+ Actual type: ST s Bool
+ • In the first argument of ‘runST’, namely ‘barGen’
+ In the second argument of ‘(==)’, namely ‘runST barGen’
+ In the first argument of ‘print’, namely
+ ‘(runST fooGen == runST barGen)’
diff --git a/testsuite/tests/typecheck/should_fail/T10495.stderr b/testsuite/tests/typecheck/should_fail/T10495.stderr
index ee2060017e..e09e60af23 100644
--- a/testsuite/tests/typecheck/should_fail/T10495.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10495.stderr
@@ -1,7 +1,8 @@
-T10495.hs:5:7: error:
- Couldn't match representation of type ‘a0’ with that of ‘b0’
- arising from a use of ‘coerce’
- In the expression: coerce
- In an equation for ‘foo’: foo = coerce
- Relevant bindings include foo :: a0 -> b0 (bound at T10495.hs:5:1)
+T10495.hs:5:1: error:
+ • Couldn't match representation of type ‘a0’ with that of ‘b0’
+ arising from a use of ‘coerce’
+ • When instantiating ‘foo’, initially inferred to have
+ this overly-general type:
+ forall a b. Coercible a b => a -> b
+ NB: This instantiation can be caused by the monomorphism restriction.
diff --git a/testsuite/tests/typecheck/should_fail/T10971d.stderr b/testsuite/tests/typecheck/should_fail/T10971d.stderr
index 244fff7098..c5ad886683 100644
--- a/testsuite/tests/typecheck/should_fail/T10971d.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10971d.stderr
@@ -1,17 +1,20 @@
T10971d.hs:4:14: error:
- Couldn't match expected type ‘[a0]’
- with actual type ‘Maybe Integer’
- In the first argument of ‘f’, namely ‘(Just 1)’
- In the second argument of ‘($)’, namely ‘f (Just 1)’
+ • Couldn't match expected type ‘[a0]’
+ with actual type ‘Maybe Integer’
+ • In the first argument of ‘f’, namely ‘(Just 1)’
+ In the second argument of ‘($)’, namely ‘f (Just 1)’
+ In a stmt of a 'do' block: print $ f (Just 1)
T10971d.hs:5:19: error:
- Couldn't match expected type ‘[Integer]’
- with actual type ‘Maybe Integer’
- In the second argument of ‘g’, namely ‘(Just 5)’
- In the second argument of ‘($)’, namely ‘g (+ 1) (Just 5)’
+ • Couldn't match expected type ‘[Integer]’
+ with actual type ‘Maybe Integer’
+ • In the second argument of ‘g’, namely ‘(Just 5)’
+ In the second argument of ‘($)’, namely ‘g (+ 1) (Just 5)’
+ In a stmt of a 'do' block: print $ g (+ 1) (Just 5)
T10971d.hs:6:23: error:
- Couldn't match expected type ‘[b0]’ with actual type ‘Maybe a1’
- In the second argument of ‘h’, namely ‘Nothing’
- In the second argument of ‘($)’, namely ‘h (const 5) Nothing’
+ • Couldn't match expected type ‘[b0]’ with actual type ‘Maybe a1’
+ • In the second argument of ‘h’, namely ‘Nothing’
+ In the second argument of ‘($)’, namely ‘h (const 5) Nothing’
+ In a stmt of a 'do' block: print $ h (const 5) Nothing
diff --git a/testsuite/tests/typecheck/should_fail/T11274.stderr b/testsuite/tests/typecheck/should_fail/T11274.stderr
index f73131704a..b6f1964c14 100644
--- a/testsuite/tests/typecheck/should_fail/T11274.stderr
+++ b/testsuite/tests/typecheck/should_fail/T11274.stderr
@@ -1,5 +1,5 @@
-T11274.hs:10:25: error:
+T11274.hs:10:23: error:
• No instance for (Eq Asd) arising from a use of ‘==’
• In the expression: x == y
In an equation for ‘missingInstance’: missingInstance x y = x == y
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr
index 8c2964cfc6..c4db8fe1e7 100644
--- a/testsuite/tests/typecheck/should_fail/T1899.stderr
+++ b/testsuite/tests/typecheck/should_fail/T1899.stderr
@@ -9,6 +9,7 @@ T1899.hs:14:36: error:
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)
• Relevant bindings include
varSet :: [a] (bound at T1899.hs:10:11)
transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2)
diff --git a/testsuite/tests/typecheck/should_fail/T2414.stderr b/testsuite/tests/typecheck/should_fail/T2414.stderr
index 0f797da713..bbbf5fce6a 100644
--- a/testsuite/tests/typecheck/should_fail/T2414.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2414.stderr
@@ -1,7 +1,8 @@
-T2414.hs:9:13:
- Occurs check: cannot construct the infinite type: b0 ~ (Bool, b0)
- Expected type: b0 -> Maybe (Bool, b0)
- Actual type: (Bool, b0) -> Maybe (Bool, b0)
- In the first argument of ‘unfoldr’, namely ‘Just’
- In the expression: unfoldr Just
+T2414.hs:9:13: error:
+ • Occurs check: cannot construct the infinite type: b0 ~ (Bool, b0)
+ Expected type: b0 -> Maybe (Bool, b0)
+ Actual type: (Bool, b0) -> Maybe (Bool, 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/T2534.stderr b/testsuite/tests/typecheck/should_fail/T2534.stderr
index fe6abae7b8..4e469f3cfd 100644
--- a/testsuite/tests/typecheck/should_fail/T2534.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2534.stderr
@@ -1,8 +1,9 @@
-T2534.hs:3:13:
- Couldn't match type ‘[b]’ with ‘a0 -> [b]’
- Expected type: [a0] -> [b] -> [b]
- Actual type: [a0] -> (a0 -> [b]) -> [b]
- In the first argument of ‘foldr’, namely ‘(>>=)’
- In the expression: foldr (>>=) [] []
- Relevant bindings include foo :: [b] (bound at T2534.hs:3:1)
+T2534.hs:3:13: error:
+ • Couldn't match type ‘[b]’ with ‘a0 -> [b]’
+ Expected type: [a0] -> [b] -> [b]
+ Actual type: [a0] -> (a0 -> [b]) -> [b]
+ • In the first argument of ‘foldr’, namely ‘(>>=)’
+ In the expression: foldr (>>=) [] []
+ In an equation for ‘foo’: foo = foldr (>>=) [] []
+ • Relevant bindings include foo :: [b] (bound at T2534.hs:3:1)
diff --git a/testsuite/tests/typecheck/should_fail/T2688.stderr b/testsuite/tests/typecheck/should_fail/T2688.stderr
index 1915c41812..2b2ca0d22a 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:
- Couldn't match expected type ‘v’ with actual type ‘s’
+T2688.hs:8:14: error:
+ • Couldn't match expected type ‘v’ with actual type ‘s’
‘s’ is a rigid type variable bound by
- the class declaration for ‘VectorSpace’ at T2688.hs:5:21
+ 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)’
- Relevant bindings include
- s :: s (bound at T2688.hs:8:10)
- v :: v (bound at T2688.hs:8:5)
- (^/) :: v -> s -> v (bound at T2688.hs:8:5)
+ the class declaration for ‘VectorSpace’ at T2688.hs:5:19
+ • In the expression: v *^ (1 / s)
+ In an equation for ‘^/’: v ^/ s = v *^ (1 / s)
+ • Relevant bindings include
+ s :: s (bound at T2688.hs:8:10)
+ v :: v (bound at T2688.hs:8:5)
+ (^/) :: v -> s -> v (bound at T2688.hs:8:5)
diff --git a/testsuite/tests/typecheck/should_fail/T2846b.stderr b/testsuite/tests/typecheck/should_fail/T2846b.stderr
index 0323283477..371d0ce5ca 100644
--- a/testsuite/tests/typecheck/should_fail/T2846b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T2846b.stderr
@@ -1,6 +1,6 @@
T2846b.hs:5:5: error:
- No instance for (Show (Num a0 => a0)) arising from a use of ‘show’
- (maybe you haven't applied a function to enough arguments?)
- In the expression: show ([1, 2, 3] :: [Num a => a])
- In an equation for ‘f’: f = show ([1, 2, 3] :: [Num a => a])
+ • No instance for (Show (forall a. [Num a => a]))
+ arising from a use of ‘show’
+ • 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 925e80f7fc..a5a410efeb 100644
--- a/testsuite/tests/typecheck/should_fail/T3102.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3102.stderr
@@ -1,11 +1,12 @@
-
-T3102.hs:11:12: error:
- Couldn't match type ‘a’ with ‘(?p::Int) => a0’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. a -> String
- at T3102.hs:11:10
- Expected type: a -> String
- Actual type: ((?p::Int) => a0) -> String
- In the first argument of ‘f’, namely ‘t’
- In the expression: f t
+
+T3102.hs:11:12: error:
+ • Couldn't match type ‘a’ with ‘(?p::Int) => a0’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. a -> String
+ at T3102.hs:11:10
+ Expected type: a -> String
+ Actual type: ((?p::Int) => a0) -> String
+ • In the first argument of ‘f’, namely ‘t’
+ In the expression: f t
+ 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 f7fa6d4871..b7ffd671c8 100644
--- a/testsuite/tests/typecheck/should_fail/T3613.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3613.stderr
@@ -1,14 +1,20 @@
-T3613.hs:14:20:
- 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)’
+T3613.hs:14:20: error:
+ • Couldn't match type ‘IO’ with ‘Maybe’
+ Expected type: Maybe b
+ Actual type: IO b
+ • In the first argument of ‘fooThen’, namely ‘(bar >> undefined)’
+ In the expression: fooThen (bar >> undefined)
+ In the expression:
+ let fooThen m = foo >> m in fooThen (bar >> undefined)
-T3613.hs:17:24:
- Couldn't match expected type ‘Maybe a0’ with actual type ‘IO ()’
- In a stmt of a 'do' block: bar
- In the first argument of ‘fooThen’, namely
- ‘(do { bar;
- undefined })’
+T3613.hs:17:24: error:
+ • Couldn't match expected type ‘Maybe a0’ with actual type ‘IO ()’
+ • In a stmt of a 'do' block: bar
+ In the first argument of ‘fooThen’, namely
+ ‘(do { bar;
+ undefined })’
+ In the expression:
+ fooThen
+ (do { bar;
+ undefined })
diff --git a/testsuite/tests/typecheck/should_fail/T3950.stderr b/testsuite/tests/typecheck/should_fail/T3950.stderr
index fab70fd01b..ae50a74f3c 100644
--- a/testsuite/tests/typecheck/should_fail/T3950.stderr
+++ b/testsuite/tests/typecheck/should_fail/T3950.stderr
@@ -1,12 +1,17 @@
-T3950.hs:15:13: error:
+T3950.hs:15:8: error:
• Couldn't match kind ‘* -> *’ with ‘*’
When matching types
w :: (* -> * -> *) -> *
Sealed :: (* -> *) -> *
- Expected type: w (Id p)
- Actual type: Sealed (Id p x0)
- • In the first argument of ‘Just’, namely ‘rp'’
- In the expression: Just rp'
+ Expected type: Maybe (w (Id p))
+ Actual type: Maybe (Sealed (Id p x0))
+ • In the expression: Just rp'
+ In an equation for ‘rp’:
+ rp _
+ = Just rp'
+ where
+ rp' :: Sealed (Id p x)
+ rp' = undefined
• Relevant bindings include
rp :: Bool -> Maybe (w (Id p)) (bound at T3950.hs:15:1)
diff --git a/testsuite/tests/typecheck/should_fail/T5095.stderr b/testsuite/tests/typecheck/should_fail/T5095.stderr
index cc338e7afa..c284cda9d0 100644
--- a/testsuite/tests/typecheck/should_fail/T5095.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5095.stderr
@@ -1,5 +1,5 @@
-T5095.hs:9:11: error:
+T5095.hs:9:9: error:
• Overlapping instances for Eq a arising from a use of ‘==’
Matching instances:
instance [overlappable] Show a => Eq a -- Defined at T5095.hs:5:31
diff --git a/testsuite/tests/typecheck/should_fail/T5689.stderr b/testsuite/tests/typecheck/should_fail/T5689.stderr
index 6e3777d2ee..2c7eaa87d4 100644
--- a/testsuite/tests/typecheck/should_fail/T5689.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5689.stderr
@@ -1,8 +1,10 @@
T5689.hs:10:36: error:
- Couldn't match expected type ‘Bool’ with actual type ‘t’
- In the expression: v
- In the expression: if v then False else True
- Relevant bindings include
- v :: t (bound at T5689.hs:10:28)
- r :: IORef (t -> t) (bound at T5689.hs:7:14)
+ • Couldn't match expected type ‘Bool’ with actual type ‘t’
+ • 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)’
+ • Relevant bindings include
+ v :: t (bound at T5689.hs:10:28)
+ r :: IORef (t -> t) (bound at T5689.hs:7:14)
diff --git a/testsuite/tests/typecheck/should_fail/T5853.stderr b/testsuite/tests/typecheck/should_fail/T5853.stderr
index 33ae4e16ce..ab2ad30d6c 100644
--- a/testsuite/tests/typecheck/should_fail/T5853.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5853.stderr
@@ -1,5 +1,5 @@
-T5853.hs:15:52: error:
+T5853.hs:15:46: error:
• Could not deduce: Subst t2 (Elem t1) ~ t1
arising from a use of ‘<$>’
from the context: (F t,
diff --git a/testsuite/tests/typecheck/should_fail/T6069.stderr b/testsuite/tests/typecheck/should_fail/T6069.stderr
index eff2e8b5cf..e1c2e5653f 100644
--- a/testsuite/tests/typecheck/should_fail/T6069.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6069.stderr
@@ -1,21 +1,24 @@
-T6069.hs:13:15:
- Couldn't match type ‘ST s0 Int’ with ‘forall s. ST s a0’
- Expected type: ST s0 Int -> a0
- Actual type: (forall s. ST s a0) -> a0
- In the second argument of ‘(.)’, namely ‘runST’
- In the expression: print . runST
+T6069.hs:13:15: error:
+ • Couldn't match type ‘ST s0 Int’ with ‘forall s. ST s a0’
+ Expected type: ST s0 Int -> a0
+ Actual type: (forall s. ST s a0) -> a0
+ • In the second argument of ‘(.)’, namely ‘runST’
+ In the expression: print . runST
+ In the expression: (print . runST) fourty_two
-T6069.hs:14:15:
- Couldn't match type ‘ST s1 Int’ with ‘forall s. ST s a1’
- Expected type: ST s1 Int -> a1
- Actual type: (forall s. ST s a1) -> a1
- In the second argument of ‘(.)’, namely ‘runST’
- In the expression: (print . runST)
+T6069.hs:14:15: error:
+ • Couldn't match type ‘ST s1 Int’ with ‘forall s. ST s a1’
+ Expected type: ST s1 Int -> a1
+ Actual type: (forall s. ST s a1) -> a1
+ • In the second argument of ‘(.)’, namely ‘runST’
+ In the expression: (print . runST)
+ In the expression: (print . runST) $ fourty_two
-T6069.hs:15:16:
- Couldn't match type ‘ST s2 Int’ with ‘forall s. ST s a2’
- Expected type: ST s2 Int -> a2
- Actual type: (forall s. ST s a2) -> a2
- In the second argument of ‘(.)’, namely ‘runST’
- In the first argument of ‘($)’, namely ‘(print . runST)’
+T6069.hs:15:16: error:
+ • Couldn't match type ‘ST s2 Int’ with ‘forall s. ST s a2’
+ Expected type: ST s2 Int -> a2
+ Actual type: (forall s. ST s a2) -> a2
+ • In the second argument of ‘(.)’, namely ‘runST’
+ In the first argument of ‘($)’, namely ‘(print . runST)’
+ In the expression: (print . runST) $
diff --git a/testsuite/tests/typecheck/should_fail/T7264.stderr b/testsuite/tests/typecheck/should_fail/T7264.stderr
index 4b5b3557d9..b343d88cd1 100644
--- a/testsuite/tests/typecheck/should_fail/T7264.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7264.stderr
@@ -1,12 +1,13 @@
-T7264.hs:13:19:
- Couldn't match type ‘a’ with ‘forall r. r -> String’
+T7264.hs:13:19: error:
+ • Couldn't match type ‘a’ with ‘forall r. r -> String’
‘a’ is a rigid type variable bound by
- the inferred type of mkFoo2 :: a -> Maybe Foo at T7264.hs:13:1
- Expected type: a -> Foo
- Actual type: (forall r. r -> String) -> Foo
- In the first argument of ‘mmap’, namely ‘Foo’
- In the expression: mmap Foo (Just val)
- Relevant bindings include
- val :: a (bound at T7264.hs:13:8)
- mkFoo2 :: a -> Maybe Foo (bound at T7264.hs:13:1)
+ the inferred type of mkFoo2 :: a -> Maybe Foo at T7264.hs:13:1
+ Expected type: a -> Foo
+ Actual type: (forall r. r -> String) -> Foo
+ • In the first argument of ‘mmap’, namely ‘Foo’
+ In the expression: mmap Foo (Just val)
+ In an equation for ‘mkFoo2’: mkFoo2 val = mmap Foo (Just val)
+ • Relevant bindings include
+ val :: a (bound at T7264.hs:13:8)
+ mkFoo2 :: a -> Maybe Foo (bound at T7264.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7368.stderr b/testsuite/tests/typecheck/should_fail/T7368.stderr
index 1c538ac7f9..f187aee61c 100644
--- a/testsuite/tests/typecheck/should_fail/T7368.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7368.stderr
@@ -4,3 +4,4 @@ T7368.hs:3:10: error:
When matching the kind of ‘Maybe’
• In the first argument of ‘b’, namely ‘(l Nothing)’
In the expression: b (l Nothing)
+ In an equation for ‘f’: f = b (l Nothing)
diff --git a/testsuite/tests/typecheck/should_fail/T7453.stderr b/testsuite/tests/typecheck/should_fail/T7453.stderr
index efbc7497e5..47bfa78754 100644
--- a/testsuite/tests/typecheck/should_fail/T7453.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7453.stderr
@@ -13,6 +13,14 @@ T7453.hs:9:15: error:
z = aux
where
aux = Id v
+ In an equation for ‘cast1’:
+ cast1 v
+ = runId z
+ where
+ z :: Id t
+ z = aux
+ where
+ aux = Id v
• Relevant bindings include
aux :: Id r (bound at T7453.hs:10:21)
z :: Id t (bound at T7453.hs:9:11)
@@ -33,6 +41,14 @@ T7453.hs:15:15: error:
z = aux
where
aux = const v
+ In an equation for ‘cast2’:
+ cast2 v
+ = z ()
+ where
+ z :: () -> t
+ z = aux
+ where
+ aux = const v
• Relevant bindings include
aux :: forall b. b -> r (bound at T7453.hs:16:21)
z :: () -> t1 (bound at T7453.hs:15:11)
@@ -51,8 +67,16 @@ T7453.hs:21:15: error:
z = v
where
aux = const v
+ In an equation for ‘cast3’:
+ cast3 v
+ = z
+ where
+ z :: t
+ z = v
+ where
+ aux = const v
• Relevant bindings include
aux :: forall b. b -> r (bound at T7453.hs:22:21)
z :: t1 (bound at T7453.hs:21:11)
v :: r (bound at T7453.hs:19:7)
- cast3 :: r -> t (bound at T7453.hs:19:1)
+ cast3 :: r -> forall t. t (bound at T7453.hs:19:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7734.stderr b/testsuite/tests/typecheck/should_fail/T7734.stderr
index d4efb614df..53536d1a13 100644
--- a/testsuite/tests/typecheck/should_fail/T7734.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7734.stderr
@@ -3,6 +3,7 @@ T7734.hs:4:13: error:
• Occurs check: cannot construct the infinite type: r2 ~ r2 -> r1
• In the first argument of ‘x’, namely ‘x’
In the expression: x x
+ In an equation for ‘f’: x `f` y = x x
• Relevant bindings include
x :: r2 -> r1 (bound at T7734.hs:4:1)
f :: (r2 -> r1) -> r -> r1 (bound at T7734.hs:4:1)
@@ -11,6 +12,7 @@ T7734.hs:5:13: error:
• Occurs check: cannot construct the infinite type: r2 ~ r2 -> r1
• In the first argument of ‘x’, namely ‘x’
In the expression: x x
+ In an equation for ‘&’: (&) x y = x x
• Relevant bindings include
x :: r2 -> r1 (bound at T7734.hs:5:5)
(&) :: (r2 -> r1) -> r -> r1 (bound at T7734.hs:5:1)
diff --git a/testsuite/tests/typecheck/should_fail/T7851.stderr b/testsuite/tests/typecheck/should_fail/T7851.stderr
index 64148511e7..14efa7c7c9 100644
--- a/testsuite/tests/typecheck/should_fail/T7851.stderr
+++ b/testsuite/tests/typecheck/should_fail/T7851.stderr
@@ -1,8 +1,13 @@
-T7851.hs:5:10:
- Couldn't match expected type ‘IO a0’ with actual type ‘a1 -> IO ()’
- Probable cause: ‘print’ is applied to too few arguments
- In a stmt of a 'do' block: print
- In the expression:
- do { print;
- print "Hello" }
+T7851.hs:5:10: error:
+ • Couldn't match expected type ‘IO a0’
+ with actual type ‘a1 -> IO ()’
+ • Probable cause: ‘print’ is applied to too few arguments
+ In a stmt of a 'do' block: print
+ In the expression:
+ do { print;
+ print "Hello" }
+ In an equation for ‘bar’:
+ bar
+ = do { print;
+ print "Hello" }
diff --git a/testsuite/tests/typecheck/should_fail/T8142.stderr b/testsuite/tests/typecheck/should_fail/T8142.stderr
index 9ae86c5524..09a2a9677d 100644
--- a/testsuite/tests/typecheck/should_fail/T8142.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8142.stderr
@@ -1,25 +1,26 @@
T8142.hs:6:18: error:
- Couldn't match type ‘Nu g0’ with ‘Nu g’
- NB: ‘Nu’ is a type function, and may not be injective
- The type variable ‘g0’ is ambiguous
- Expected type: Nu ((,) t) -> Nu g
- Actual type: Nu ((,) t0) -> Nu g0
- In the ambiguity check for the inferred type for ‘h’
- To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
- When checking the inferred type
- h :: forall t (g :: * -> *). Nu ((,) t) -> Nu g
- In an equation for ‘tracer’:
- tracer
- = h
- where
- h = (\ (_, b) -> ((outI . fmap h) b)) . out
+ • Couldn't match type ‘Nu g0’ with ‘Nu g’
+ NB: ‘Nu’ is a type function, and may not be injective
+ The type variable ‘g0’ is ambiguous
+ Expected type: Nu ((,) t) -> Nu g
+ Actual type: Nu ((,) t0) -> Nu g0
+ • In the ambiguity check for the inferred type for ‘h’
+ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
+ When checking the inferred type
+ h :: forall t (g :: * -> *). Nu ((,) t) -> Nu g
+ In an equation for ‘tracer’:
+ tracer
+ = h
+ where
+ h = (\ (_, b) -> ((outI . fmap h) b)) . out
T8142.hs:6:57: error:
- Couldn't match type ‘Nu ((,) t)’ with ‘g (Nu ((,) t))’
- Expected type: Nu ((,) t) -> (t, g (Nu ((,) t)))
- Actual type: Nu ((,) t) -> (t, Nu ((,) t))
- In the second argument of ‘(.)’, namely ‘out’
- In the expression: (\ (_, b) -> ((outI . fmap h) b)) . out
- Relevant bindings include
- h :: Nu ((,) t) -> Nu g (bound at T8142.hs:6:18)
+ • Couldn't match type ‘Nu ((,) t)’ with ‘g (Nu ((,) t))’
+ Expected type: Nu ((,) t) -> (t, g (Nu ((,) t)))
+ Actual type: Nu ((,) t) -> (t, Nu ((,) t))
+ • In the second argument of ‘(.)’, namely ‘out’
+ In the expression: (\ (_, b) -> ((outI . fmap h) b)) . out
+ In an equation for ‘h’: h = (\ (_, b) -> ((outI . fmap h) b)) . out
+ • Relevant bindings include
+ h :: Nu ((,) t) -> Nu g (bound at T8142.hs:6:18)
diff --git a/testsuite/tests/typecheck/should_fail/T8428.stderr b/testsuite/tests/typecheck/should_fail/T8428.stderr
index cb4724331c..97cd9f7806 100644
--- a/testsuite/tests/typecheck/should_fail/T8428.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8428.stderr
@@ -1,10 +1,8 @@
-T8428.hs:11:19:
- Couldn't match type ‘(forall s. ST s) a’ with ‘forall s. ST s a’
- Expected type: IdentityT (forall s. ST s) a -> forall s. ST s a
- Actual type: IdentityT (forall s. ST s) a -> (forall s. ST s) a
- In the second argument of ‘(.)’, namely ‘runIdentityT’
- In the expression: runST . runIdentityT
- Relevant bindings include
- runIdST :: IdentityT (forall s. ST s) a -> a
- (bound at T8428.hs:11:1)
+T8428.hs:11:19: error:
+ • Couldn't match type ‘forall s1. ST s1’ with ‘ST s’
+ Expected type: IdentityT (forall s. ST s) a -> forall s. ST s a
+ Actual type: IdentityT (forall s. ST s) a -> (forall s. ST s) a
+ • In the second argument of ‘(.)’, namely ‘runIdentityT’
+ In the expression: runST . runIdentityT
+ In an equation for ‘runIdST’: runIdST = runST . runIdentityT
diff --git a/testsuite/tests/typecheck/should_fail/T8603.stderr b/testsuite/tests/typecheck/should_fail/T8603.stderr
index 5bfd397167..53d4e422cb 100644
--- a/testsuite/tests/typecheck/should_fail/T8603.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8603.stderr
@@ -5,22 +5,15 @@ T8603.hs:13:10: error:
• In the instance declaration for ‘Monad RV’
T8603.hs:29:17: error:
- • Couldn't match kind ‘* -> *’ with ‘*’
- When matching the kind of ‘[[a0]]’
+ • Couldn't match type ‘RV a0’ with ‘StateT s RV t0’
+ Expected type: [Integer] -> StateT s RV t0
+ Actual type: (->) ((->) [a0]) (RV a0)
• The function ‘lift’ is applied to two arguments,
- but its type ‘[] [a0] (StateT s RV t0)
- -> (->) [[a0]] (StateT s RV t0)’
+ but its type ‘([a0] -> RV a0) -> (->) ((->) [a0]) (RV a0)’
has only one
In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
In the expression:
do { prize <- lift uniform [1, 2, ....];
return False }
-
-T8603.hs:29:22: error:
- • Couldn't match type ‘RV a0’ with ‘StateT s RV t0’
- Expected type: [] [a0] (StateT s RV t0)
- Actual type: [a0] -> RV a0
- • In the first argument of ‘lift’, namely ‘uniform’
- In a stmt of a 'do' block: prize <- lift uniform [1, 2, 3]
• Relevant bindings include
testRVState1 :: RVState s Bool (bound at T8603.hs:28:1)
diff --git a/testsuite/tests/typecheck/should_fail/T9109.stderr b/testsuite/tests/typecheck/should_fail/T9109.stderr
index defd77572e..f13b0fc310 100644
--- a/testsuite/tests/typecheck/should_fail/T9109.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9109.stderr
@@ -2,14 +2,13 @@
T9109.hs:8:13: error:
• Couldn't match expected type ‘r’ with actual type ‘Bool’
‘r’ is untouchable
- inside the constraints: r1 ~ Bool
+ inside the constraints: t ~ Bool
bound by a pattern with constructor: GBool :: G Bool,
in an equation for ‘foo’
at T9109.hs:8:5-9
‘r’ is a rigid type variable bound by
- the inferred type of foo :: G r1 -> r at T9109.hs:8:1
+ the inferred type of foo :: G t -> r at T9109.hs:8:1
Possible fix: add a type signature for ‘foo’
• In the expression: True
In an equation for ‘foo’: foo GBool = True
- • Relevant bindings include
- foo :: G r1 -> r (bound at T9109.hs:8:1)
+ • Relevant bindings include foo :: G t -> r (bound at T9109.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/T9774.stderr b/testsuite/tests/typecheck/should_fail/T9774.stderr
index d75942bc59..28b1b58c4c 100644
--- a/testsuite/tests/typecheck/should_fail/T9774.stderr
+++ b/testsuite/tests/typecheck/should_fail/T9774.stderr
@@ -1,8 +1,8 @@
-T9774.hs:5:29:
- Couldn't match type ‘Char’ with ‘[Char]’
- Expected type: String
- Actual type: Char
- In the second argument of ‘assert’, namely ‘'a'’
- In the first argument of ‘putStrLn’, namely ‘(assert True 'a')’
- In the expression: putStrLn (assert True 'a')
+T9774.hs:5:17: error:
+ • Couldn't match type ‘Char’ with ‘[Char]’
+ Expected type: String
+ Actual type: Char
+ • In the first argument of ‘putStrLn’, namely ‘(assert True 'a')’
+ In the expression: putStrLn (assert True 'a')
+ In an equation for ‘foo’: foo = putStrLn (assert True 'a')
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
index 1767e8e976..32dac6a133 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
@@ -2,8 +2,7 @@
TcCoercibleFail.hs:11:8: error:
• Couldn't match representation of type ‘Int’ with that of ‘()’
arising from a use of ‘coerce’
- • In the expression: coerce
- In the expression: coerce $ one :: ()
+ • In the expression: coerce $ one :: ()
In an equation for ‘foo1’: foo1 = coerce $ one :: ()
TcCoercibleFail.hs:14:8: error:
@@ -12,8 +11,7 @@ TcCoercibleFail.hs:14:8: error:
arising from a use of ‘coerce’
NB: We cannot know what roles the parameters to ‘m’ have;
we must assume that the role is nominal
- • In the expression: coerce
- In the expression: coerce $ (return one :: m Int)
+ • In the expression: coerce $ (return one :: m Int)
In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int)
• Relevant bindings include
foo2 :: m Age (bound at TcCoercibleFail.hs:14:1)
@@ -21,8 +19,7 @@ TcCoercibleFail.hs:14:8: error:
TcCoercibleFail.hs:16:8: error:
• Couldn't match type ‘Int’ with ‘Age’
arising from a use of ‘coerce’
- • In the expression: coerce
- In the expression: coerce $ Map one () :: Map Age ()
+ • In the expression: coerce $ Map one () :: Map Age ()
In an equation for ‘foo3’: foo3 = coerce $ Map one () :: Map Age ()
TcCoercibleFail.hs:18:8: error:
@@ -31,8 +28,7 @@ TcCoercibleFail.hs:18:8: error:
arising from a use of ‘coerce’
The data constructor ‘Data.Ord.Down’
of newtype ‘Down’ is not in scope
- • In the expression: coerce
- In the expression: coerce $ one :: Down Int
+ • In the expression: coerce $ one :: Down Int
In an equation for ‘foo4’: foo4 = coerce $ one :: Down Int
TcCoercibleFail.hs:21:8: error:
diff --git a/testsuite/tests/typecheck/should_fail/TcStaticPointersFail01.stderr b/testsuite/tests/typecheck/should_fail/TcStaticPointersFail01.stderr
index e41ec7443d..9b85edb110 100644
--- a/testsuite/tests/typecheck/should_fail/TcStaticPointersFail01.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcStaticPointersFail01.stderr
@@ -1,6 +1,7 @@
-TcStaticPointersFail01.hs:8:13:
- Couldn't match expected type ‘Int’ with actual type ‘Int -> Int’
- Probable cause: ‘g’ is applied to too few arguments
- In the body of a static form: g
- In the expression: static g
+TcStaticPointersFail01.hs:8:13: error:
+ • Couldn't match expected type ‘Int’ with actual type ‘Int -> Int’
+ • Probable cause: ‘g’ is applied to too few arguments
+ In the body of a static form: g
+ In the expression: static g
+ In an equation for ‘f0’: f0 = static g
diff --git a/testsuite/tests/typecheck/should_fail/VtaFail.hs b/testsuite/tests/typecheck/should_fail/VtaFail.hs
new file mode 100644
index 0000000000..250f9e273e
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/VtaFail.hs
@@ -0,0 +1,57 @@
+{-# LANGUAGE TypeApplications, RankNTypes, PolyKinds #-}
+
+module VtaFail1 where
+
+pairup_nosig x y = (x, y)
+
+answer_nosig = pairup_nosig @Int @Bool 5 True
+
+addOne :: Num a => a -> a
+addOne x = x + 1
+
+answer_constraint_fail = addOne @Bool 5
+
+answer_lambda = (\x -> x) @Int 12
+
+pair :: forall a. a -> forall b. b -> (a, b)
+pair = (,)
+
+a = pair 3 @Int @Bool True
+
+data First (a :: * -> *) = F
+
+first :: First a -> Int
+first _ = 0
+
+fInt = first @Int F -- should fail
+
+data Proxy (a :: k) = P -- This expands to P (kind variable) (type variable)
+
+foo :: Proxy a -> Int
+foo _ = 0
+
+baz = foo @Bool (P :: Proxy Int) -- should fail
+
+data Three (a :: * -> k -> *) = T
+
+too :: Three a -> Int
+too _ = 3
+
+threeBad = too @Maybe T
+threeWorse = too @( -> ) (T :: Three Either)
+
+plus :: Int -> Int -> Int
+plus = (+)
+
+b = plus @Int 5 7
+c = plus @Rational 5 10
+d = (+) @Int @Int @Int 12 14
+
+
+e = show @Int @Float (read "5")
+f = show (read @Int @Bool @Float "3")
+
+silly :: a -> Bool
+silly _ = False
+
+g = silly @Maybe -- should fail
diff --git a/testsuite/tests/typecheck/should_fail/VtaFail.stderr b/testsuite/tests/typecheck/should_fail/VtaFail.stderr
new file mode 100644
index 0000000000..313d174b74
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/VtaFail.stderr
@@ -0,0 +1,94 @@
+
+VtaFail.hs:7:16: error:
+ • Cannot not apply expression of type ‘t1 -> t0 -> (t1, t0)’
+ to a visible type argument ‘Int’
+ • In the expression: pairup_nosig @Int @Bool 5 True
+ In an equation for ‘answer_nosig’:
+ answer_nosig = pairup_nosig @Int @Bool 5 True
+
+VtaFail.hs:12:26: error:
+ • No instance for (Num Bool) arising from a use of ‘addOne’
+ • In the expression: addOne @Bool 5
+ In an equation for ‘answer_constraint_fail’:
+ answer_constraint_fail = addOne @Bool 5
+
+VtaFail.hs:14:17: error:
+ • Cannot not apply expression of type ‘r0 -> r0’
+ to a visible type argument ‘Int’
+ • In the expression: (\ x -> x) @Int 12
+ In an equation for ‘answer_lambda’:
+ answer_lambda = (\ x -> x) @Int 12
+
+VtaFail.hs:19:5: error:
+ • Cannot not apply expression of type ‘Int -> (a0, Int)’
+ to a visible type argument ‘Bool’
+ • In the expression: pair 3 @Int @Bool True
+ In an equation for ‘a’: a = pair 3 @Int @Bool True
+
+VtaFail.hs:26:15: error:
+ • Expected kind ‘* -> *’, but ‘Int’ has kind ‘*’
+ • In the type ‘Int’
+ In the expression: first @Int F
+ In an equation for ‘fInt’: fInt = first @Int F
+
+VtaFail.hs:33:18: error:
+ • Couldn't match type ‘Int’ with ‘Bool’
+ Expected type: Proxy Bool
+ Actual type: Proxy Int
+ • In the second argument of ‘foo’, namely ‘(P :: Proxy Int)’
+ In the expression: foo @Bool (P :: Proxy Int)
+ In an equation for ‘baz’: baz = foo @Bool (P :: Proxy Int)
+
+VtaFail.hs:40:17: error:
+ • Expected kind ‘* -> k0 -> *’, but ‘Maybe’ has kind ‘* -> *’
+ • In the type ‘Maybe’
+ In the expression: too @Maybe T
+ In an equation for ‘threeBad’: threeBad = too @Maybe T
+
+VtaFail.hs:41:27: error:
+ • Couldn't match type ‘Either’ with ‘(->)’
+ Expected type: Three (->)
+ Actual type: Three Either
+ • In the second argument of ‘too’, namely ‘(T :: Three Either)’
+ In the expression: too @(->) (T :: Three Either)
+ In an equation for ‘threeWorse’:
+ threeWorse = too @(->) (T :: Three Either)
+
+VtaFail.hs:46:5: error:
+ • Cannot not apply expression of type ‘Int -> Int -> Int’
+ to a visible type argument ‘Int’
+ • In the expression: plus @Int 5 7
+ In an equation for ‘b’: b = plus @Int 5 7
+
+VtaFail.hs:47:5: error:
+ • Cannot not apply expression of type ‘Int -> Int -> Int’
+ to a visible type argument ‘Rational’
+ • In the expression: plus @Rational 5 10
+ In an equation for ‘c’: c = plus @Rational 5 10
+
+VtaFail.hs:48:5: error:
+ • Cannot not apply expression of type ‘Int -> Int -> Int’
+ to a visible type argument ‘Int’
+ • In the expression: (+) @Int @Int @Int 12 14
+ In an equation for ‘d’: d = (+) @Int @Int @Int 12 14
+
+VtaFail.hs:51:5: error:
+ • Cannot not apply expression of type ‘Int -> String’
+ to a visible type argument ‘Float’
+ • In the expression: show @Int @Float (read "5")
+ In an equation for ‘e’: e = show @Int @Float (read "5")
+
+VtaFail.hs:52:11: error:
+ • Cannot not apply expression of type ‘String -> Int’
+ to a visible type argument ‘Bool’
+ • In the first argument of ‘show’, namely
+ ‘(read @Int @Bool @Float "3")’
+ In the expression: show (read @Int @Bool @Float "3")
+ In an equation for ‘f’: f = show (read @Int @Bool @Float "3")
+
+VtaFail.hs:57:12: error:
+ • Expecting one more argument to ‘Maybe’
+ Expected a type, but ‘Maybe’ has kind ‘* -> *’
+ • In the type ‘Maybe’
+ In the expression: silly @Maybe
+ In an equation for ‘g’: g = silly @Maybe
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 8d8d4306e7..aa43cce226 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -147,7 +147,7 @@ test('tcfail160', normal, compile_fail, [''])
test('tcfail161', normal, compile_fail, [''])
test('tcfail162', normal, compile_fail, [''])
test('tcfail164', normal, compile_fail, [''])
-test('tcfail165', normal, compile_fail, [''])
+test('tcfail165', normal, compile, [''])
test('tcfail166', normal, compile_fail, [''])
test('tcfail167', normal, compile_fail, [''])
test('tcfail168', normal, compile_fail, [''])
@@ -379,6 +379,7 @@ test('T10351', normal, compile_fail, [''])
test('T10534', extra_clean(['T10534a.hi', 'T10534a.o']),
multimod_compile_fail, ['T10534', '-v0'])
test('T10495', normal, compile_fail, [''])
+test('VtaFail', normal, compile_fail, [''])
test('ExpandSynsFail1', normal, compile_fail, ['-fprint-expanded-synonyms'])
test('ExpandSynsFail2', normal, compile_fail, ['-fprint-expanded-synonyms'])
diff --git a/testsuite/tests/typecheck/should_fail/mc19.stderr b/testsuite/tests/typecheck/should_fail/mc19.stderr
index 8cdd4f456b..5f004dc4a8 100644
--- a/testsuite/tests/typecheck/should_fail/mc19.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc19.stderr
@@ -1,11 +1,12 @@
-
-mc19.hs:10:31: error:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [a]
- at mc19.hs:10:10
- Expected type: [a] -> [a]
- Actual type: [a] -> [[a]]
- In the expression: inits
- In a stmt of a monad comprehension: then inits
+
+mc19.hs:10:31: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [a]
+ at mc19.hs:10:10
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ • In the expression: inits
+ In a stmt of a monad comprehension: then inits
+ 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 3017d2221c..74a13b14bc 100644
--- a/testsuite/tests/typecheck/should_fail/mc21.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc21.stderr
@@ -1,11 +1,13 @@
-
-mc21.hs:12:26: error:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [[a]]
- at mc21.hs:11:9
- Expected type: [a] -> [[a]]
- Actual type: [[a]] -> [[a]]
- In the expression: take 5
- In a stmt of a monad comprehension: then group using take 5
+
+mc21.hs:12:26: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [[a]]
+ at mc21.hs:11:9
+ Expected type: [a] -> [[a]]
+ Actual type: [[a]] -> [[a]]
+ • In the expression: take 5
+ In a stmt of a monad comprehension: then group using take 5
+ In the expression:
+ [GHC.List.length x | x <- [Gnorf, Brain], then group using take 5]
diff --git a/testsuite/tests/typecheck/should_fail/mc22.stderr b/testsuite/tests/typecheck/should_fail/mc22.stderr
index 1c6dc386dd..5e369d7ffe 100644
--- a/testsuite/tests/typecheck/should_fail/mc22.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc22.stderr
@@ -1,24 +1,27 @@
-
-mc22.hs:9:9: error:
- No instance for (Functor t) arising from a use of ‘fmap’
- Possible fix:
- add (Functor t) to the context of
- a type expected by the context:
- (a -> b) -> t a -> t b
- or the inferred type of foo :: [t [Char]]
- In the expression: fmap
- In a stmt of a monad comprehension: then group using take 5
- In the expression:
- [x + 1 | x <- ["Hello", "World"], then group using take 5]
-
-mc22.hs:10:26: error:
- Couldn't match type ‘a’ with ‘t a’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [t a]
- at mc22.hs:9:9
- Expected type: [a] -> [t a]
- Actual type: [t a] -> [t a]
- In the expression: take 5
- In a stmt of a monad comprehension: then group using take 5
- Relevant bindings include foo :: [t [Char]] (bound at mc22.hs:8:1)
+
+mc22.hs:9:9: error:
+ • No instance for (Functor t) arising from a use of ‘fmap’
+ Possible fix:
+ add (Functor t) to the context of
+ a type expected by the context:
+ (a -> b) -> t a -> t b
+ or the inferred type of foo :: [t [Char]]
+ • In the expression: fmap
+ In a stmt of a monad comprehension: then group using take 5
+ In the expression:
+ [x + 1 | x <- ["Hello", "World"], then group using take 5]
+
+mc22.hs:10:26: error:
+ • Couldn't match type ‘a’ with ‘t a’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [t a]
+ at mc22.hs:9:9
+ Expected type: [a] -> [t a]
+ Actual type: [t a] -> [t a]
+ • In the expression: take 5
+ 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]
+ • Relevant bindings include
+ foo :: [t [Char]] (bound at mc22.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/mc23.stderr b/testsuite/tests/typecheck/should_fail/mc23.stderr
index 945d1a6db8..2f3ae27a98 100644
--- a/testsuite/tests/typecheck/should_fail/mc23.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc23.stderr
@@ -1,9 +1,10 @@
-mc23.hs:9:29:
- Couldn't match type ‘[a0]’ with ‘[a] -> m a’
- Expected type: (a -> b) -> [a] -> m a
- Actual type: [a0] -> [a0]
- Possible 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
- Relevant bindings include z :: m b (bound at mc23.hs:9:1)
+mc23.hs:9:29: error:
+ • Couldn't match type ‘[a0]’ with ‘[a] -> m a’
+ Expected type: (a -> b) -> [a] -> m a
+ Actual type: [a0] -> [a0]
+ • Possible 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
+ In the expression: [x | x <- [1 .. 10], then take 5 by x]
+ • Relevant bindings include z :: m b (bound at mc23.hs:9:1)
diff --git a/testsuite/tests/typecheck/should_fail/mc24.stderr b/testsuite/tests/typecheck/should_fail/mc24.stderr
index b14fd81162..7f016283b1 100644
--- a/testsuite/tests/typecheck/should_fail/mc24.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc24.stderr
@@ -1,9 +1,11 @@
-mc24.hs:10:31:
- Couldn't match type ‘[a0]’ with ‘[a] -> m [a]’
- Expected type: (a -> Integer) -> [a] -> m [a]
- Actual type: [a0] -> [a0]
- Possible 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
- Relevant bindings include foo :: m Int (bound at mc24.hs:8:1)
+mc24.hs:10:31: error:
+ • Couldn't match type ‘[a0]’ with ‘[a] -> m [a]’
+ Expected type: (a -> Integer) -> [a] -> m [a]
+ Actual type: [a0] -> [a0]
+ • Possible 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
+ In the expression:
+ [GHC.List.length x | x <- [1 .. 10], then group by x using take 2]
+ • Relevant bindings include foo :: m Int (bound at mc24.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/mc25.stderr b/testsuite/tests/typecheck/should_fail/mc25.stderr
index 0989dbcf70..406f89e719 100644
--- a/testsuite/tests/typecheck/should_fail/mc25.stderr
+++ b/testsuite/tests/typecheck/should_fail/mc25.stderr
@@ -1,18 +1,20 @@
mc25.hs:9:10: error:
- No instance for (Functor t1) arising from a use of ‘fmap’
- Possible fix:
- add (Functor t1) to the context of
- a type expected by the context: (a -> b) -> t1 a -> t1 b
- or the inferred type of z :: [t1 t]
- 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]
+ • No instance for (Functor t1) arising from a use of ‘fmap’
+ Possible fix:
+ add (Functor t1) to the context of
+ a type expected by the context:
+ (a -> b) -> t1 a -> t1 b
+ or the inferred type of z :: [t1 t]
+ • 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: error:
- Couldn't match type ‘a -> t’ with ‘Int’
- Expected type: (a -> t) -> [a] -> [t1 a]
- Actual type: Int -> [t1 a] -> [t1 a]
- In the expression: take
- In a stmt of a monad comprehension: then group by x using take
- Relevant bindings include z :: [t1 t] (bound at mc25.hs:9:1)
+ • Couldn't match type ‘a -> t’ with ‘Int’
+ Expected type: (a -> t) -> [a] -> [t1 a]
+ Actual type: Int -> [t1 a] -> [t1 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]
+ • Relevant bindings include z :: [t1 t] (bound at mc25.hs:9:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail001.stderr b/testsuite/tests/typecheck/should_fail/tcfail001.stderr
index b30d995455..0b0a799c04 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail001.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail001.stderr
@@ -1,7 +1,8 @@
-tcfail001.hs:9:2:
- Couldn't match expected type ‘[t0] -> [t1]’ 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]’
- Relevant bindings include op :: [a] (bound at tcfail001.hs:9:2)
+tcfail001.hs:9:2: error:
+ • Couldn't match expected type ‘[a]’
+ with actual type ‘[t0] -> [t1]’
+ • The equation(s) for ‘op’ have one argument,
+ but its type ‘[a]’ has none
+ In the instance declaration for ‘A [a]’
+ • Relevant bindings include op :: [a] (bound at tcfail001.hs:9:2)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail002.stderr b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
index 285b6bf577..6755636682 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail002.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail002.stderr
@@ -1,8 +1,8 @@
tcfail002.hs:4:7: error:
- • Occurs check: cannot construct the infinite type: r ~ [r]
+ • Occurs check: cannot construct the infinite type: t ~ [t]
• In the expression: z
In an equation for ‘c’: c z = z
• Relevant bindings include
- z :: [r] (bound at tcfail002.hs:4:3)
- c :: [r] -> r (bound at tcfail002.hs:3:1)
+ z :: [t] (bound at tcfail002.hs:4:3)
+ c :: [t] -> t (bound at tcfail002.hs:3:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail004.stderr b/testsuite/tests/typecheck/should_fail/tcfail004.stderr
index 2294a6166f..c575129cf5 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail004.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail004.stderr
@@ -1,9 +1,9 @@
tcfail004.hs:3:9: error:
- • Couldn't match expected type ‘(r, r1)’
+ • Couldn't match expected type ‘(t, t1)’
with actual type ‘(Integer, Integer, Integer)’
• In the expression: (1, 2, 3)
In a pattern binding: (f, g) = (1, 2, 3)
• Relevant bindings include
- f :: r (bound at tcfail004.hs:3:2)
- g :: r1 (bound at tcfail004.hs:3:4)
+ f :: t (bound at tcfail004.hs:3:2)
+ g :: t1 (bound at tcfail004.hs:3:4)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail005.stderr b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
index 4c585af3da..77437cf583 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail005.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail005.stderr
@@ -1,9 +1,9 @@
tcfail005.hs:3:9: error:
- • Couldn't match expected type ‘[r]’
+ • Couldn't match expected type ‘[t]’
with actual type ‘(Integer, Char)’
• In the expression: (1, 'a')
In a pattern binding: (h : i) = (1, 'a')
• Relevant bindings include
- h :: r (bound at tcfail005.hs:3:2)
- i :: [r] (bound at tcfail005.hs:3:4)
+ h :: t (bound at tcfail005.hs:3:2)
+ i :: [t] (bound at tcfail005.hs:3:4)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail007.stderr b/testsuite/tests/typecheck/should_fail/tcfail007.stderr
index 5ea9792256..4c1652fe50 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail007.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail007.stderr
@@ -1,8 +1,8 @@
-tcfail007.hs:3:15:
- No instance for (Num Bool) arising from a use of ‘+’
- In the expression: x + 1
- In an equation for ‘n’:
- n x
- | True = x + 1
- | False = True
+tcfail007.hs:3:14: error:
+ • No instance for (Num Bool) arising from a use of ‘+’
+ • In the expression: x + 1
+ In an equation for ‘n’:
+ n x
+ | True = x + 1
+ | False = True
diff --git a/testsuite/tests/typecheck/should_fail/tcfail010.stderr b/testsuite/tests/typecheck/should_fail/tcfail010.stderr
index 92ee3d8f8e..c22a05e777 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail010.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail010.stderr
@@ -1,6 +1,6 @@
-tcfail010.hs:3:17:
- No instance for (Num [r0]) arising from a use of ‘+’
- In the expression: z + 2
- In the expression: \ (y : z) -> z + 2
- In an equation for ‘q’: q = \ (y : z) -> z + 2
+tcfail010.hs:3:16: error:
+ • No instance for (Num [t0]) arising from a use of ‘+’
+ • In the expression: z + 2
+ In the expression: \ (y : z) -> z + 2
+ In an equation for ‘q’: q = \ (y : z) -> z + 2
diff --git a/testsuite/tests/typecheck/should_fail/tcfail013.stderr b/testsuite/tests/typecheck/should_fail/tcfail013.stderr
index 332f10e729..ff7702213c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail013.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail013.stderr
@@ -1,7 +1,7 @@
tcfail013.hs:4:3: error:
- • Couldn't match expected type ‘[r]’ with actual type ‘Bool’
+ • Couldn't match expected type ‘[t1]’ with actual type ‘Bool’
• In the pattern: True
In an equation for ‘f’: f True = 2
• Relevant bindings include
- f :: [r] -> a (bound at tcfail013.hs:3:1)
+ f :: [t1] -> t (bound at tcfail013.hs:3:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail014.stderr b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
index 92307b3830..6b88e835ed 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail014.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail014.stderr
@@ -3,6 +3,7 @@ tcfail014.hs:5:33: error:
• Occurs check: cannot construct the infinite type: r8 ~ r8 -> r7
• In the first argument of ‘z’, namely ‘z’
In the expression: z z
+ In an equation for ‘h’: h z = z z
• Relevant bindings include
z :: r8 -> r7 (bound at tcfail014.hs:5:27)
h :: (r8 -> r7) -> r7 (bound at tcfail014.hs:5:25)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail016.stderr b/testsuite/tests/typecheck/should_fail/tcfail016.stderr
index 59c8fa4e3d..cb1fa945e7 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail016.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail016.stderr
@@ -1,22 +1,24 @@
-tcfail016.hs:9:20:
- Couldn't match type ‘(t, Expr t)’ with ‘Expr t’
- Expected type: Expr t
- Actual type: AnnExpr t
- In the first argument of ‘g’, namely ‘e1’
- In the first argument of ‘(++)’, namely ‘(g e1)’
- Relevant bindings include
- e2 :: AnnExpr t (bound at tcfail016.hs:9:11)
- e1 :: AnnExpr t (bound at tcfail016.hs:9:8)
- g :: Expr t -> [[Char]] (bound at tcfail016.hs:8:1)
+tcfail016.hs:9:20: error:
+ • Couldn't match type ‘(t, Expr t)’ with ‘Expr t’
+ Expected type: Expr t
+ Actual type: AnnExpr t
+ • In the first argument of ‘g’, namely ‘e1’
+ In the first argument of ‘(++)’, namely ‘(g e1)’
+ In the expression: (g e1) ++ (g e2)
+ • Relevant bindings include
+ e2 :: AnnExpr t (bound at tcfail016.hs:9:11)
+ e1 :: AnnExpr t (bound at tcfail016.hs:9:8)
+ g :: Expr t -> [[Char]] (bound at tcfail016.hs:8:1)
-tcfail016.hs:9:28:
- Couldn't match type ‘(t, Expr t)’ with ‘Expr t’
- Expected type: Expr t
- Actual type: AnnExpr t
- In the first argument of ‘g’, namely ‘e2’
- In the second argument of ‘(++)’, namely ‘(g e2)’
- Relevant bindings include
- e2 :: AnnExpr t (bound at tcfail016.hs:9:11)
- e1 :: AnnExpr t (bound at tcfail016.hs:9:8)
- g :: Expr t -> [[Char]] (bound at tcfail016.hs:8:1)
+tcfail016.hs:9:28: error:
+ • Couldn't match type ‘(t, Expr t)’ with ‘Expr t’
+ Expected type: Expr t
+ Actual type: AnnExpr t
+ • In the first argument of ‘g’, namely ‘e2’
+ In the second argument of ‘(++)’, namely ‘(g e2)’
+ In the expression: (g e1) ++ (g e2)
+ • Relevant bindings include
+ e2 :: AnnExpr t (bound at tcfail016.hs:9:11)
+ e1 :: AnnExpr t (bound at tcfail016.hs:9:8)
+ g :: Expr t -> [[Char]] (bound at tcfail016.hs:8:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail018.stderr b/testsuite/tests/typecheck/should_fail/tcfail018.stderr
index 88c08a8a8b..57060a87db 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail018.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail018.stderr
@@ -1,5 +1,5 @@
-tcfail018.hs:5:10:
- No instance for (Num [r0]) arising from the literal ‘1’
- In the expression: 1
- In a pattern binding: (a : []) = 1
+tcfail018.hs:5:10: error:
+ • No instance for (Num [t0]) arising from the literal ‘1’
+ • In the expression: 1
+ In a pattern binding: (a : []) = 1
diff --git a/testsuite/tests/typecheck/should_fail/tcfail029.stderr b/testsuite/tests/typecheck/should_fail/tcfail029.stderr
index 5b794458e8..c31c5869b9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail029.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail029.stderr
@@ -1,5 +1,5 @@
-tcfail029.hs:6:9:
- No instance for (Ord Foo) arising from a use of ‘>’
- In the expression: x > Bar
- In an equation for ‘f’: f x = x > Bar
+tcfail029.hs:6:7: error:
+ • No instance for (Ord Foo) arising from a use of ‘>’
+ • In the expression: x > Bar
+ In an equation for ‘f’: f x = x > Bar
diff --git a/testsuite/tests/typecheck/should_fail/tcfail032.stderr b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
index 05d33a5e05..79ec408274 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail032.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail032.stderr
@@ -10,4 +10,4 @@ tcfail032.hs:14:8: error:
In an equation for ‘f’: f x = (x :: (Eq a) => a -> Int)
• Relevant bindings include
x :: r (bound at tcfail032.hs:14:3)
- f :: r -> a -> Int (bound at tcfail032.hs:14:1)
+ f :: r -> forall a. Eq a => a -> Int (bound at tcfail032.hs:14:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail033.stderr b/testsuite/tests/typecheck/should_fail/tcfail033.stderr
index fd2887de60..94e998f05f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail033.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail033.stderr
@@ -1,9 +1,10 @@
-tcfail033.hs:4:12:
- Occurs check: cannot construct the infinite type: t ~ (t, t1)
- In the expression: x
- In the expression: [x | (x, y) <- buglet]
- Relevant bindings include
- y :: t1 (bound at tcfail033.hs:4:19)
- x :: t (bound at tcfail033.hs:4:17)
- buglet :: [(t, t1)] (bound at tcfail033.hs:4:1)
+tcfail033.hs:4:12: error:
+ • Occurs check: cannot construct the infinite type: t ~ (t, t1)
+ • In the expression: x
+ In the expression: [x | (x, y) <- buglet]
+ In an equation for ‘buglet’: buglet = [x | (x, y) <- buglet]
+ • Relevant bindings include
+ y :: t1 (bound at tcfail033.hs:4:19)
+ x :: t (bound at tcfail033.hs:4:17)
+ buglet :: [(t, t1)] (bound at tcfail033.hs:4:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail034.stderr b/testsuite/tests/typecheck/should_fail/tcfail034.stderr
index 1a8d6d7802..baf68da924 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail034.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail034.stderr
@@ -1,14 +1,14 @@
-
-tcfail034.hs:17:13: error:
- Could not deduce (Integral a) arising from a use of ‘mod’
- from the context: (Num a, Eq a)
- bound by the type signature for:
- test :: (Num a, Eq a) => a -> Bool
- at tcfail034.hs:16:1-32
- Possible fix:
- add (Integral a) to the context of
- the type signature for:
- test :: (Num a, Eq a) => a -> Bool
- In the first argument of ‘(==)’, namely ‘(x `mod` 3)’
- In the expression: (x `mod` 3) == 0
- In an equation for ‘test’: test x = (x `mod` 3) == 0
+
+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
+ at tcfail034.hs:16:1-32
+ Possible fix:
+ add (Integral a) to the context of
+ the type signature for:
+ test :: (Num a, Eq a) => a -> Bool
+ • In the first argument of ‘(==)’, namely ‘(x `mod` 3)’
+ In the expression: (x `mod` 3) == 0
+ In an equation for ‘test’: test x = (x `mod` 3) == 0
diff --git a/testsuite/tests/typecheck/should_fail/tcfail065.stderr b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
index 65befaf29e..369b0807d7 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail065.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail065.stderr
@@ -1,14 +1,17 @@
-tcfail065.hs:29:20: error:
- • Couldn't match expected type ‘x’ with actual type ‘x1’
+tcfail065.hs:29:18: error:
+ • Couldn't match type ‘x1’ with ‘x’
‘x1’ is a rigid type variable bound by
the type signature for:
setX :: forall x1. x1 -> X x -> X x
at tcfail065.hs:29:3
‘x’ is a rigid type variable bound by
the instance declaration at tcfail065.hs:28:10
- • In the first argument of ‘X’, namely ‘x’
- In the expression: X x
+ Expected type: X x
+ Actual type: X x1
+ • In the expression: X x
+ In an equation for ‘setX’: setX x (X _) = X x
+ In the instance declaration for ‘HasX (X x)’
• Relevant bindings include
x :: x1 (bound at tcfail065.hs:29:8)
setX :: x1 -> X x -> X x (bound at tcfail065.hs:29:3)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail068.stderr b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
index 5ca47f52ed..eb42f9a33b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail068.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail068.stderr
@@ -16,11 +16,13 @@ tcfail068.hs:14:9: error:
• In the first argument of ‘runST’, namely
‘(newSTArray ((1, 1), n) x)’
In the expression: runST (newSTArray ((1, 1), n) x)
+ In an equation for ‘itgen’:
+ itgen n x = runST (newSTArray ((1, 1), n) x)
• Relevant bindings include
itgen :: (Int, Int) -> a -> IndTree s a
(bound at tcfail068.hs:12:1)
-tcfail068.hs:19:21: error:
+tcfail068.hs:19:9: error:
• Couldn't match type ‘s’ with ‘s1’
‘s’ is a rigid type variable bound by
the type signature for:
@@ -32,10 +34,20 @@ tcfail068.hs:19:21: error:
a type expected by the context:
forall s1. 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’
+ Expected type: GHC.ST.ST s1 (IndTree s a)
+ Actual type: GHC.ST.ST s (IndTree s a)
+ • In the first argument of ‘runST’, namely
+ ‘(readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)’
+ In the expression:
+ runST
+ (readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)
+ In an equation for ‘itiap’:
+ itiap i f arr
+ = runST
+ (readSTArray arr i
+ >>= \ val -> writeSTArray arr i (f val) >> return arr)
• Relevant bindings include
arr :: IndTree s a (bound at tcfail068.hs:17:11)
itiap :: (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
@@ -57,6 +69,17 @@ tcfail068.hs:24:36: error:
Actual type: GHC.ST.ST s (IndTree s a)
• In the first argument of ‘runST’, namely ‘(itrap' i k)’
In the expression: runST (itrap' i k)
+ In an equation for ‘itrap’:
+ itrap ((i, k), (j, l)) f arr
+ = runST (itrap' i k)
+ where
+ itrap' i k
+ = if k > l then return arr else (itrapsnd i k >> itrap' i (k + 1))
+ itrapsnd i k
+ = if i > j then
+ return arr
+ else
+ (readSTArray arr (i, k) >>= \ val -> ...)
• Relevant bindings include
itrap' :: Int -> Int -> GHC.ST.ST s (IndTree s a)
(bound at tcfail068.hs:26:9)
@@ -89,6 +112,20 @@ tcfail068.hs:36:46: error:
Actual type: GHC.ST.ST s (c, IndTree s b)
• In the first argument of ‘runST’, namely ‘(itrapstate' i k s)’
In the expression: runST (itrapstate' i k s)
+ In an equation for ‘itrapstate’:
+ itrapstate ((i, k), (j, l)) f c d s arr
+ = runST (itrapstate' i k s)
+ where
+ itrapstate' i k s
+ = if k > l then
+ return (s, arr)
+ else
+ (itrapstatesnd i k s >>= \ (s, arr) -> ...)
+ itrapstatesnd i k s
+ = if i > j then
+ return (s, arr)
+ else
+ (readSTArray arr (i, k) >>= \ val -> ...)
• Relevant bindings include
itrapstate' :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
(bound at tcfail068.hs:38:9)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail076.stderr b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
index 8283ef0458..242c62235e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail076.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail076.stderr
@@ -13,6 +13,7 @@ tcfail076.hs:18:82: error:
Actual type: m res
• In the expression: cont a
In the first argument of ‘KContT’, namely ‘(\ cont' -> cont a)’
+ In the expression: KContT (\ cont' -> cont a)
• Relevant bindings include
cont' :: b -> m res1 (bound at tcfail076.hs:18:73)
cont :: a -> m res (bound at tcfail076.hs:18:37)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail099.stderr b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
index 687fafb6da..3ba8165766 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail099.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail099.stderr
@@ -8,6 +8,7 @@ tcfail099.hs:9:20: error:
at tcfail099.hs:9:7-9
• In the first argument of ‘f’, namely ‘arg’
In the expression: f arg
+ In an equation for ‘call’: call (C f) arg = f arg
• Relevant bindings include
arg :: r (bound at tcfail099.hs:9:12)
f :: a -> Int (bound at tcfail099.hs:9:9)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail103.stderr b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
index 627ef1158c..2d76dc588a 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail103.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail103.stderr
@@ -1,19 +1,24 @@
-
-tcfail103.hs:15:23: error:
- Couldn't match type ‘t’ with ‘s’
- ‘t’ is a rigid type variable bound by
- the type signature for:
- f :: forall t. ST t Int
- at tcfail103.hs:10:5
- ‘s’ is a rigid type variable bound by
- the type signature for:
- g :: forall s. ST s Int
- at tcfail103.hs:13:14
- Expected type: STRef s Int
- Actual type: STRef t Int
- In the first argument of ‘readSTRef’, namely ‘v’
- In the expression: readSTRef v
- Relevant bindings include
- g :: ST s Int (bound at tcfail103.hs:15:9)
- v :: STRef t Int (bound at tcfail103.hs:12:5)
- f :: ST t Int (bound at tcfail103.hs:11:1)
+
+tcfail103.hs:15:13: error:
+ • Couldn't match type ‘t’ with ‘s’
+ ‘t’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall t. ST t Int
+ at tcfail103.hs:10:5
+ ‘s’ is a rigid type variable bound by
+ the type signature for:
+ g :: forall s. ST s Int
+ at tcfail103.hs:13:14
+ Expected type: ST s Int
+ Actual type: ST t Int
+ • In the expression: readSTRef v
+ In an equation for ‘g’: g = readSTRef v
+ In the expression:
+ do { v <- newSTRef 5;
+ let g :: ST s Int
+ g = readSTRef v;
+ g }
+ • Relevant bindings include
+ g :: ST s Int (bound at tcfail103.hs:15:9)
+ v :: STRef t Int (bound at tcfail103.hs:12:5)
+ f :: ST t Int (bound at tcfail103.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail104.stderr b/testsuite/tests/typecheck/should_fail/tcfail104.stderr
index cb14d9af26..b6c21e5e82 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail104.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail104.stderr
@@ -1,12 +1,16 @@
-tcfail104.hs:16:19:
- Couldn't match expected type ‘Char -> Char’
- with actual type ‘forall a. a -> a’
- In the expression: x
- In the expression: (\ x -> x)
+tcfail104.hs:14:15: error:
+ • Couldn't match expected type ‘forall a. a -> a’
+ with actual type ‘Char -> Char’
+ • When checking that the pattern signature: forall a. a -> a
+ fits the type of its context: Char -> Char
+ In the pattern: x :: forall a. a -> a
+ In the expression: (\ (x :: forall a. a -> a) -> x)
-tcfail104.hs:22:39:
- Couldn't match expected type ‘forall a. a -> a’
- with actual type ‘a0 -> a0’
- In the expression: x
- In the expression: (\ (x :: forall a. a -> a) -> x)
+tcfail104.hs:22:15: error:
+ • Couldn't match expected type ‘forall a. a -> a’
+ with actual type ‘Char -> Char’
+ • When checking that the pattern signature: forall a. a -> a
+ fits the type of its context: Char -> Char
+ In the pattern: x :: forall a. a -> a
+ In the expression: (\ (x :: forall a. a -> a) -> x)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail131.stderr b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
index 03bdc72eff..2ae70a0928 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail131.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail131.stderr
@@ -1,11 +1,12 @@
-tcfail131.hs:7:9: error:
- • Couldn't match expected type ‘b’ with actual type ‘Integer’
+tcfail131.hs:7:11: error:
+ • Couldn't match expected type ‘Integer’ with actual type ‘b’
‘b’ is a rigid type variable bound by
the type signature for:
g :: forall b. Num b => b -> b
at tcfail131.hs:6:8
- • In the expression: f x x
+ • In the first argument of ‘f’, namely ‘x’
+ In the expression: f x x
In an equation for ‘g’: g x = f x x
• Relevant bindings include
x :: b (bound at tcfail131.hs:7:5)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail133.stderr b/testsuite/tests/typecheck/should_fail/tcfail133.stderr
index ac85d0be71..a178f02801 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail133.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail133.stderr
@@ -14,8 +14,7 @@ tcfail133.hs:68:7: error:
...plus 25 others
...plus three instance involving out-of-scope typess
(use -fprint-potential-instances to see them all)
- • In the expression: show
- In the expression: show $ add (One :@ Zero) (One :@ One)
+ • In the expression: show $ add (One :@ Zero) (One :@ One)
In an equation for ‘foo’:
foo = show $ add (One :@ Zero) (One :@ One)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail140.stderr b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
index 41268ec6df..b3bf602200 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail140.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail140.stderr
@@ -19,14 +19,14 @@ tcfail140.hs:12:10: error:
rot :: r -> t (bound at tcfail140.hs:12:1)
tcfail140.hs:14:15: error:
- • Couldn't match expected type ‘a -> b’ with actual type ‘Int’
+ • Couldn't match expected type ‘t -> b’ with actual type ‘Int’
• The operator ‘f’ takes two arguments,
but its type ‘Int -> Int’ has only one
In the first argument of ‘map’, namely ‘(3 `f`)’
In the expression: map (3 `f`) xs
• Relevant bindings include
- xs :: [a] (bound at tcfail140.hs:14:5)
- bot :: [a] -> [b] (bound at tcfail140.hs:14:1)
+ xs :: [t] (bound at tcfail140.hs:14:5)
+ bot :: [t] -> [b] (bound at tcfail140.hs:14:1)
tcfail140.hs:16:8: error:
• The constructor ‘Just’ should have 1 argument, but has been given none
@@ -35,6 +35,6 @@ tcfail140.hs:16:8: error:
In the expression: ((\ Just x -> x) :: Maybe a -> a) (Just 1)
tcfail140.hs:19:1: error:
- • Couldn't match expected type ‘t0 -> Bool’ with actual type ‘Int’
+ • Couldn't match expected type ‘Int’ with actual type ‘t0 -> Bool’
• The equation(s) for ‘g’ have two arguments,
but its type ‘Int -> Int’ has only one
diff --git a/testsuite/tests/typecheck/should_fail/tcfail143.stderr b/testsuite/tests/typecheck/should_fail/tcfail143.stderr
index 14c73d98da..b94266978d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail143.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail143.stderr
@@ -1,8 +1,8 @@
-tcfail143.hs:29:9: error:
- Couldn't match type ‘S Z’ with ‘Z’
- arising from a functional dependency between:
- constraint ‘MinMax (S Z) Z Z Z’ arising from a use of ‘extend’
- instance ‘MinMax a Z Z a’ at tcfail143.hs:11:10-23
- In the expression: n1 `extend` n0
- In an equation for ‘t2’: t2 = n1 `extend` n0
+tcfail143.hs:29:6: error:
+ • Couldn't match type ‘S Z’ with ‘Z’
+ arising from a functional dependency between:
+ constraint ‘MinMax (S Z) Z Z Z’ arising from a use of ‘extend’
+ instance ‘MinMax a Z Z a’ at tcfail143.hs:11:10-23
+ • 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 8034a804fc..5f4ec3e013 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail153.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail153.stderr
@@ -1,18 +1,17 @@
-
-tcfail153.hs:6:7: error:
- Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- f :: forall a. a -> [a]
- at tcfail153.hs:5:6
- Expected type: [a]
- Actual type: [Bool]
- In the expression: g x
- In an equation for ‘f’:
- f x
- = g x
- where
- g y = if y then [] else [...]
- Relevant bindings include
- x :: a (bound at tcfail153.hs:6:3)
- f :: a -> [a] (bound at tcfail153.hs:6:1)
+
+tcfail153.hs:6:9: error:
+ • Couldn't match expected type ‘Bool’ with actual type ‘a’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. a -> [a]
+ at tcfail153.hs:5:6
+ • In the first argument of ‘g’, namely ‘x’
+ In the expression: g x
+ In an equation for ‘f’:
+ f x
+ = g x
+ where
+ g y = if y then [] else [...]
+ • Relevant bindings include
+ x :: a (bound at tcfail153.hs:6:3)
+ f :: a -> [a] (bound at tcfail153.hs:6:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail165.hs b/testsuite/tests/typecheck/should_fail/tcfail165.hs
index c23a7f39b4..8b4cabdc8e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail165.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail165.hs
@@ -11,6 +11,7 @@ import Control.Concurrent
--
-- In GHC 7.0 it fails again! (and rightly so)
+-- With the Visible Type Application patch, this succeeds again.
+
foo = do var <- newEmptyMVar :: IO (MVar (forall a. Show a => a -> String))
putMVar var (show :: forall b. Show b => b -> String)
-
diff --git a/testsuite/tests/typecheck/should_fail/tcfail165.stderr b/testsuite/tests/typecheck/should_fail/tcfail165.stderr
deleted file mode 100644
index 2b8b434385..0000000000
--- a/testsuite/tests/typecheck/should_fail/tcfail165.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-
-tcfail165.hs:15:23:
- Couldn't match expected type ‘forall a. Show a => a -> String’
- with actual type ‘b0 -> String’
- In the second argument of ‘putMVar’, namely
- ‘(show :: forall b. Show b => b -> String)’
- In a stmt of a 'do' block:
- putMVar var (show :: forall b. Show b => b -> String)
- In the expression:
- do { var <- newEmptyMVar ::
- IO (MVar (forall a. Show a => a -> String));
- putMVar var (show :: forall b. Show b => b -> String) }
diff --git a/testsuite/tests/typecheck/should_fail/tcfail168.stderr b/testsuite/tests/typecheck/should_fail/tcfail168.stderr
index e8c6c313e1..5f4656b13f 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail168.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail168.stderr
@@ -1,12 +1,18 @@
-tcfail168.hs:7:11:
- Couldn't match expected type ‘IO a0’
- with actual type ‘Char -> IO ()’
- Probable cause: ‘putChar’ is applied to too few arguments
- In a stmt of a 'do' block: putChar
- In the expression:
- do { putChar;
- putChar 'a';
- putChar 'a';
- putChar 'a';
- .... }
+tcfail168.hs:7:11: error:
+ • Couldn't match expected type ‘IO a0’
+ with actual type ‘Char -> IO ()’
+ • Probable cause: ‘putChar’ is applied to too few arguments
+ 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/tcfail174.hs b/testsuite/tests/typecheck/should_fail/tcfail174.hs
index 47c63d7248..41fc18fc66 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.hs
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.hs
@@ -7,6 +7,7 @@ data Capture a = Base a
g :: Capture (forall a . a -> a)
g = Base id -- Fails; need a rigid signature on 'id'
+ -- Actually, succeeds now, with visible type application
-- This function should definitely be rejected, with or without type signature
@@ -14,4 +15,3 @@ h1 = Capture g
h2 :: Capture b
h2 = Capture g
-
diff --git a/testsuite/tests/typecheck/should_fail/tcfail174.stderr b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
index fec5748461..e7ad3ca813 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail174.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail174.stderr
@@ -1,35 +1,30 @@
-
-tcfail174.hs:9:10: error:
- Couldn't match expected type ‘forall a. a -> a’
- with actual type ‘a0 -> a0’
- In the first argument of ‘Base’, namely ‘id’
- In the expression: Base id
-
-tcfail174.hs:13:14: error:
- Couldn't match type ‘a’ with ‘a1’
- because type variable ‘a1’ would escape its scope
- This (rigid, skolem) type variable is bound by
- the type forall a2. a2 -> a2
- at tcfail174.hs:13:1-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
- Relevant bindings include
- h1 :: Capture a (bound at tcfail174.hs:13:1)
-
-tcfail174.hs:16:14: error:
- Couldn't match type ‘a’ with ‘b’
- ‘a’ is a rigid type variable bound by
- the type forall a1. a1 -> a1
- at tcfail174.hs:1:1
- ‘b’ is a rigid type variable bound by
- the type signature for:
- h2 :: forall b. Capture b
- at tcfail174.hs:15:7
- Expected type: Capture (forall x. x -> b)
- Actual type: Capture (forall a. a -> a)
- In the first argument of ‘Capture’, namely ‘g’
- In the expression: Capture g
- Relevant bindings include
- h2 :: Capture b (bound at tcfail174.hs:16:1)
+
+tcfail174.hs:14:14: error:
+ • Couldn't match type ‘a’ with ‘a1’
+ because type variable ‘a1’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ the type forall a2. a2 -> a2
+ at tcfail174.hs:14:1-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
+ • Relevant bindings include
+ h1 :: Capture a (bound at tcfail174.hs:14:1)
+
+tcfail174.hs:17:14: error:
+ • Couldn't match type ‘a’ with ‘b’
+ ‘a’ is a rigid type variable bound by
+ the type forall a1. a1 -> a1 at tcfail174.hs:1:1
+ ‘b’ is a rigid type variable bound by
+ the type signature for:
+ h2 :: forall b. Capture b
+ at tcfail174.hs:16:7
+ 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
+ • Relevant bindings include
+ h2 :: Capture b (bound at tcfail174.hs:17:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail175.stderr b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
index 82da98bc0c..c421684b8d 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail175.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail175.stderr
@@ -1,7 +1,7 @@
tcfail175.hs:11:1: error:
- • Couldn't match expected type ‘String -> String -> String’
- with actual type ‘a’
+ • 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 :: forall a. Int -> a
diff --git a/testsuite/tests/typecheck/should_fail/tcfail178.stderr b/testsuite/tests/typecheck/should_fail/tcfail178.stderr
index 472e133098..98df425424 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail178.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail178.stderr
@@ -1,14 +1,16 @@
-tcfail178.hs:15:7:
- Couldn't match type ‘()’ with ‘[a]’
- Expected type: Bool -> [a]
- Actual type: Bool -> ()
- In the first argument of ‘a’, namely ‘y’
- In the expression: a y
- Relevant bindings include c :: [a] (bound at tcfail178.hs:15:1)
+tcfail178.hs:15:7: error:
+ • Couldn't match type ‘()’ with ‘[a]’
+ Expected type: Bool -> [a]
+ Actual type: Bool -> ()
+ • In the first argument of ‘a’, namely ‘y’
+ In the expression: a y
+ In an equation for ‘c’: c = a y
+ • Relevant bindings include c :: [a] (bound at tcfail178.hs:15:1)
-tcfail178.hs:18:7:
- Couldn't match expected type ‘Bool -> [a]’ with actual type ‘()’
- In the first argument of ‘a’, namely ‘()’
- In the expression: a ()
- Relevant bindings include d :: [a] (bound at tcfail178.hs:18:1)
+tcfail178.hs:18:7: error:
+ • Couldn't match expected type ‘Bool -> [a]’ with actual type ‘()’
+ • In the first argument of ‘a’, namely ‘()’
+ In the expression: a ()
+ In an equation for ‘d’: d = a ()
+ • Relevant bindings include d :: [a] (bound at tcfail178.hs:18:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail179.stderr b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
index a50e75e6be..2a0a5bf614 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail179.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail179.stderr
@@ -1,6 +1,6 @@
-tcfail179.hs:14:39: error:
- • Couldn't match expected type ‘s’ with actual type ‘x’
+tcfail179.hs:14:41: error:
+ • 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,
@@ -10,10 +10,13 @@ tcfail179.hs:14:39: error:
the type signature for:
run :: forall s. T s -> Int
at tcfail179.hs:12:8
- • In the first argument of ‘g’, namely ‘x’
+ Expected type: x -> s
+ Actual type: s -> s
+ • In the second argument of ‘g’, namely ‘id’
In the expression: g x id
+ In a pattern binding: (x, _, b) = g x id
• Relevant bindings include
- x :: x (bound at tcfail179.hs:14:26)
+ x :: s (bound at tcfail179.hs:14:26)
g :: s -> (x -> s) -> (x, s, Int) (bound at tcfail179.hs:14:16)
ts :: T s (bound at tcfail179.hs:13:5)
run :: T s -> Int (bound at tcfail179.hs:13:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail181.stderr b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
index 18309c10d1..6cf22a9f61 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail181.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail181.stderr
@@ -1,16 +1,17 @@
tcfail181.hs:17:9: error:
- Could not deduce (Monad m0) arising from a use of ‘foo’
- from the context: Monad m
- bound by the inferred type of
- wog :: Monad m => r -> Something (m Bool) e
- at tcfail181.hs:17:1-30
- The type variable ‘m0’ is ambiguous
- These potential instances exist:
- instance Monad IO -- Defined in ‘GHC.Base’
- instance Monad Maybe -- Defined in ‘GHC.Base’
- instance Monad ((->) r) -- Defined in ‘GHC.Base’
- ...plus two others
- (use -fprint-potential-instances to see them all)
- In the expression: foo {bar = return True}
- In an equation for ‘wog’: wog x = foo {bar = return True}
+ • 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 => r -> Something (m Bool) e
+ at tcfail181.hs:17:1-30
+ The type variable ‘m0’ is ambiguous
+ These potential instances exist:
+ instance Monad IO -- Defined in ‘GHC.Base’
+ instance Monad Maybe -- Defined in ‘GHC.Base’
+ instance Monad ((->) r) -- Defined in ‘GHC.Base’
+ ...plus two others
+ (use -fprint-potential-instances to see them all)
+ • In the expression: foo
+ In the expression: foo {bar = return True}
+ In an equation for ‘wog’: wog x = foo {bar = return True}
diff --git a/testsuite/tests/typecheck/should_fail/tcfail185.stderr b/testsuite/tests/typecheck/should_fail/tcfail185.stderr
index 785b5d6dd0..f8c3c6cd99 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail185.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail185.stderr
@@ -1,11 +1,17 @@
-tcfail185.hs:7:46:
- Couldn't match expected type ‘Int -> Int’ with actual type ‘Bool’
- In the expression: x
- In the expression:
- let
- y1 = y
- y2 = y1
- y3 = y2
- ....
- in x
+tcfail185.hs:7:46: error:
+ • Couldn't match expected type ‘Int -> Int’ with actual type ‘Bool’
+ • In the expression: x
+ In the expression:
+ let
+ y1 = y
+ y2 = y1
+ y3 = y2
+ ....
+ in x
+ In the expression:
+ \ x y
+ -> let
+ y1 = ...
+ ....
+ in x
diff --git a/testsuite/tests/typecheck/should_fail/tcfail189.stderr b/testsuite/tests/typecheck/should_fail/tcfail189.stderr
index 380b014947..f23243bdd0 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail189.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail189.stderr
@@ -1,8 +1,10 @@
-tcfail189.hs:10:31:
- Couldn't match type ‘[a0]’ with ‘[a] -> [[a]]’
- Expected type: (a -> Integer) -> [a] -> [[a]]
- Actual type: [a0] -> [a0]
- Possible 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
+tcfail189.hs:10:31: error:
+ • Couldn't match type ‘[a0]’ with ‘[a] -> [[a]]’
+ Expected type: (a -> Integer) -> [a] -> [[a]]
+ Actual type: [a0] -> [a0]
+ • Possible 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
+ In the expression:
+ [length x | x <- [1 .. 10], 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 bd1b04ca80..6b338eb5ed 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail191.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail191.stderr
@@ -1,11 +1,13 @@
-
-tcfail191.hs:11:26: error:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [[a]]
- at tcfail191.hs:10:9
- Expected type: [a] -> [[a]]
- Actual type: [[a]] -> [[a]]
- In the expression: take 5
- In a stmt of a list comprehension: then group using take 5
+
+tcfail191.hs:11:26: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [[a]]
+ at tcfail191.hs:10:9
+ Expected type: [a] -> [[a]]
+ Actual type: [[a]] -> [[a]]
+ • In the expression: take 5
+ In a stmt of a list comprehension: then group using take 5
+ In the expression:
+ [() | x <- [Gnorf, Brain], then group using take 5]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail193.stderr b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
index bd8ef5348a..4a96fa4aef 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail193.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail193.stderr
@@ -1,11 +1,12 @@
-
-tcfail193.hs:10:31: error:
- Couldn't match type ‘a’ with ‘[a]’
- ‘a’ is a rigid type variable bound by
- a type expected by the context:
- forall a. [a] -> [a]
- at tcfail193.hs:10:10
- Expected type: [a] -> [a]
- Actual type: [a] -> [[a]]
- In the expression: inits
- In a stmt of a list comprehension: then inits
+
+tcfail193.hs:10:31: error:
+ • Couldn't match type ‘a’ with ‘[a]’
+ ‘a’ is a rigid type variable bound by
+ a type expected by the context:
+ forall a. [a] -> [a]
+ at tcfail193.hs:10:10
+ Expected type: [a] -> [a]
+ Actual type: [a] -> [[a]]
+ • In the expression: inits
+ In a stmt of a list comprehension: then inits
+ In the expression: [x | x <- [3, 2, 1], then inits]
diff --git a/testsuite/tests/typecheck/should_fail/tcfail198.stderr b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
index 58cf260593..88469939f3 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail198.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail198.stderr
@@ -1,13 +1,15 @@
-
-tcfail198.hs:6:36: error:
- Couldn't match expected type ‘a2’ with actual type ‘a1’
- because type variable ‘a2’ would escape its scope
- This (rigid, skolem) type variable is bound by
- an expression type signature: a2
- at tcfail198.hs:6:36-41
- In the expression: x :: a
- In the second argument of ‘(++)’, namely ‘[x :: a]’
- Relevant bindings include
- xs :: [a1] (bound at tcfail198.hs:6:21)
- x :: a1 (bound at tcfail198.hs:6:19)
- f3 :: [a1] -> [a1] (bound at tcfail198.hs:6:6)
+
+tcfail198.hs:6:36: error:
+ • Couldn't match expected type ‘a2’ with actual type ‘a1’
+ because type variable ‘a2’ would escape its scope
+ This (rigid, skolem) type variable is bound by
+ an expression type signature:
+ a2
+ at tcfail198.hs:6:36-41
+ • In the expression: x :: a
+ In the second argument of ‘(++)’, namely ‘[x :: a]’
+ In the expression: xs ++ [x :: a]
+ • Relevant bindings include
+ xs :: [a1] (bound at tcfail198.hs:6:21)
+ x :: a1 (bound at tcfail198.hs:6:19)
+ f3 :: [a1] -> [a1] (bound at tcfail198.hs:6:6)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail201.stderr b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
index c19aa0c274..9aef660dbd 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail201.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail201.stderr
@@ -1,14 +1,17 @@
-tcfail201.hs:17:58: error:
- • Couldn't match expected type ‘a’ with actual type ‘HsDoc id0’
+tcfail201.hs:17:56: error:
+ • Couldn't match type ‘a’ with ‘HsDoc id0’
‘a’ is a rigid type variable bound by
the type signature for:
gfoldl' :: forall (c :: * -> *) a.
(forall a1 b. c (a1 -> b) -> a1 -> c b)
-> (forall g. g -> c g) -> a -> c a
at tcfail201.hs:15:12
- • In the first argument of ‘z’, namely ‘DocEmpty’
- In the expression: z DocEmpty
+ Expected type: c a
+ Actual type: c (HsDoc id0)
+ • In the expression: z DocEmpty
+ In a case alternative: DocEmpty -> z DocEmpty
+ In the expression: case hsDoc of { DocEmpty -> z DocEmpty }
• Relevant bindings include
hsDoc :: a (bound at tcfail201.hs:16:13)
gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail204.stderr b/testsuite/tests/typecheck/should_fail/tcfail204.stderr
index b6ef584387..f4b6ec791b 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail204.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail204.stderr
@@ -4,7 +4,7 @@ tcfail204.hs:10:15: warning:
(Fractional a0)
arising from the literal ‘6.3’ at tcfail204.hs:10:15-17
(RealFrac a0)
- arising from a use of ‘ceiling’ at tcfail204.hs:10:7-13
+ arising from a use of ‘ceiling’ at tcfail204.hs:10:7-17
• In the first argument of ‘ceiling’, namely ‘6.3’
In the expression: ceiling 6.3
In an equation for ‘foo’: foo = ceiling 6.3
diff --git a/testsuite/tests/typecheck/should_fail/tcfail206.stderr b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
index 687619c9eb..e60856aaf9 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail206.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail206.stderr
@@ -1,55 +1,55 @@
-
-tcfail206.hs:5:5: error:
- Couldn't match type ‘Bool’ with ‘Int’
- Expected type: Bool -> (Int, Bool)
- Actual type: Bool -> (Bool, Bool)
- In the expression: (, True)
- In an equation for ‘a’: a = (, True)
-
-tcfail206.hs:8:5: error:
- Couldn't match type ‘(Integer, Int)’ with ‘Bool -> (Int, Bool)’
- Expected type: Int -> Bool -> (Int, Bool)
- Actual type: Int -> (Integer, Int)
- In the expression: (1,)
- In an equation for ‘b’: b = (1,)
-
-tcfail206.hs:11:5: error:
- Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- c :: forall a. a -> (a, Bool)
- at tcfail206.hs:10:6
- Expected type: a -> (a, Bool)
- Actual type: a -> (a, a)
- In the expression: (True || False,)
- In an equation for ‘c’: c = (True || False,)
- Relevant bindings include
- c :: a -> (a, Bool) (bound at tcfail206.hs:11:1)
-
-tcfail206.hs:14:5: error:
- Couldn't match type ‘Bool’ with ‘Int’
- Expected type: Bool -> (# Int, Bool #)
- Actual type: Bool -> (# Bool, Bool #)
- In the expression: (# , True #)
- In an equation for ‘d’: d = (# , True #)
-
-tcfail206.hs:17:5: error:
- Couldn't match type ‘(# Integer, Int #)’
- with ‘Bool -> (# Int, Bool #)’
- Expected type: Int -> Bool -> (# Int, Bool #)
- Actual type: Int -> (# Integer, Int #)
- In the expression: (# 1, #)
- In an equation for ‘e’: e = (# 1, #)
-
-tcfail206.hs:20:5: error:
- Couldn't match type ‘a’ with ‘Bool’
- ‘a’ is a rigid type variable bound by
- the type signature for:
- f :: forall a. a -> (# a, Bool #)
- at tcfail206.hs:19:6
- Expected type: a -> (# a, Bool #)
- Actual type: a -> (# a, a #)
- In the expression: (# True || False, #)
- In an equation for ‘f’: f = (# True || False, #)
- Relevant bindings include
- f :: a -> (# a, Bool #) (bound at tcfail206.hs:20:1)
+
+tcfail206.hs:5:5: error:
+ • Couldn't match type ‘Bool’ with ‘Int’
+ Expected type: Bool -> (Int, Bool)
+ Actual type: Int -> (Int, Bool)
+ • In the expression: (, True)
+ In an equation for ‘a’: a = (, True)
+
+tcfail206.hs:8:5: error:
+ • Couldn't match type ‘(Integer, Int)’ with ‘Bool -> (Int, Bool)’
+ Expected type: Int -> Bool -> (Int, Bool)
+ Actual type: Int -> (Integer, Int)
+ • In the expression: (1,)
+ In an equation for ‘b’: b = (1,)
+
+tcfail206.hs:11:5: error:
+ • Couldn't match type ‘a’ with ‘Bool’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ c :: forall a. a -> (a, Bool)
+ at tcfail206.hs:10:6
+ Expected type: a -> (a, Bool)
+ Actual type: Bool -> (a, Bool)
+ • In the expression: (True || False,)
+ In an equation for ‘c’: c = (True || False,)
+ • Relevant bindings include
+ c :: a -> (a, Bool) (bound at tcfail206.hs:11:1)
+
+tcfail206.hs:14:5: error:
+ • Couldn't match type ‘Bool’ with ‘Int’
+ Expected type: Bool -> (# Int, Bool #)
+ Actual type: Int -> (# Int, Bool #)
+ • In the expression: (# , True #)
+ In an equation for ‘d’: d = (# , True #)
+
+tcfail206.hs:17:5: error:
+ • Couldn't match type ‘(# Integer, Int #)’
+ with ‘Bool -> (# Int, Bool #)’
+ Expected type: Int -> Bool -> (# Int, Bool #)
+ Actual type: Int -> (# Integer, Int #)
+ • In the expression: (# 1, #)
+ In an equation for ‘e’: e = (# 1, #)
+
+tcfail206.hs:20:5: error:
+ • Couldn't match type ‘a’ with ‘Bool’
+ ‘a’ is a rigid type variable bound by
+ the type signature for:
+ f :: forall a. a -> (# a, Bool #)
+ at tcfail206.hs:19:6
+ Expected type: a -> (# a, Bool #)
+ Actual type: Bool -> (# a, Bool #)
+ • In the expression: (# True || False, #)
+ In an equation for ‘f’: f = (# True || False, #)
+ • Relevant bindings include
+ f :: a -> (# a, Bool #) (bound at tcfail206.hs:20:1)
diff --git a/testsuite/tests/typecheck/should_fail/tcfail208.stderr b/testsuite/tests/typecheck/should_fail/tcfail208.stderr
index dd290d942c..45642a7548 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail208.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail208.stderr
@@ -1,9 +1,9 @@
-
-tcfail208.hs:4:19: error:
- Could not deduce (Eq (m a)) arising from a use of ‘==’
- from the context: (Monad m, Eq a)
- bound by the type signature for:
- f :: (Monad m, Eq a) => a -> m a -> Bool
- at tcfail208.hs:3:1-40
- In the expression: (return x == y)
- In an equation for ‘f’: f x y = (return x == y)
+
+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
+ at tcfail208.hs:3:1-40
+ • In the expression: (return x == y)
+ In an equation for ‘f’: f x y = (return x == y)