Commit 4c68c2f9 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Lots of error message wibbling, following the

major TcErrors refactoring
parent ad0e1c9c
annfail08.hs:9:1:
No instance for (Data.Data.Data (a0 -> a0))
arising from an annotation
Possible fix:
add an instance declaration for (Data.Data.Data (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail08.hs:9:15:
No instance for (Num (a0 -> a0))
arising from a use of `+'
Possible fix: add an instance declaration for (Num (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail08.hs:9:1:
No instance for (Data.Data.Data (a0 -> a0))
arising from an annotation
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Possible fix:
add an instance declaration for (Data.Data.Data (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail08.hs:9:15:
No instance for (Num (a0 -> a0))
arising from a use of `+'
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Possible fix: add an instance declaration for (Num (a0 -> a0))
In the expression: (id + 1)
In the annotation: {-# ANN f (id + 1) #-}
annfail10.hs:9:1:
Ambiguous type variable `a0' in the constraints:
(Data.Data.Data a0) arising from an annotation
at annfail10.hs:9:1-15
(Num a0) arising from the literal `1' at annfail10.hs:9:11
Probable fix: add a type signature that fixes these type variable(s)
No instance for (Data.Data.Data a0)
arising from an annotation
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
In the expression: 1
In the annotation: {-# ANN f 1 #-}
annfail10.hs:9:11:
No instance for (Num a0)
arising from the literal `1'
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
In the expression: 1
In the annotation: {-# ANN f 1 #-}
T5380.hs:7:27:
Couldn't match type `not_bool' with `Bool'
`not_bool' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:7:1
In the expression: b
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
T5380.hs:7:34:
Couldn't match type `not_unit' with `()'
`not_unit' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:7:1
Expected type: () -> not_unit
Actual type: () -> ()
In the expression: f
In the expression: proc () -> if b then f -< () else f -< ()
T5380.hs:7:27:
Couldn't match expected type `not_bool' with actual type `Bool'
`not_bool' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:7:1
In the expression: b
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
T5380.hs:7:34:
Couldn't match type `not_unit' with `()'
`not_unit' is a rigid type variable bound by
the type signature for
testB :: not_bool -> (() -> ()) -> () -> not_unit
at T5380.hs:7:1
Expected type: () -> not_unit
Actual type: () -> ()
In the expression: f
In the expression: proc () -> if b then f -< () else f -< ()
In an equation for `testB':
testB b f = proc () -> if b then f -< () else f -< ()
T5287.hs:6:29:
Ambiguous type variable `oops' in the constraint:
(A e oops)
arising from the 'deriving' clause of a data type declaration
Probable fix: use a 'standalone deriving' declaration instead
When deriving the instance for (Read (E e))
T5287.hs:6:29:
No instance for (A e oops)
arising from the 'deriving' clause of a data type declaration
The type variable `oops' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Possible fix:
use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Read (E e))
T3169.hs:13:13:
Couldn't match type `elt' with `Map b elt'
`elt' is a rigid type variable bound by
the type signature for
lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
at T3169.hs:12:3
Expected type: Maybe (Map b elt)
Actual type: Maybe elt
In the return type of a call of `lookup'
In the expression: lookup a m :: Maybe (Map b elt)
T3169.hs:13:13:
Could not deduce (elt ~ Map b elt)
from the context (Key a, Key b)
bound by the instance declaration at T3169.hs:10:10-36
`elt' is a rigid type variable bound by
the type signature for
lookup :: (a, b) -> Map (a, b) elt -> Maybe elt
at T3169.hs:12:3
Expected type: Maybe (Map b elt)
Actual type: Maybe elt
In the return type of a call of `lookup'
In the expression: lookup a m :: Maybe (Map b elt)
In the expression:
case lookup a m :: Maybe (Map b elt) of {
Just (m2 :: Map b elt) -> lookup b m2 :: Maybe elt }
T3169.hs:13:22:
Could not deduce (Map a ~ MP a b)
from the context (Key a, Key b)
bound by the instance declaration at T3169.hs:10:10-36
Expected type: Map a elt
Actual type: Map (a, b) elt
In the second argument of `lookup', namely `m'
In the expression: lookup a m :: Maybe (Map b elt)
In the expression:
case lookup a m :: Maybe (Map b elt) of {
Just (m2 :: Map b elt) -> lookup b m2 :: Maybe elt }
rw.hs:14:47:
Couldn't match type `a' with `Int'
`a' is a rigid type variable bound by
the type signature for writeInt :: T a -> IORef a -> IO ()
at rw.hs:13:1
In the second argument of `writeIORef', namely `(1 :: Int)'
In the expression: writeIORef ref (1 :: Int)
In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
rw.hs:19:51:
Couldn't match type `a' with `Bool'
`a' is a rigid type variable bound by
the type signature for readBool :: T a -> IORef a -> IO ()
at rw.hs:17:1
Expected type: a -> Bool
Actual type: Bool -> Bool
In the second argument of `(.)', namely `not'
In the second argument of `(>>=)', namely `(print . not)'
rw.hs:14:47:
Couldn't match expected type `a' with actual type `Int'
`a' is a rigid type variable bound by
the type signature for writeInt :: T a -> IORef a -> IO ()
at rw.hs:13:1
In the second argument of `writeIORef', namely `(1 :: Int)'
In the expression: writeIORef ref (1 :: Int)
In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
rw.hs:19:51:
Couldn't match type `a' with `Bool'
`a' is a rigid type variable bound by
the type signature for readBool :: T a -> IORef a -> IO ()
at rw.hs:17:1
Expected type: a -> Bool
Actual type: Bool -> Bool
In the second argument of `(.)', namely `not'
In the second argument of `(>>=)', namely `(print . not)'
In the expression: readIORef ref >>= (print . not)
......@@ -2,5 +2,7 @@
<interactive>:5:1:
No instance for (Show (t -> a))
arising from a use of `print'
Cannot resolve unknown runtime types `t', `a'
Use :print or :force to determine these types
Possible fix: add an instance declaration for (Show (t -> a))
In a stmt of an interactive GHCi command: print it
<interactive>:6:1:
Ambiguous type variable `a' in the constraint:
(Show a) arising from a use of `print'
Cannot resolve unknown runtime types: a
No instance for (Show a)
arising from a use of `print'
Cannot resolve unknown runtime type `a'
Use :print or :force to determine these types
In a stmt of an interactive GHCi command: print it
<interactive>:8:1:
Ambiguous type variable `a' in the constraint:
(Show a) arising from a use of `print'
Cannot resolve unknown runtime types: a
No instance for (Show a)
arising from a use of `print'
Cannot resolve unknown runtime type `a'
Use :print or :force to determine these types
In a stmt of an interactive GHCi command: print it
<no location info>:
Warning: -XRecursiveDo is deprecated: use -XDoRec or pragma {-# LANGUAGE DoRec #-} instead
<no location info>: Warning:
-XRecursiveDo is deprecated: use -XDoRec or pragma {-# LANGUAGE DoRec #-} instead
<no location info>:
Warning: -XRecursiveDo is deprecated: use -XDoRec or pragma {-# LANGUAGE DoRec #-} instead
<no location info>: Warning:
-XRecursiveDo is deprecated: use -XDoRec or pragma {-# LANGUAGE DoRec #-} instead
......@@ -2,7 +2,7 @@ t = O (_t1::a)
()
t = O ((_t2::a1) : (_t3::[a1]))
()
t = O ((_t4::a2) : (_t5::a2) : (_t6::[a2]))
t = O ((_t4::a1) : (_t5::a1) : (_t6::[a1]))
()
t = O ((_t7::Maybe [Integer]) : Just [2,2] :
(_t8::[Maybe [Integer]]))
......
<no location info>:
Warning: -O conflicts with --interactive; -O ignored.
<no location info>: Warning:
-O conflicts with --interactive; -O ignored.
<interactive>:11:1:
Ambiguous type variable `a1' in the constraint:
(Show a1) arising from a use of `print'
Cannot resolve unknown runtime types: a1
No instance for (Show a1)
arising from a use of `print'
Cannot resolve unknown runtime type `a1'
Use :print or :force to determine these types
In a stmt of an interactive GHCi command: print it
-- Test -fwarn-type-errors
-- This test shows how each error is printed at runtime
:l ../../typecheck/should_run/Defer01
t5624
print a
print (b B)
print (c (C2 True))
print (d ())
print f
print (h ())
print (i ())
print j
print (k 2)
l
\ No newline at end of file
../../typecheck/should_run/Defer01.hs:11:40: Warning:
Couldn't match type `Char' with `[Char]'
Expected type: String
Actual type: Char
In the first argument of `putStr', namely ','
In the second argument of `(>>)', namely putStr ','
In the expression: putStr "Hello World" >> putStr ','
../../typecheck/should_run/Defer01.hs:14:5: Warning:
Couldn't match expected type `Int' with actual type `Char'
In the expression: 'p'
In an equation for `a': a = 'p'
../../typecheck/should_run/Defer01.hs:18:9: Warning:
No instance for (Eq B)
arising from a use of `=='
Possible fix: add an instance declaration for (Eq B)
In the expression: x == x
In an equation for `b': b x = x == x
../../typecheck/should_run/Defer01.hs:28:5: Warning:
No instance for (Num (a -> a))
arising from the literal `1'
Possible fix: add an instance declaration for (Num (a -> a))
In the expression: 1
In an equation for `d': d = 1
../../typecheck/should_run/Defer01.hs:31:5: Warning:
Couldn't match expected type `Char -> t' with actual type `Char'
The function `e' is applied to one argument,
but its type `Char' has none
In the expression: e 'q'
In an equation for `f': f = e 'q'
../../typecheck/should_run/Defer01.hs:34:8: Warning:
Couldn't match expected type `a' with actual type `Char'
`a' is a rigid type variable bound by
the type signature for h :: a -> (Char, Char)
at ../../typecheck/should_run/Defer01.hs:34:1
In the expression: x
In the expression: (x, 'c')
In an equation for `h': h x = (x, 'c')
../../typecheck/should_run/Defer01.hs:39:17: Warning:
Couldn't match expected type `Bool' with actual type `T a'
In the return type of a call of `K'
In the first argument of `not', namely `(K a)'
In the first argument of `seq', namely `(not (K a))'
../../typecheck/should_run/Defer01.hs:43:5: Warning:
No instance for (MyClass a1)
arising from a use of `myOp'
The type variable `a1' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
In the expression: myOp 23
In an equation for `j': j = myOp 23
../../typecheck/should_run/Defer01.hs:43:10: Warning:
No instance for (Num a1)
arising from the literal `23'
The type variable `a1' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
In the first argument of `myOp', namely `23'
In the expression: myOp 23
In an equation for `j': j = myOp 23
../../typecheck/should_run/Defer01.hs:46:7: Warning:
Couldn't match expected type `Bool' with actual type `Int'
In the expression: x
In an equation for `k': k x = x
../../typecheck/should_run/Defer01.hs:49:5: Warning:
Couldn't match expected type `IO a0'
with actual type `Char -> IO ()'
In the first argument of `(>>)', namely `putChar'
In the expression: putChar >> putChar 'p'
In an equation for `l': l = putChar >> putChar 'p'
<interactive>:8:11:
Couldn't match type `Bool' with `Int'
Expected type: C Int
Actual type: C Bool
In the return type of a call of `C2'
In the first argument of `c', namely `(C2 True)'
In the first argument of `print', namely `(c (C2 True))'
<interactive>:14:8:
Couldn't match expected type `Bool' with actual type `Int'
In the first argument of `print', namely `(k 2)'
In the expression: print (k 2)
In an equation for `it': it = print (k 2)
T3263.hs:8:12:
Warning: A do-notation statement discarded a result of type Char.
Suppress this warning by saying "_ <- getChar",
or by using the flag -fno-warn-unused-do-bind
T3263.hs:8:12: Warning:
A do-notation statement discarded a result of type Char.
Suppress this warning by saying "_ <- getChar",
or by using the flag -fno-warn-unused-do-bind
<interactive>:3:27:
Couldn't match type `a' with `[Char]'
Couldn't match expected type `a' with actual type `[Char]'
In the expression: "hi"
In the expression: [x, "hi"]
In the expression: (\ (x :: a, y :: a) -> [x, "hi"])
......@@ -108,3 +108,4 @@ test('T5557', normal, ghci_script, ['T5557.script'])
test('T5566', normal, ghci_script, ['T5566.script'])
test('GhciKinds', normal, ghci_script, ['GhciKinds.script'])
test('T5564', normal, ghci_script, ['T5564.script'])
test('Defer02', normal, ghci_script, ['Defer02.script'])
\ No newline at end of file
ghci031.hs:1:14:
Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
ghci031.hs:1:14: Warning:
-XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
<interactive>:38:1:
Couldn't match type `HFalse' with `HTrue'
Expected type: HTrue
Actual type: Or HFalse HFalse
In the expression: f
In the expression: f $ Baz 'a'
In an equation for `it': it = f $ Baz 'a'
<interactive>:39:1:
Couldn't match type `HFalse' with `HTrue'
Expected type: HTrue
Actual type: Or HFalse HFalse
In the expression: f
In the expression: f $ Quz
In an equation for `it': it = f $ Quz
<interactive>:6:49:
Couldn't match type `a' with `ListableElem (a, a)'
`a' is a rigid type variable bound by
the instance declaration at <interactive>:6:20
In the expression: a
In the expression: [a, b]
In an equation for `asList': asList (a, b) = [a, b]
<interactive>:6:49:
Couldn't match expected type `a'
with actual type `ListableElem (a, a)'
`a' is a rigid type variable bound by
the instance declaration at <interactive>:6:20
In the expression: a
In the expression: [a, b]
In an equation for `asList': asList (a, b) = [a, b]
<interactive>:7:9:
Couldn't match expected type T' with actual type `T'
Couldn't match type `T' with `main::Interactive.T'
Expected type: T'
Actual type: T
In the expression: C :: T'
In an equation for `c': c = C :: T'
......@@ -8,6 +8,8 @@ Simple14.hs:17:12:
`n' is a rigid type variable bound by
the type signature for foo :: EQ_ (Maybe m) (Maybe n)
at Simple14.hs:17:1
Expected type: EQ_ z0 z0
Actual type: EQ_ m n
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))
......@@ -6,17 +6,21 @@ T3208b.hs:15:10:
fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c
at T3208b.hs:15:1-22
NB: `STerm' is a type function, and may not be injective
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Expected type: STerm a0
Actual type: OTerm a0
In the expression: fce (apply f)
In an equation for fce': fce' f = fce (apply f)
T3208b.hs:15:15:
Could not deduce (OTerm a0 ~ STerm a)
Could not deduce (STerm a ~ OTerm a0)
from the context (OTerm a ~ STerm a, OBJECT a, SUBST a)
bound by the type signature for
fce' :: (OTerm a ~ STerm a, OBJECT a, SUBST a) => a -> c
at T3208b.hs:15:1-22
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
In the first argument of `fce', namely `(apply f)'
In the expression: fce (apply f)
In an equation for fce': fce' f = fce (apply f)
GADTwrong1.hs:12:19:
Could not deduce (a1 ~ b)
Could not deduce (b ~ a1)
from the context (() ~ Const a1)
bound by a pattern with constructor
T :: forall a. a -> T (Const a),
in a case alternative
at GADTwrong1.hs:12:12-14
`b' is a rigid type variable bound by
the type signature for coerce :: a -> b at GADTwrong1.hs:11:1
`a1' is a rigid type variable bound by
a pattern with constructor
T :: forall a. a -> T (Const a),
in a case alternative
at GADTwrong1.hs:12:12
`b' is a rigid type variable bound by
the type signature for coerce :: a -> b at GADTwrong1.hs:11:1
In the expression: y
In a case alternative: T y -> y
In the expression: case T x :: T (Const b) of { T y -> y }
......@@ -5,8 +5,8 @@ NoMatchErr.hs:20:5:
bound by the type signature for f :: Fun d => Memo d a -> Memo d a
at NoMatchErr.hs:20:1-15
NB: `Memo' is a type function, and may not be injective
Expected type: Memo d a
Actual type: Memo d0 a
The type variable `d0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Expected type: Memo d a -> Memo d a
Actual type: Memo d0 a -> Memo d0 a
In the expression: abst . appl
......
SimpleFail16.hs:10:12:
Couldn't match type `F ()' with `p0 a0'
In the first argument of `foo', namely `(undefined :: F ())'
In the expression: foo (undefined :: F ())
In an equation for `bar': bar = foo (undefined :: F ())
SimpleFail16.hs:10:12:
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 the following:
bar :: p0 a0 (bound at SimpleFail16.hs:10:1)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
In the first argument of `foo', namely `(undefined :: F ())'
In the expression: foo (undefined :: F ())
In an equation for `bar': bar = foo (undefined :: F ())
SimpleFail5b.hs:31:12:
Couldn't match expected type `Int' with actual type `Char'
Couldn't match type `Char' with `Int'
Expected type: S3 Int
Actual type: S3 Char
In the pattern: D3Char
......
T1897b.hs:16:1:
Could not deduce (Depend a ~ Depend a0)
from the context (Bug a)
bound by the inferred type for `isValid':
Bug a => [Depend a] -> Bool
at T1897b.hs:16:1-41
NB: `Depend' is a type function, and may not be injective
Expected type: [Depend a] -> Bool
Actual type: [Depend a0] -> Bool
When checking that `isValid'
has the inferred type `forall a1. Bug a1 => [Depend a1] -> Bool'
Probable cause: the inferred type is ambiguous
T1897b.hs:16:1:
Could not deduce (Depend a ~ Depend a0)
from the context (Bug a)
bound by the inferred type for `isValid':
Bug a => [Depend a] -> Bool
at T1897b.hs:16:1-41
NB: `Depend' is a type function, and may not be injective
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Expected type: [Depend a] -> Bool
Actual type: [Depend a0] -> Bool
When checking that `isValid'
has the inferred type `forall a. Bug a => [Depend a] -> Bool'
Probable cause: the inferred type is ambiguous
T1900.hs:11:12:
No instance for (Num ())
arising from a use of `+'
Possible fix: add an instance declaration for (Num ())
In the expression: (+ 1)
In an equation for `trans': trans = (+ 1)
In the instance declaration for `Bug Int'
T1900.hs:14:22: