Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
8bc6c4a6
Commit
8bc6c4a6
authored
Oct 19, 2012
by
Simon Peyton Jones
Browse files
Improvements to kind error messages, mainly
Also some expected/actual messages are now the right way round
parent
09cdd12b
Changes
39
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/gadt/gadt10.stderr
View file @
8bc6c4a6
gadt10.hs:6:24:
Expecting one more argument to `RInt'
Expected kind `*', but `RInt' has kind `k0 -> *'
In the type `RInt'
In the definition of data constructor `R'
In the data declaration for `RInt'
testsuite/tests/ghci/scripts/ghci050.stderr
View file @
8bc6c4a6
<interactive>:6:49:
Couldn't match expected type `
a
'
with actual type `
ListableElem (a, a)
'
Couldn't match expected type `
ListableElem (a, a)
'
with actual type `
a
'
`a' is a rigid type variable bound by
the instance declaration at <interactive>:6:10
Relevant bindings include
...
...
testsuite/tests/indexed-types/should_fail/GADTwrong1.stderr
View file @
8bc6c4a6
GADTwrong1.hs:12:19:
Could not deduce (a1 ~ b)
from the context (
()
~ Const a1)
from the context (
Const b
~ Const a1)
bound by a pattern with constructor
T :: forall a. a -> T (Const a),
in a case alternative
...
...
testsuite/tests/indexed-types/should_fail/SimpleFail14.stderr
View file @
8bc6c4a6
SimpleFail14.hs:5:15:
Predicate `a ~ a' used as a type
Expected a type, but `a ~ a' has kind `Constraint'
In the type `a ~ a'
In the definition of data constructor `T'
In the data declaration for `T'
testsuite/tests/indexed-types/should_fail/SimpleFail16.stderr
View file @
8bc6c4a6
SimpleFail16.hs:10:12:
Couldn't match expected type `
F ()
' with actual type `
p0 a0
'
Couldn't match expected type `
p0 a0
' with actual type `
F ()
'
The type variables `p0', `a0' are ambiguous
Possible cause: the monomorphism restriction applied to: `bar'
Probable fix: give these definition(s) an explicit type signature
...
...
testsuite/tests/indexed-types/should_fail/T2239.stderr
View file @
8bc6c4a6
...
...
@@ -2,7 +2,7 @@
T2239.hs:47:13:
Couldn't match type `forall b1. MyEq b1 Bool => b1 -> b1'
with `b -> b'
Expected type: (forall b. MyEq b Bool => b -> b) -> b -> b
Expected type: (forall b
1
. MyEq b
1
Bool => b
1
-> b
1
) -> b -> b
Actual type: (forall b. MyEq b Bool => b -> b)
-> forall b. MyEq b Bool => b -> b
In the expression:
...
...
@@ -18,7 +18,7 @@ T2239.hs:47:13:
T2239.hs:50:13:
Couldn't match type `forall b1. b1 ~ Bool => b1 -> b1'
with `Bool -> Bool'
Expected type: (forall b. b ~ Bool => b -> b) -> b -> b
Expected type: (forall b
1
. b
1
~ Bool => b
1
-> b
1
) -> b -> b
Actual type: (forall b. b ~ Bool => b -> b)
-> forall b. b ~ Bool => b -> b
In the expression:
...
...
testsuite/tests/indexed-types/should_fail/T2627b.stderr
View file @
8bc6c4a6
T2627b.hs:20:24:
Couldn't match expected type `Dual (Dual a0)' with actual type `a0'
`a0' is untouchable
inside the constraints (b ~ W a2 b2)
bound by a pattern with constructor
Wr :: forall a b. a -> Comm b -> Comm (W a b),
in an equation for `conn'
at T2627b.hs:20:14-19
Occurs check: cannot construct the infinite type:
a0 ~ Dual (Dual a0)
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
In the expression: conn undefined undefined
In an equation for `conn':
conn (Rd k) (Wr a r) = conn undefined undefined
testsuite/tests/indexed-types/should_fail/T2664.stderr
View file @
8bc6c4a6
...
...
@@ -12,8 +12,8 @@ T2664.hs:31:52:
the instance declaration at T2664.hs:22:10
`a' is a rigid type variable bound by
the instance declaration at T2664.hs:22:10
Expected type:
Dual
(Dual a)
Actual type:
b
Expected type:
IO (PChan b, PChan
(Dual a)
)
Actual type:
IO (PChan (Dual (Dual a)), PChan (Dual a))
Relevant bindings include
newPChan :: IO (PChan (a :*: b), PChan c) (bound at T2664.hs:23:5)
v :: MVar (Either (PChan a) (PChan b)) (bound at T2664.hs:24:9)
...
...
testsuite/tests/indexed-types/should_fail/T2693.stderr
View file @
8bc6c4a6
...
...
@@ -33,15 +33,13 @@ T2693.hs:18:23:
In the second argument of `(+)', namely `snd x'
In the expression: fst x + snd x
T2693.hs:2
8
:2
0
:
T2693.hs:2
9
:2
6
:
Couldn't match type `TFn a0' with `PVR a1'
The type variables `a0', `a1' are ambiguous
Possible fix: add a type signature that fixes these type variable(s)
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
In the expression:
do { pvs <- mapM g undefined;
let n = (map pvrX pvs) `min` (map pvrX pvs);
undefined }
Expected type: [PVR a1]
Actual type: [TFn a0]
Relevant bindings include pvs :: [TFn a0] (bound at T2693.hs:28:8)
In the second argument of `map', namely `pvs'
In the first argument of `min', namely `(map pvrX pvs)'
In the expression: (map pvrX pvs) `min` (map pvrX pvs)
testsuite/tests/indexed-types/should_fail/T5439.stderr
View file @
8bc6c4a6
T5439.hs:83:28:
Couldn't match type `Attempt t0 -> Attempt (HElemOf l0)'
with `Attempt (HElemOf rs)'
Expected type: f (Attempt (HNth n0 l0) -> Attempt (HElemOf l0))
Actual type: f (Attempt (WaitOpResult (WaitOps rs)))
T5439.hs:83:33:
Couldn't match expected type `Attempt (WaitOpResult (WaitOps rs))'
with actual type `Attempt (HNth n0 l0) -> Attempt (HElemOf l0)'
Relevant bindings include
registerWaitOp :: WaitOps rs
-> f (Attempt (WaitOpResult (WaitOps rs))) -> IO Bool
...
...
@@ -13,10 +11,13 @@ T5439.hs:83:28:
(bound at T5439.hs:62:22)
register :: Bool -> Peano n -> WaitOps (HDrop n rs) -> IO Bool
(bound at T5439.hs:65:9)
In the
first
argument of `
complete
', namely
`ev'
In the expression
:
c
om
plete ev
In the
second
argument of `
($)
', namely
`inj $ Failure (e :
:
S
om
eException)'
In a stmt of a 'do' block:
c <- complete ev $ inj $ Failure (e :: SomeException)
In the expression:
do { c <- complete ev $ inj $ Failure (e :: SomeException);
return $ c || not first }
T5439.hs:83:39:
Couldn't match expected type `Peano n0'
...
...
testsuite/tests/indexed-types/should_fail/T6123.stderr
View file @
8bc6c4a6
T6123.hs:10:14:
Couldn't match expected type `a0' with actual type `
Id a0
'
Occurs check: cannot construct the infinite type: a0 ~
Id a0
The type variable `a0' is ambiguous
Possible cause: the monomorphism restriction applied to:
`cundefined'
...
...
testsuite/tests/polykinds/PolyKinds02.stderr
View file @
8bc6c4a6
PolyKinds02.hs:13:16:
Kind mis-match
The second argument of `Vec' should have kind `Nat',
but `Nat' has kind `*'
but `Nat' has kind `*'
In the type signature for `vec': vec :: Vec Nat Nat
testsuite/tests/polykinds/PolyKinds04.stderr
View file @
8bc6c4a6
PolyKinds04.hs:5:16:
Expecting one more argument to `Maybe'
In the type `A Maybe'
In the definition of data constructor `B1'
In the data declaration for `B'
PolyKinds04.hs:5:16:
Expecting one more argument to `Maybe'
The first argument of `A' should have kind `*',
but `Maybe' has kind `* -> *'
In the type `A Maybe'
In the definition of data constructor `B1'
In the data declaration for `B'
testsuite/tests/rename/should_fail/rnfail026.stderr
View file @
8bc6c4a6
rnfail026.hs:16:35:
Kind mis-match
The first argument of `Monad' should have kind `* -> *',
but `Set a' has kind `*'
but `Set a' has kind `*'
In the instance declaration for `Monad (forall a. Eq a => Set a)'
rnfail026.hs:19:10:
...
...
testsuite/tests/typecheck/should_compile/tc211.stderr
View file @
8bc6c4a6
tc211.hs:15:22:
Couldn't match type `forall a
1
. a
1
-> a
1
' with `a -> a'
Couldn't match type `forall a
6
. a
6
-> a
6
' with `a -> a'
Expected type: [a -> a]
Actual type: [forall a. a -> a]
In the first argument of `head', namely `foo'
...
...
@@ -14,9 +14,9 @@ tc211.hs:15:22:
(head foo) foo
tc211.hs:70:9:
Couldn't match type `forall a
2
. a
2
-> a
2
' with `a
1
-> a
1
'
Couldn't match type `forall a
7
. a
7
-> a
7
' with `a
6
-> a
6
'
Expected type: List (forall a. a -> a)
-> (forall a. a -> a) -> a
1
-> a
1
-> (forall a. a -> a) -> a
6
-> a
6
Actual type: List (forall a. a -> a)
-> (forall a. a -> a) -> forall a. a -> a
In the expression:
...
...
testsuite/tests/typecheck/should_fail/AssocTyDef04.stderr
View file @
8bc6c4a6
AssocTyDef04.hs:6:18:
Expecting one more argument to `Maybe'
Expected kind `*', but `Maybe' has kind `* -> *'
In the type `Maybe'
In the type instance declaration for `Typ'
In the class declaration for `Cls'
testsuite/tests/typecheck/should_fail/T1633.stderr
View file @
8bc6c4a6
T1633.hs:6:18:
Kind mis-match
The first argument of `Functor' should have kind `* -> *',
but `Bool' has kind `*'
but `Bool' has kind `*'
In the instance declaration for `Functor Bool'
testsuite/tests/typecheck/should_fail/T2994.stderr
View file @
8bc6c4a6
T2994.hs:11:10:
Expecting one more argument to `MonadReader Int'
Expected a constraint,
but `MonadReader Int' has kind `* -> Constraint'
In the instance declaration for `MonadReader Int'
T2994.hs:13:23:
Expecting one more argument to `Reader' r'
The first argument of `MonadReader' should have kind `*',
but `Reader' r' has kind `* -> *'
In the instance declaration for `MonadReader (Reader' r)'
T2994.hs:15:10:
...
...
testsuite/tests/typecheck/should_fail/T3540.stderr
View file @
8bc6c4a6
T3540.hs:4:12:
Predicate `a ~ Int' used as a type
Expected a type, but `a ~ Int' has kind `Constraint'
In the type signature for `thing': thing :: a ~ Int
T3540.hs:7:20:
Predicate `a ~ Int' used as a type
Expected a type, but `a ~ Int' has kind `Constraint'
In the type signature for `thing1': thing1 :: Int -> (a ~ Int)
T3540.hs:10:13:
Predicate `a ~ Int' used as a type
Expected a type, but `a ~ Int' has kind `Constraint'
In the type signature for `thing2': thing2 :: (a ~ Int) -> Int
T3540.hs:13:12:
Predicate `?dude :: Int' used as a type
Expected a type, but `?dude :: Int' has kind `Constraint'
In the type signature for `thing3': thing3 :: (?dude :: Int) -> Int
T3540.hs:16:11:
Predicate `Eq a' used as a type
Expected a type, but `Eq a' has kind `Constraint'
In the type signature for `thing4': thing4 :: (Eq a) -> Int
testsuite/tests/typecheck/should_fail/tcfail028.stderr
View file @
8bc6c4a6
tcfail028.hs:4:17:
Expecting one more argument to `A a'
In the type `A a'
In the definition of data constructor `B'
In the data declaration for `A'
tcfail028.hs:4:17:
Expecting one more argument to `A a'
Expected a type, but `A a' has kind `k0 -> *'
In the type `A a'
In the definition of data constructor `B'
In the data declaration for `A'
Prev
1
2
Next
thomie
@trac-thomie
mentioned in issue
#11112 (closed)
·
Nov 19, 2015
mentioned in issue
#11112 (closed)
mentioned in issue #11112
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment