Commit 8bc6c4a6 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Improvements to kind error messages, mainly

Also some expected/actual messages are now the right way round
parent 09cdd12b
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'
<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
......
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
......
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'
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
......
......@@ -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 b1. MyEq b1 Bool => b1 -> b1) -> 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 b1. b1 ~ Bool => b1 -> b1) -> b -> b
Actual type: (forall b. b ~ Bool => b -> b)
-> forall b. b ~ Bool => b -> b
In the expression:
......
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
......@@ -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)
......
......@@ -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:28:20:
T2693.hs:29:26:
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)
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: complete ev
In the second argument of `($)', namely
`inj $ Failure (e :: SomeException)'
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'
......
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'
......
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
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'
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:
......
tc211.hs:15:22:
Couldn't match type `forall a1. a1 -> a1' with `a -> a'
Couldn't match type `forall a6. a6 -> a6' 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 a2. a2 -> a2' with `a1 -> a1'
Couldn't match type `forall a7. a7 -> a7' with `a6 -> a6'
Expected type: List (forall a. a -> a)
-> (forall a. a -> a) -> a1 -> a1
-> (forall a. a -> a) -> a6 -> a6
Actual type: List (forall a. a -> a)
-> (forall a. a -> a) -> forall a. a -> a
In the expression:
......
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'
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'
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:
......
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
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'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment