Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
3,979
Issues
3,979
List
Boards
Labels
Service Desk
Milestones
Merge Requests
321
Merge Requests
321
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
eaccc721
Commit
eaccc721
authored
Nov 21, 2014
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wibbles (usually improvements) to error messages
parent
1b6988e7
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
401 additions
and
327 deletions
+401
-327
testsuite/tests/deriving/should_fail/T5287.stderr
testsuite/tests/deriving/should_fail/T5287.stderr
+2
-2
testsuite/tests/ghci/scripts/Defer02.stderr
testsuite/tests/ghci/scripts/Defer02.stderr
+4
-2
testsuite/tests/ghci/scripts/ghci012.stdout
testsuite/tests/ghci/scripts/ghci012.stdout
+1
-1
testsuite/tests/indexed-types/should_compile/Simple14.hs
testsuite/tests/indexed-types/should_compile/Simple14.hs
+1
-0
testsuite/tests/indexed-types/should_compile/Simple14.stderr
testsuite/tests/indexed-types/should_compile/Simple14.stderr
+14
-15
testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr
testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr
+3
-3
testsuite/tests/indexed-types/should_fail/T1897b.stderr
testsuite/tests/indexed-types/should_fail/T1897b.stderr
+1
-1
testsuite/tests/indexed-types/should_fail/T1900.stderr
testsuite/tests/indexed-types/should_fail/T1900.stderr
+2
-1
testsuite/tests/indexed-types/should_fail/T2693.stderr
testsuite/tests/indexed-types/should_fail/T2693.stderr
+38
-38
testsuite/tests/indexed-types/should_fail/T4093a.stderr
testsuite/tests/indexed-types/should_fail/T4093a.stderr
+2
-1
testsuite/tests/indexed-types/should_fail/T9036.stderr
testsuite/tests/indexed-types/should_fail/T9036.stderr
+5
-4
testsuite/tests/indexed-types/should_fail/T9171.stderr
testsuite/tests/indexed-types/should_fail/T9171.stderr
+22
-22
testsuite/tests/parser/should_fail/T7848.stderr
testsuite/tests/parser/should_fail/T7848.stderr
+29
-2
testsuite/tests/perf/compiler/T5837.stderr
testsuite/tests/perf/compiler/T5837.stderr
+2
-1
testsuite/tests/typecheck/should_compile/T2494.stderr
testsuite/tests/typecheck/should_compile/T2494.stderr
+34
-34
testsuite/tests/typecheck/should_compile/T3692.hs
testsuite/tests/typecheck/should_compile/T3692.hs
+1
-1
testsuite/tests/typecheck/should_compile/T9708.stderr
testsuite/tests/typecheck/should_compile/T9708.stderr
+17
-17
testsuite/tests/typecheck/should_compile/tc168.stderr
testsuite/tests/typecheck/should_compile/tc168.stderr
+10
-11
testsuite/tests/typecheck/should_compile/tc211.hs
testsuite/tests/typecheck/should_compile/tc211.hs
+3
-0
testsuite/tests/typecheck/should_compile/tc211.stderr
testsuite/tests/typecheck/should_compile/tc211.stderr
+61
-25
testsuite/tests/typecheck/should_fail/ContextStack2.stderr
testsuite/tests/typecheck/should_fail/ContextStack2.stderr
+2
-1
testsuite/tests/typecheck/should_fail/T1897a.stderr
testsuite/tests/typecheck/should_fail/T1897a.stderr
+10
-11
testsuite/tests/typecheck/should_fail/T2414.stderr
testsuite/tests/typecheck/should_fail/T2414.stderr
+1
-1
testsuite/tests/typecheck/should_fail/T2534.stderr
testsuite/tests/typecheck/should_fail/T2534.stderr
+6
-6
testsuite/tests/typecheck/should_fail/T3592.stderr
testsuite/tests/typecheck/should_fail/T3592.stderr
+4
-1
testsuite/tests/typecheck/should_fail/T3613.stderr
testsuite/tests/typecheck/should_fail/T3613.stderr
+1
-3
testsuite/tests/typecheck/should_fail/T5236.stderr
testsuite/tests/typecheck/should_fail/T5236.stderr
+11
-10
testsuite/tests/typecheck/should_fail/T5300.stderr
testsuite/tests/typecheck/should_fail/T5300.stderr
+8
-10
testsuite/tests/typecheck/should_fail/T5691.stderr
testsuite/tests/typecheck/should_fail/T5691.stderr
+4
-3
testsuite/tests/typecheck/should_fail/T6069.stderr
testsuite/tests/typecheck/should_fail/T6069.stderr
+9
-9
testsuite/tests/typecheck/should_fail/T7279.stderr
testsuite/tests/typecheck/should_fail/T7279.stderr
+2
-2
testsuite/tests/typecheck/should_fail/T8392a.stderr
testsuite/tests/typecheck/should_fail/T8392a.stderr
+2
-1
testsuite/tests/typecheck/should_fail/T8883.stderr
testsuite/tests/typecheck/should_fail/T8883.stderr
+1
-1
testsuite/tests/typecheck/should_fail/mc21.stderr
testsuite/tests/typecheck/should_fail/mc21.stderr
+9
-9
testsuite/tests/typecheck/should_fail/mc22.stderr
testsuite/tests/typecheck/should_fail/mc22.stderr
+21
-21
testsuite/tests/typecheck/should_fail/mc23.stderr
testsuite/tests/typecheck/should_fail/mc23.stderr
+3
-3
testsuite/tests/typecheck/should_fail/mc24.stderr
testsuite/tests/typecheck/should_fail/mc24.stderr
+9
-8
testsuite/tests/typecheck/should_fail/mc25.stderr
testsuite/tests/typecheck/should_fail/mc25.stderr
+18
-18
testsuite/tests/typecheck/should_fail/tcfail080.stderr
testsuite/tests/typecheck/should_fail/tcfail080.stderr
+10
-11
testsuite/tests/typecheck/should_fail/tcfail097.stderr
testsuite/tests/typecheck/should_fail/tcfail097.stderr
+3
-2
testsuite/tests/typecheck/should_fail/tcfail098.stderr
testsuite/tests/typecheck/should_fail/tcfail098.stderr
+2
-2
testsuite/tests/typecheck/should_fail/tcfail142.stderr
testsuite/tests/typecheck/should_fail/tcfail142.stderr
+2
-2
testsuite/tests/typecheck/should_fail/tcfail174.stderr
testsuite/tests/typecheck/should_fail/tcfail174.stderr
+2
-2
testsuite/tests/typecheck/should_fail/tcfail189.stderr
testsuite/tests/typecheck/should_fail/tcfail189.stderr
+8
-8
testsuite/tests/typecheck/should_fail/tcfail191.stderr
testsuite/tests/typecheck/should_fail/tcfail191.stderr
+1
-1
No files found.
testsuite/tests/deriving/should_fail/T5287.stderr
View file @
eaccc721
T5287.hs:6:10:
Could not deduce (A a oops0)
arising from the ambiguity check for an instance declaration
from the context (A a oops)
bound by an instance declaration: A a oops => Read (D a)
at T5287.hs:6:10-31
The type variable ‘oops0’ is ambiguous
In the ambiguity check for: forall a oops. A a oops => Read (D a)
In the ambiguity check for an instance declaration:
forall a oops. A a oops => Read (D a)
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the instance declaration for ‘Read (D a)’
testsuite/tests/ghci/scripts/Defer02.stderr
View file @
eaccc721
...
...
@@ -83,13 +83,15 @@
Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
the type signature for k :: (Int ~ Bool) => Int -> Bool
In the ambiguity check for: (Int ~ Bool) => Int -> Bool
In the ambiguity check for the type signature for ‘k’:
k :: (Int ~ Bool) => Int -> Bool
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘k’: k :: (Int ~ Bool) => Int -> Bool
../../typecheck/should_run/Defer01.hs:45:6: Warning:
Couldn't match expected type ‘Bool’ with actual type ‘Int’
In the ambiguity check for: (Int ~ Bool) => Int -> Bool
In the ambiguity check for the type signature for ‘k’:
k :: (Int ~ Bool) => Int -> Bool
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘k’: k :: (Int ~ Bool) => Int -> Bool
...
...
testsuite/tests/ghci/scripts/ghci012.stdout
View file @
eaccc721
($$$) :: [
b -> c] -> [b
] -> [c] -- Defined at <interactive>:2:8
($$$) :: [
a -> c] -> [a
] -> [c] -- Defined at <interactive>:2:8
testsuite/tests/indexed-types/should_compile/Simple14.hs
View file @
eaccc721
...
...
@@ -4,6 +4,7 @@ module Simple14 where
data
EQ_
x
y
=
EQ_
-- Nov 2014: actually eqE has an ambiguous type
eqE
::
EQ_
x
y
->
(
x
~
y
=>
EQ_
z
z
)
->
p
eqE
=
error
"eqE"
...
...
testsuite/tests/indexed-types/should_compile/Simple14.stderr
View file @
eaccc721
Simple14.hs:
17:19
:
Couldn't match type ‘z0’ with ‘
m
’
Simple14.hs:
8:8
:
Couldn't match type ‘z0’ with ‘
z
’
‘z0’ is untouchable
inside the constraints (Maybe m ~ Maybe n)
bound by a type expected by the context:
(Maybe m ~ Maybe n) => EQ_ z0 z0
at Simple14.hs:17:12-33
‘m’ is a rigid type variable bound by
the type signature for foo :: EQ_ (Maybe m) (Maybe n)
at Simple14.hs:16:15
inside the constraints (x ~ y)
bound by the type signature for eqE :: (x ~ y) => EQ_ z0 z0
at Simple14.hs:8:8-39
‘z’ is a rigid type variable bound by
the type signature for eqE :: EQ_ x y -> ((x ~ y) => EQ_ z z) -> p
at Simple14.hs:8:8
Expected type: EQ_ z0 z0
Actual type: EQ_
m n
Relevant bindings include
foo :: EQ_ (Maybe m) (Maybe n) (bound at Simple14.hs:17:1)
In the second argument of ‘eqE’, namely ‘(eqI :: EQ_ m n)’
In the
first argument of ‘ntI’, namely ‘(`eqE` (eqI :: EQ_ m n))’
In the expression: ntI (`eqE` (eqI :: EQ_ m n))
Actual type: EQ_
z z
In the ambiguity check for the type signature for ‘eqE’:
eqE :: forall x y z p. EQ_ x y -> ((x ~ y) => EQ_ z z) -> p
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the
type signature for ‘eqE’:
eqE :: EQ_ x y -> (x ~ y => EQ_ z z) -> p
testsuite/tests/indexed-types/should_fail/NoMatchErr.stderr
View file @
eaccc721
NoMatchErr.hs:19:7:
Couldn't match type ‘Memo d
’ with ‘Memo d0
’
Couldn't match type ‘Memo d
0’ with ‘Memo d
’
NB: ‘Memo’ is a type function, and may not be injective
The type variable ‘d0’ is ambiguous
Expected type: Memo d a -> Memo d a
Actual type: Memo d0 a -> Memo d0 a
In the ambiguity check for:
forall d a. Fun d => Memo d a -> Memo d a
In the ambiguity check for
the type signature for ‘f’
:
f
:: f
orall d a. Fun d => Memo d a -> Memo d a
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘f’: f :: (Fun d) => Memo d a -> Memo d a
testsuite/tests/indexed-types/should_fail/T1897b.stderr
View file @
eaccc721
T1897b.hs:16:1:
Couldn't match type ‘Depend a
’ with ‘Depend a0
’
Couldn't match type ‘Depend a
0’ with ‘Depend a
’
NB: ‘Depend’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
Expected type: t (Depend a) -> Bool
...
...
testsuite/tests/indexed-types/should_fail/T1900.stderr
View file @
eaccc721
...
...
@@ -5,7 +5,8 @@ T1900.hs:13:10:
The type variable ‘s0’ is ambiguous
Expected type: Depend s -> Bool
Actual type: Depend s0 -> Bool
In the ambiguity check for: forall s. Bug s => Depend s -> Bool
In the ambiguity check for the type signature for ‘check’:
check :: forall s. Bug s => Depend s -> Bool
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘check’:
check :: (Bug s) => Depend s -> Bool
testsuite/tests/indexed-types/should_fail/T2693.stderr
View file @
eaccc721
T2693.hs:11:7:
Couldn't match expected type ‘TFn a’ with actual type ‘TFn a0’
NB: ‘TFn’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
When checking that ‘x’ has the inferred type
x :: forall a. TFn a
Probable cause: the inferred type is ambiguous
In the expression:
do { let Just x = ...;
let n = fst x + fst x;
return () }
In an equation for ‘f’:
f = do { let Just x = ...;
let n = ...;
return () }
T2693.hs:19:15:
Couldn't match expected type ‘(a
5, b0)’ with actual type ‘TFn a2’
The type variables ‘
b0’, ‘a2’, ‘a5’ are ambiguous
Relevant bindings include n :: a
5 (bound at T2693.hs:19:7)
In the first argument of ‘fst’, namely ‘x’
In the first argument of ‘(+)’, namely ‘fst x’
T2693.hs:19:23:
Couldn't match expected type ‘(a
3, a5)’ with actual type ‘TFn a4’
The type variables ‘a
3’, ‘a4’, ‘a5’ are ambiguous
Relevant bindings include n :: a
5 (bound at T2693.hs:19:7)
In the first argument of ‘snd’, namely ‘x’
In the second argument of ‘(+)’, namely ‘snd x’
T2693.hs:29:20:
Couldn't match type ‘TFn a0’ with ‘PVR a1’
The type variables ‘a0’, ‘a1’ are ambiguous
Expected type: () -> Maybe (PVR a1)
Actual type: () -> Maybe (TFn a0)
In the first argument of ‘mapM’, namely ‘g’
In a stmt of a 'do' block: pvs <- mapM g undefined
T2693.hs:11:7:
Couldn't match expected type ‘TFn a’ with actual type ‘TFn a0’
NB: ‘TFn’ is a type function, and may not be injective
The type variable ‘a0’ is ambiguous
When checking that ‘x’ has the inferred type
x :: forall a. TFn a
Probable cause: the inferred type is ambiguous
In the expression:
do { let Just x = ...;
let n = fst x + fst x;
return () }
In an equation for ‘f’:
f = do { let Just x = ...;
let n = ...;
return () }
T2693.hs:19:15:
Couldn't match expected type ‘(a
2, b0)’ with actual type ‘TFn a3’
The type variables ‘
a2’, ‘b0’, ‘a3’ are ambiguous
Relevant bindings include n :: a
2 (bound at T2693.hs:19:7)
In the first argument of ‘fst’, namely ‘x’
In the first argument of ‘(+)’, namely ‘fst x’
T2693.hs:19:23:
Couldn't match expected type ‘(a
4, a2)’ with actual type ‘TFn a5’
The type variables ‘a
2’, ‘a4’, ‘a5’ are ambiguous
Relevant bindings include n :: a
2 (bound at T2693.hs:19:7)
In the first argument of ‘snd’, namely ‘x’
In the second argument of ‘(+)’, namely ‘snd x’
T2693.hs:29:20:
Couldn't match type ‘TFn a0’ with ‘PVR a1’
The type variables ‘a0’, ‘a1’ are ambiguous
Expected type: () -> Maybe (PVR a1)
Actual type: () -> Maybe (TFn a0)
In the first argument of ‘mapM’, namely ‘g’
In a stmt of a 'do' block: pvs <- mapM g undefined
testsuite/tests/indexed-types/should_fail/T4093a.stderr
View file @
eaccc721
...
...
@@ -5,7 +5,8 @@ T4093a.hs:7:9:
bound by the type signature for hang :: (Foo e ~ Maybe e) => Foo e
at T4093a.hs:7:9-34
The type variable ‘e0’ is ambiguous
In the ambiguity check for: forall e. (Foo e ~ Maybe e) => Foo e
In the ambiguity check for the type signature for ‘hang’:
hang :: forall e. (Foo e ~ Maybe e) => Foo e
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘hang’:
hang :: (Foo e ~ Maybe e) => Foo e
testsuite/tests/indexed-types/should_fail/T9036.stderr
View file @
eaccc721
T9036.hs:17:17:
Couldn't match type ‘
Curried t [t]’ with ‘Curried t0 [t0]
’
NB: ‘
Currie
d’ is a type function, and may not be injective
Couldn't match type ‘
GetMonad t0’ with ‘GetMonad t
’
NB: ‘
GetMona
d’ is a type function, and may not be injective
The type variable ‘t0’ is ambiguous
Expected type: Maybe (GetMonad t after) -> Curried t [t]
Actual type: Maybe (GetMonad t0 after) -> Curried t0 [t0]
In the ambiguity check for:
forall t after. Maybe (GetMonad t after) -> Curried t [t]
In the ambiguity check for the type signature for ‘simpleLogger’:
simpleLogger :: forall t after.
Maybe (GetMonad t after) -> Curried t [t]
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘simpleLogger’:
simpleLogger :: Maybe (GetMonad t after) -> t `Curried` [t]
testsuite/tests/indexed-types/should_fail/T9171.stderr
View file @
eaccc721
T9171.hs:10:1:
Couldn't match expected type ‘GetParam Base (GetParam Base Int)’
with actual type ‘GetParam Base (GetParam Base Int)’
NB: ‘GetParam’ is a type function, and may not be injective
The kind variable ‘k0’ is ambiguous
Use -fprint-explicit-kinds to see the kind arguments
When checking that ‘foo’ has the inferred type
foo :: forall (k :: BOX). GetParam Base (GetParam Base Int)
Probable cause: the inferred type is ambiguous
T9171.hs:10:20:
Couldn't match expected type ‘GetParam Base (GetParam Base Int)’
with actual type ‘GetParam Base (GetParam Base Int)’
NB: ‘GetParam’ is a type function, and may not be injective
The kind variable ‘k0’ is ambiguous
Use -fprint-explicit-kinds to see the kind arguments
In the ambiguity check for
:
forall (k :: BOX). GetParam Base (GetParam Base Int)
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In an expression type signature: GetParam Base (GetParam Base Int)
In the expression: undefined :: GetParam Base (GetParam Base Int)
T9171.hs:10:1:
Couldn't match expected type ‘GetParam Base (GetParam Base Int)’
with actual type ‘GetParam Base (GetParam Base Int)’
NB: ‘GetParam’ is a type function, and may not be injective
The kind variable ‘k0’ is ambiguous
Use -fprint-explicit-kinds to see the kind arguments
When checking that ‘foo’ has the inferred type
foo :: forall (k :: BOX). GetParam Base (GetParam Base Int)
Probable cause: the inferred type is ambiguous
T9171.hs:10:20:
Couldn't match expected type ‘GetParam Base (GetParam Base Int)’
with actual type ‘GetParam Base (GetParam Base Int)’
NB: ‘GetParam’ is a type function, and may not be injective
The kind variable ‘k0’ is ambiguous
Use -fprint-explicit-kinds to see the kind arguments
In the ambiguity check for
an expression type signature:
forall (k :: BOX). GetParam Base (GetParam Base Int)
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In an expression type signature: GetParam Base (GetParam Base Int)
In the expression: undefined :: GetParam Base (GetParam Base Int)
testsuite/tests/parser/should_fail/T7848.stderr
View file @
eaccc721
T7848.hs:6:57:
Occurs check: cannot construct the infinite type:
t2 ~ t0 -> t -> t1 -> A -> A -> A -> A -> t2
Relevant bindings include
y :: forall t3. t3 -> t -> t1 -> A -> A -> A -> A -> t2
(bound at T7848.hs:8:9)
(&) :: t -> t1 -> A -> A -> A -> A -> t2 (bound at T7848.hs:11:9)
z :: t1 (bound at T7848.hs:6:12)
(&) :: t1 (bound at T7848.hs:6:8)
(+) :: t (bound at T7848.hs:6:3)
x :: t -> t1 -> A -> A -> A -> A -> t2 (bound at T7848.hs:6:1)
In the expression: y
In an equation for ‘x’:
x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h)
= y
where
infixl 3 `y`
y _ = (&)
{-# INLINE (&) #-}
{-# SPECIALIZE (&) :: a #-}
(&) = x
T7848.hs:10:9:
Couldn't match expected type ‘forall a. a’
with actual type ‘t -> t1 -> A -> A -> A -> A -> t2’
Couldn't match type ‘a’ with ‘t -> t1 -> A -> A -> A -> A -> t2’
‘a’ is a rigid type variable bound by
the type signature for (&) :: a at T7848.hs:10:9
Expected type: forall a. a
Actual type: t -> t1 -> A -> A -> A -> A -> t2
Relevant bindings include
z :: t1 (bound at T7848.hs:6:12)
(&) :: t1 (bound at T7848.hs:6:8)
(+) :: t (bound at T7848.hs:6:3)
x :: t -> t1 -> A -> A -> A -> A -> t2 (bound at T7848.hs:6:1)
When checking that: t -> t1 -> A -> A -> A -> A -> t2
is more polymorphic than: forall a. a
In the SPECIALISE pragma {-# SPECIALIZE (&) :: a #-}
In an equation for ‘x’:
x (+) ((&)@z) ((:&&) a b) (c :&& d) (e `A` f) (A g h)
...
...
testsuite/tests/perf/compiler/T5837.stderr
View file @
eaccc721
...
...
@@ -157,5 +157,6 @@ T5837.hs:8:6:
(TF
(TF
Int)))))))))))))))))))))))))))))))))))))))))))))))))))
In the ambiguity check for: forall a. (a ~ TF (a, Int)) => Int
In the ambiguity check for the type signature for ‘t’:
t :: forall a. (a ~ TF (a, Int)) => Int
In the type signature for ‘t’: t :: (a ~ TF (a, Int)) => Int
testsuite/tests/typecheck/should_compile/T2494.stderr
View file @
eaccc721
T2494.hs:15:14:
Couldn't match type ‘b’ with ‘a’
‘b’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:14:16
‘a’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:13:16
Expected type: Maybe (m a) -> Maybe (m a)
Actual type: Maybe (m b) -> Maybe (m b)
Relevant bindings include
f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
(bound at T2494.hs:13:11)
g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
(bound at T2494.hs:14:11)
x :: Maybe a (bound at T2494.hs:14:65)
In the first argument of ‘foo’, namely ‘g’
In the second argument of ‘foo’, namely ‘(foo g x)’
T2494.hs:15:30:
Couldn't match type ‘b’ with ‘a’
‘b’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:14:16
‘a’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:13:16
Expected type: Maybe (m a) -> Maybe (m a)
Actual type: Maybe (m b) -> Maybe (m b)
Relevant bindings include
f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
(bound at T2494.hs:13:11)
g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
(bound at T2494.hs:14:11)
x :: Maybe a (bound at T2494.hs:14:65)
In the second argument of ‘(.)’, namely ‘g’
In the first argument of ‘foo’, namely ‘(f . g)’
T2494.hs:15:14:
Couldn't match type ‘b’ with ‘a’
‘b’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:14:16
‘a’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:13:16
Expected type: Maybe (m a) -> Maybe (m a)
Actual type: Maybe (m b) -> Maybe (m b)
Relevant bindings include
f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
(bound at T2494.hs:13:11)
g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
(bound at T2494.hs:14:11)
x :: Maybe a (bound at T2494.hs:14:65)
In the first argument of ‘foo’, namely ‘g’
In the second argument of ‘foo’, namely ‘(foo g x)’
T2494.hs:15:30:
Couldn't match type ‘b’ with ‘a’
‘b’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:14:16
‘a’ is a rigid type variable bound by
the RULE "foo/foo" at T2494.hs:13:16
Expected type: Maybe (m a) -> Maybe (m a)
Actual type: Maybe (m b) -> Maybe (m b)
Relevant bindings include
f :: forall (m :: * -> *). Monad m => Maybe (m a) -> Maybe (m a)
(bound at T2494.hs:13:11)
g :: forall (m :: * -> *). Monad m => Maybe (m b) -> Maybe (m b)
(bound at T2494.hs:14:11)
x :: Maybe a (bound at T2494.hs:14:65)
In the second argument of ‘(.)’, namely ‘g’
In the first argument of ‘foo’, namely ‘(f . g)’
testsuite/tests/typecheck/should_compile/T3692.hs
View file @
eaccc721
...
...
@@ -7,4 +7,4 @@ type Foo a b = () -> (Bar a => a)
class
Bar
a
where
{}
foo
::
Foo
a
b
foo
=
id
(
undefined
::
Foo
a
b
)
foo
=
id
(
undefined
::
Foo
p
q
)
testsuite/tests/typecheck/should_compile/T9708.stderr
View file @
eaccc721
T9708.hs:9:8:
Could not deduce (SomeFun
x ~ SomeFun y)
from the context (x <= y, y <= x)
bound by the type signature for
ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> ()
at T9708.hs:9:8-61
NB: ‘SomeFun’ is a type function, and may not be injective
Expected type: Proxy (SomeFun x) -> Proxy y -> ()
Actual type: Proxy (SomeFun y) -> Proxy y -> ()
In the ambiguity check for
:
forall (x :: Nat) (y :: Nat).
(x <= y, y <= x) =>
Proxy (SomeFun x) -> Proxy y -> ()
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘ti7’:
ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> ()
T9708.hs:9:8:
Could not deduce (SomeFun
y ~ SomeFun x)
from the context (x <= y, y <= x)
bound by the type signature for
ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> ()
at T9708.hs:9:8-61
NB: ‘SomeFun’ is a type function, and may not be injective
Expected type: Proxy (SomeFun x) -> Proxy y -> ()
Actual type: Proxy (SomeFun y) -> Proxy y -> ()
In the ambiguity check for
the type signature for ‘ti7’:
ti7 :: forall (x :: Nat) (y :: Nat).
(x <= y, y <= x) =>
Proxy (SomeFun x) -> Proxy y -> ()
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘ti7’:
ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> ()
testsuite/tests/typecheck/should_compile/tc168.stderr
View file @
eaccc721
tc168.hs:17:1:
Could not deduce (C a1 (a, b0))
arising from the ambiguity check for ‘g’
from the context (C a1 (a, b))
bound by the inferred type for ‘g’: C a1 (a, b) => a1 -> a
at tc168.hs:17:1-16
The type variable ‘b0’ is ambiguous
When checking that ‘g’ has the inferred type
g :: forall a b a1. C a1 (a, b) => a1 -> a
Probable cause: the inferred type is ambiguous
tc168.hs:17:1:
Could not deduce (C a1 (a, b0))
from the context (C a1 (a, b))
bound by the inferred type for ‘g’: C a1 (a, b) => a1 -> a
at tc168.hs:17:1-16
The type variable ‘b0’ is ambiguous
When checking that ‘g’ has the inferred type
g :: forall a b a1. C a1 (a, b) => a1 -> a
Probable cause: the inferred type is ambiguous
testsuite/tests/typecheck/should_compile/tc211.hs
View file @
eaccc721
{-# OPTIONS_GHC -XImpredicativeTypes -fno-warn-deprecated-flags -XScopedTypeVariables -XGADTs #-}
-- Nov 2014: impredicative types are very dodgy so I am
-- FAR from confident that these tests give the right errors
-- Here are a bunch of tests for impredicative polymorphism
-- mainly written by Dimitrios
...
...
testsuite/tests/typecheck/should_compile/tc211.stderr
View file @
eaccc721
tc211.hs:15:22:
Couldn't match type ‘forall a1. a1 -> a1’ with ‘a -> a’
Expected type: [a -> a]
Actual type: [forall a. a -> a]
In the first argument of ‘head’, namely ‘foo’
In the first argument of ‘(:) ::
(forall a. a -> a)
-> [forall a. a -> a] -> [forall a. a -> a]’, namely
‘(head foo)’
tc211.hs:70:9:
Couldn't match type ‘forall a2. a2 -> a2’ with ‘a1 -> a1’
Expected type: List (forall a. a -> a)
-> (forall a. a -> a) -> a1 -> a1
Actual type: List (forall a. a -> a)
-> (forall a. a -> a) -> forall a. a -> a
In the expression:
foo2 ::
List (forall a. a -> a) -> (forall a. a -> a) -> (forall a. a -> a)
In the expression:
(foo2 ::
List (forall a. a -> a)
-> (forall a. a -> a) -> (forall a. a -> a))
xs1 (\ x -> x)
tc211.hs:17:8:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a2 -> a2’
In the expression:
(:) ::
(forall a. a -> a) -> [forall a. a -> a] -> [forall a. a -> a]
In the expression:
((:) ::
(forall a. a -> a) -> [forall a. a -> a] -> [forall a. a -> a])
(head foo) foo
tc211.hs:18:22:
Couldn't match type ‘forall a3. a3 -> a3’ with ‘a -> a’
Expected type: [a -> a]
Actual type: [forall a. a -> a]
In the first argument of ‘head’, namely ‘foo’
In the first argument of ‘(:) ::
(forall a. a -> a)
-> [forall a. a -> a] -> [forall a. a -> a]’, namely
‘(head foo)’
tc211.hs:59:18:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a1 -> a1’
In the expression:
Cons ::
(forall a. a -> a)
-> List (forall a. a -> a) -> List (forall a. a -> a)
In an equation for ‘cons’:
cons
= Cons ::
(forall a. a -> a)
-> List (forall a. a -> a) -> List (forall a. a -> a)
tc211.hs:65:8:
Couldn't match expected type ‘forall a. a -> a’
with actual type ‘a0 -> a0’
In the expression:
Cons ::
(forall a. a -> a)
-> List (forall a. a -> a) -> List (forall a. a -> a)
In the expression:
(Cons ::
(forall a. a -> a)
-> List (forall a. a -> a) -> List (forall a. a -> a))
(\ x -> x) Nil
tc211.hs:73:9:
Couldn't match type ‘forall a4. a4 -> a4’ with ‘a3 -> a3’
Expected type: List (forall a. a -> a)
-> (forall a. a -> a) -> a3 -> a3
Actual type: List (a3 -> a3) -> (a3 -> a3) -> a3 -> a3
In the expression:
foo2 ::
List (forall a. a -> a) -> (forall a. a -> a) -> (forall a. a -> a)
In the expression:
(foo2 ::
List (forall a. a -> a)
-> (forall a. a -> a) -> (forall a. a -> a))
xs1 (\ x -> x)
testsuite/tests/typecheck/should_fail/ContextStack2.stderr
View file @
eaccc721
...
...
@@ -5,5 +5,6 @@ ContextStack2.hs:8:6:
TF (TF (TF (TF (TF (TF (TF (TF (TF (TF a)))))))))
~ (TF (TF (TF (TF (TF (TF (TF (TF (TF (TF (TF a)))))))))),
TF (TF (TF (TF (TF (TF (TF (TF (TF (TF (TF Int)))))))))))
In the ambiguity check for: forall a. (a ~ TF (a, Int)) => Int
In the ambiguity check for the type signature for ‘t’:
t :: forall a. (a ~ TF (a, Int)) => Int
In the type signature for ‘t’: t :: (a ~ TF (a, Int)) => Int
testsuite/tests/typecheck/should_fail/T1897a.stderr
View file @
eaccc721
T1897a.hs:9:1:
Could not deduce (Wob a0 b)
arising from the ambiguity check for ‘foo’
from the context (Wob a b)
bound by the inferred type for ‘foo’: Wob a b => b -> [b]
at T1897a.hs:9:1-24
The type variable ‘a0’ is ambiguous
When checking that ‘foo’ has the inferred type
foo :: forall a b. Wob a b => b -> [b]
Probable cause: the inferred type is ambiguous
T1897a.hs:9:1:
Could not deduce (Wob a0 b)
from the context (Wob a b)
bound by the inferred type for ‘foo’: Wob a b => b -> [b]
at T1897a.hs:9:1-24
The type variable ‘a0’ is ambiguous
When checking that ‘foo’ has the inferred type
foo :: forall a b. Wob a b => b -> [b]
Probable cause: the inferred type is ambiguous
testsuite/tests/typecheck/should_fail/T2414.stderr
View file @
eaccc721
...
...
@@ -2,6 +2,6 @@
T2414.hs:9:13:
Occurs check: cannot construct the infinite type: b0 ~ (Bool, b0)
Expected type: b0 -> Maybe (Bool, b0)
Actual type:
b0 -> Maybe b0
Actual type:
(Bool, b0) -> Maybe (Bool, b0)
In the first argument of ‘unfoldr’, namely ‘Just’
In the expression: unfoldr Just
testsuite/tests/typecheck/should_fail/T2534.stderr
View file @
eaccc721
T2534.hs:3:19:
Couldn't match expected type ‘a -> a -> b’ with actual type ‘[t0]’
Relevant bindings include
foo :: a -> a -> b (bound at T2534.hs:3:1)
In the second argument of ‘foldr’, namely ‘[]’
T2534.hs:3:13:
Couldn't match type ‘[b]’ with ‘a0 -> [b]’
Expected type: [a0] -> [b] -> [b]
Actual type: [a0] -> (a0 -> [b]) -> [b]
Relevant bindings include foo :: [b] (bound at T2534.hs:3:1)
In the first argument of ‘foldr’, namely ‘(>>=)’
In the expression: foldr (>>=) [] []
In an equation for ‘foo’: foo = foldr (>>=) [] []
testsuite/tests/typecheck/should_fail/T3592.stderr
View file @
eaccc721
T3592.hs:8:5:
No instance for (Show (T a)) arising from a use of ‘show’
No instance for (Show a) arising from a use of ‘show’
Possible fix:
add (Show a) to the context of
the type signature for f :: T a -> String
In the expression: show
In an equation for ‘f’: f = show
...
...
testsuite/tests/typecheck/should_fail/T3613.stderr
View file @
eaccc721
...
...
@@ -7,9 +7,7 @@ T3613.hs:14:20:
In the first argument of ‘fooThen’, namely ‘(bar >> undefined)’
T3613.hs:17:24:
Couldn't match type ‘IO’ with ‘Maybe’
Expected type: Maybe ()
Actual type: IO ()
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;
...
...
testsuite/tests/typecheck/should_fail/T5236.stderr
View file @
eaccc721
T5236.hs:13:9:
Couldn't match type ‘B’ with ‘A’
arising from a functional dependency between:
constraint ‘Id A B’
arising from the type signature for loop :: Id A B => Bool
instance ‘Id B B’ at T5236.hs:11:10-15
In the ambiguity check for: Id A B => Bool
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘loop’: loop :: Id A B => Bool
T5236.hs:13:9:
Couldn't match type ‘B’ with ‘A’
arising from a functional dependency between:
constraint ‘Id A B’
arising from the type signature for loop :: Id A B => Bool
instance ‘Id B B’ at T5236.hs:11:10-15
In the ambiguity check for the type signature for ‘loop’:
loop :: Id A B => Bool
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘loop’: loop :: Id A B => Bool
testsuite/tests/typecheck/should_fail/T5300.stderr
View file @
eaccc721
T5300.hs:11:7:
Could not deduce (C1 a b c0)
arising from the ambiguity check for ‘f1’
from the context (Monad m, C1 a b c)
bound by the type signature for
f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
at T5300.hs:11:7-50
The type variable ‘c0’ is ambiguous
In the ambiguity check for:
forall a b (m :: * -> *) c.
(Monad m, C1 a b c) =>
a -> StateT (T b) m a
In the ambiguity check for
the type signature for ‘f1’
:
f
1 :: f
orall a b (m :: * -> *) c.
(Monad m, C1 a b c) =>
a -> StateT (T b) m a
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘f1’:
f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
T5300.hs:14:7:
Could not deduce (C2 a2 b2 c20)
arising from the ambiguity check for ‘f2’
from the context (Monad m, C1 a1 b1 c1, C2 a2 b2 c2)
bound by the type signature for
f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
at T5300.hs:14:7-69
The type variable ‘c20’ is ambiguous
In the ambiguity check for:
forall a1 b2 (m :: * -> *) a2 b1 c1 c2.
(Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
In the ambiguity check for
the type signature for ‘f2’
:
f
2 :: f
orall a1 b2 (m :: * -> *) a2 b1 c1 c2.
(Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
a1 -> StateT (T b2) m a2
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the type signature for ‘f2’:
f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) =>
...
...
testsuite/tests/typecheck/should_fail/T5691.stderr
View file @
eaccc721
T5691.hs:14:9:
Couldn't match type ‘p’ with ‘PrintRuleInterp’
Expected type: PrintRuleInterp a
Actual type: p a
Expected type: p a
Actual type: PrintRuleInterp a
When checking that the pattern signature: p a
fits the type of its context: PrintRuleInterp a
In the pattern: f :: p a
In an equation for ‘test’: test (f :: p a) = MkPRI $ printRule_ f
In the instance declaration for ‘Test PrintRuleInterp’
T5691.hs:15:24:
Couldn't match type ‘p’ with ‘PrintRuleInterp’
...
...
testsuite/tests/typecheck/should_fail/T6069.stderr
View file @
eaccc721
T6069.hs:13:15: