Commit 8b471a8c authored by simonpj's avatar simonpj

[project @ 2004-10-01 13:58:37 by simonpj]

Update expected output for new GADT-enabled typechecker
parent 42050ebb
drvfail001.hs:15:5:
No instance for (Show (f (f a)))
arising from the data type declaration at drvfail001.hs:15:5
arising from the 'deriving' clause of a data type declaration at drvfail001.hs:15:5
When deriving the `Show' instance for type `SM'
drvfail001.hs:21:5:
No instance for (Show (f a))
arising from the data type declaration at drvfail001.hs:21:5
arising from the 'deriving' clause of a data type declaration at drvfail001.hs:21:5
When deriving the `Show' instance for type `Cons'
drvfail003.hs:13:5:
No instance for (Show (v (v a)))
arising from the data type declaration at drvfail003.hs:13:5
arising from the 'deriving' clause of a data type declaration at drvfail003.hs:13:5
When deriving the `Show' instance for type `Square_'
drvfail004.hs:5:5:
Could not deduce (Eq (Foo a b)) from the context (Ord a, Ord b)
arising from the instance declaration at drvfail004.hs:5:5
arising from the superclasses of an instance declaration at drvfail004.hs:5:5
Probable fix:
Add (Eq (Foo a b)) to the instance declaration superclass context
Or add an instance declaration for (Eq (Foo a b))
......
drvfail007.hs:4:5:
No instance for (Eq (Int -> Int))
arising from the data type declaration at drvfail007.hs:4:5
arising from the 'deriving' clause of a data type declaration at drvfail007.hs:4:5
When deriving the `Eq' instance for type `Foo'
mod46.hs:4:0:
No instance for (Eq T)
arising from the instance declaration at mod46.hs:4:0
arising from the superclasses of an instance declaration at mod46.hs:4:0
In the instance declaration for `Ord T'
mod47.hs:6:0:
Could not deduce (Num a) from the context (Eq a, Enum a)
arising from the instance declaration at mod47.hs:6:0
arising from the superclasses of an instance declaration at mod47.hs:6:0
Probable fix: Add (Num a) to the instance declaration superclass context
In the instance declaration for `Bar [a]'
mod54.hs:3:5:
No instance for (Eq T)
arising from the instance declaration at mod54.hs:3:5
arising from the superclasses of an instance declaration at mod54.hs:3:5
In the instance declaration for `Ord T'
mod60.hs:3:3:
Constructor `Left' should have 1 argument, but has been given 0
When checking the pattern: Left
In the definition of `f': f (Left) = error "foo"
read003.hs:4:26:
Occurs check: cannot construct the infinite type: t = (t, [a], t1)
Expected type: (t, [a], t1)
Inferred type: t
Occurs check: cannot construct the infinite type: a = (a, [a], c)
Expected type: (a, [a], c)
Inferred type: a
In the right-hand side of a pattern binding: a
In a pattern binding:
~(a, b, c)
......
......@@ -8,5 +8,5 @@ test('simpl005', normal, compile, [''])
# test('simpl006', normal, compile, [''])
test('simpl007', normal, compile, [''])
test('simpl008', normal, compile, ['-fglasgow-exts'])
test('simpl008', normal, compile_fail, [''])
test('simpl009', normal, compile, [''])
import GHC.Exts
{-# OPTIONS -fglasgow-exts #-}
-- Should fail, because f :: (# Int#, ByteArray# #)
import GHC.Prim
main :: IO ()
main = let f = int2Integer# 0# in putStrLn ""
......
simpl008.hs:8:15:
Couldn't match kind `??' against `(#)'
When matching the kinds of `t :: ??' and `(# Int#, ByteArray# #) :: (#)'
Expected type: t
Inferred type: (# Int#, ByteArray# #)
In the application `int2Integer# 0#'
LetE [ValD (VarP foo_0) (NormalB (VarE bar_1)) [ValD (VarP bar_1) (NormalB (LitE (IntegerL 3))) []]] (VarE foo_0)
......@@ -5,6 +5,9 @@
-- in the pattern matching compiler, so they are a bit
-- tricky.
-- GHC 6.3: these are back to failures, because we no longer do
-- type subsumption in pattern-matching
module ShouldCompile where
newtype Bug s a = Bug a
......
tc162.hs:16:8:
Couldn't match `forall s. Bug s a' against `Bug s a1'
In the definition of `runBug': runBug (Bug _) = undefined
tc162.hs:21:9:
Couldn't match `forall s. BugN s a' against `BugN s a1'
In the definition of `runBugN': runBugN (BugN _) = undefined
tc162.hs:26:7:
Couldn't match `forall a b. Foo a b' against `Foo a b'
In the definition of `baz': baz s (Foo {foo = foo}) = putStrLn s
tcfail001.hs:9:7:
tcfail001.hs:9:1:
Couldn't match `[a]' against `t -> t1'
Expected type: [a]
Inferred type: t -> t1
In the definition of `op': op [] = []
In the definition for method `op'
In the instance declaration for `A [a]'
tcfail004.hs:3:8:
Couldn't match `(t, t1)' against `(t2, t3, t4)'
Expected type: (t, t1)
Inferred type: (t2, t3, t4)
Couldn't match `(a, b)' against `(a1, b1, c)'
Expected type: (a, b)
Inferred type: (a1, b1, c)
In a pattern binding: (f, g) = (1, 2, 3)
tcfail005.hs:3:8:
Couldn't match `[a]' against `(t, t1)'
Expected type: [a]
Inferred type: (t, t1)
Couldn't match `[a]' against `(a1, b)'
Expected type: [a]
Inferred type: (a1, b)
In a pattern binding: (h : i) = (1, 'a')
tcfail013.hs:4:2:
Couldn't match `Bool' against `[a]'
Expected type: Bool
Inferred type: [a]
Couldn't match `[a]' against `Bool'
Expected type: [a]
Inferred type: Bool
When checking the pattern: True
In the definition of `f': f True = 2
tcfail017.hs:10:0:
Could not deduce (C [a]) from the context (B a)
arising from the instance declaration at tcfail017.hs:10:0
arising from the superclasses of an instance declaration at tcfail017.hs:10:0
Probable fix:
Add (C [a]) to the instance declaration superclass context
Or add an instance declaration for (C [a])
......
tcfail019.hs:18:0:
No instances for (B [a], C [a])
arising from the instance declaration at tcfail019.hs:18:0
arising from the superclasses of an instance declaration at tcfail019.hs:18:0
Probable fix:
Add (B [a], C [a]) to the instance declaration superclass context
Or add an instance declaration for (B [a], C [a])
......
tcfail020.hs:10:0:
Could not deduce (A [a]) from the context (A a)
arising from the instance declaration at tcfail020.hs:10:0
arising from the superclasses of an instance declaration at tcfail020.hs:10:0
Probable fix:
Add (A [a]) to the instance declaration superclass context
Or add an instance declaration for (A [a])
......
......@@ -3,6 +3,7 @@ tcfail032.hs:14:7:
Inferred type is less polymorphic than expected
Quantified type variable `a' escapes
It is mentioned in the environment:
f :: (a -> Int) -> t (bound at tcfail032.hs:14:0)
x :: a -> Int (bound at tcfail032.hs:14:2)
In the expression: x :: (Eq a) => a -> Int
In the definition of `f': f x = (x :: (Eq a) => a -> Int)
tcfail033.hs:4:11:
Occurs check: cannot construct the infinite type: t = (t, t1)
Expected type: (t, t1)
Inferred type: t
Occurs check: cannot construct the infinite type: a = (a, b)
Expected type: (a, b)
Inferred type: a
In the result of a list comprehension: x
In the definition of `buglet': buglet = [x | (x, y) <- buglet]
tcfail038.hs:8:10:
Conflicting definitions for `/='
tcfail038.hs:7:10:
Conflicting definitions for `=='
In the bindings in an instance declaration
tcfail038.hs:9:10:
Conflicting definitions for `=='
tcfail038.hs:8:10:
Conflicting definitions for `/='
In the bindings in an instance declaration
tcfail042.hs:15:0:
Could not deduce (Num a) from the context (Eq a, Show a)
arising from the instance declaration at tcfail042.hs:15:0
arising from the superclasses of an instance declaration at tcfail042.hs:15:0
Probable fix: Add (Num a) to the instance declaration superclass context
In the instance declaration for `Bar [a]'
tcfail046.hs:9:8:
No instance for (Eq (Pid -> Time -> Message a -> (MessList a, Continuation a)))
arising from the data type declaration at tcfail046.hs:9:8
arising from the 'deriving' clause of a data type declaration at tcfail046.hs:9:8
When deriving the `Eq' instance for type `Continuation'
tcfail046.hs:17:5:
No instance for (Eq (Pid -> Time -> Message a -> (MessList a, Continuation a)))
arising from the data type declaration at tcfail046.hs:17:5
arising from the 'deriving' clause of a data type declaration at tcfail046.hs:17:5
When deriving the `Eq' instance for type `Message'
tcfail065.hs:28:0:
Inferred type is less polymorphic than expected
Quantified type variable `x1' is unified with another quantified type variable `x'
When trying to generalise the type inferred for `setX'
Signature type: forall x1 x2. x2 -> X x1 -> X x1
Type to generalise: forall x2. x2 -> X x1 -> X x1
In the instance declaration for `HasX (X x)'
tcfail065.hs:29:19:
Couldn't match the rigid variable `x' against the rigid variable `x1'
`x' is bound by the instance declaration at tcfail065.hs:28:0
`x1' is bound by the type signature for `setX'
Expected type: x
Inferred type: x1
In the first argument of `X', namely `x'
In the definition of `setX': setX x (X _) = X x
tcfail067.hs:12:15:
No instance for (Ord a)
arising from the pattern `SubRange (lower, upper) value' at tcfail067.hs:12:15-43
arising from use of `SubRange' at tcfail067.hs:12:15-43
Probable fix: Add (Ord a) to the type signature(s) for `subRangeValue'
When checking the pattern: SubRange (lower, upper) value
In the definition of `subRangeValue':
subRangeValue (SubRange (lower, upper) value) = value
tcfail067.hs:15:10:
No instance for (Ord a)
arising from the pattern `SubRange r value' at tcfail067.hs:15:10-25
arising from use of `SubRange' at tcfail067.hs:15:10-25
Probable fix: Add (Ord a) to the type signature(s) for `subRange'
When checking the pattern: SubRange r value
In the definition of `subRange': subRange (SubRange r value) = r
tcfail067.hs:46:11:
Could not deduce (Ord a) from the context (Show a)
arising from the pattern `SubRange (lower, upper) value' at tcfail067.hs:46:11-39
arising from use of `SubRange' at tcfail067.hs:46:11-39
Probable fix: Add (Ord a) to the type signature(s) for `showRange'
When checking the pattern: SubRange (lower, upper) value
In the definition of `showRange':
showRange (SubRange (lower, upper) value)
= (show value) ++ (" :" ++ ((show lower) ++ (".." ++ (show upper))))
tcfail067.hs:60:0:
Could not deduce (Show (SubRange a)) from the context (Num a)
arising from the instance declaration at tcfail067.hs:60:0
arising from the superclasses of an instance declaration at tcfail067.hs:60:0
Probable fix:
Add (Show (SubRange a)) to the instance declaration superclass context
Or add an instance declaration for (Show (SubRange a))
......
tcfail068.hs:13:8:
Inferred type is less polymorphic than expected
Quantified type variable `s' escapes
tcfail068.hs:14:8:
Couldn't match the rigid variable `s' against the rigid variable `s1'
`s' is bound by the type signature for `itgen'
`s1' is bound by the polymorphic type `forall s. GHC.ST.ST s a'
at tcfail068.hs:(13,8)-(14,30)
Expected type: GHC.ST.ST s1 (IndTree s a)
Inferred type: GHC.ST.ST s1 (STArray s1 i e)
In the application `newSTArray ((1, 1), n) x'
In the first argument of `runST', namely `(newSTArray ((1, 1), n) x)'
In the definition of `itgen': itgen n x = runST (newSTArray ((1, 1), n) x)
tcfail068.hs:18:8:
Inferred type is less polymorphic than expected
Quantified type variable `s' escapes
It is mentioned in the environment:
arr :: IndTree s a (bound at tcfail068.hs:17:10)
tcfail068.hs:19:8:
Couldn't match the rigid variable `s' against the rigid variable `s1'
`s' is bound by the polymorphic type `forall s. GHC.ST.ST s a'
at tcfail068.hs:(18,8)-(21,18)
`s1' is bound by the type signature for `itiap'
Expected type: GHC.ST.ST s (IndTree s1 a)
Inferred type: GHC.ST.ST s1 (IndTree s1 a)
In the expression:
(readSTArray arr i) >>= (\ val -> (writeSTArray arr i (f val)) >> (return arr))
In the first argument of `runST', namely
`((readSTArray arr i)
>>= (\ val -> (writeSTArray arr i (f val)) >> (return arr)))'
In the definition of `itiap':
itiap i f arr
= runST ((readSTArray arr i)
>>= (\ val -> (writeSTArray arr i (f val)) >> (return arr)))
tcfail068.hs:24:28:
Inferred type is less polymorphic than expected
Quantified type variable `s' escapes
It is mentioned in the environment:
itrapsnd :: Int -> Int -> GHC.ST.ST s (IndTree s a) (bound at tcfail068.hs:29:8)
itrap' :: Int -> Int -> GHC.ST.ST s (IndTree s a) (bound at tcfail068.hs:26:8)
arr :: IndTree s a (bound at tcfail068.hs:24:22)
tcfail068.hs:24:34:
Couldn't match the rigid variable `s' against the rigid variable `s1'
`s' is bound by the polymorphic type `forall s. GHC.ST.ST s a'
at tcfail068.hs:24:28-44
`s1' is bound by the type signature for `itrap'
Expected type: GHC.ST.ST s (IndTree s1 a)
Inferred type: GHC.ST.ST s1 (IndTree s1 a)
In the application `itrap' i k'
In the first argument of `runST', namely `(itrap' i k)'
In the definition of `itrap':
itrap ((i, k), (j, l)) f arr
= runST (itrap' i k)
where
itrapsnd i k
= if i > j then return arr else ((readSTArray arr (i, k)) >>= (\ val -> ...))
itrap' i k
= if k > l then return arr else ((itrapsnd i k) >> (itrap' i (k + 1)))
tcfail068.hs:36:39:
Inferred type is less polymorphic than expected
Quantified type variable `s' escapes
It is mentioned in the environment:
itrapstatesnd :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
(bound at tcfail068.hs:41:8)
itrapstate' :: Int -> Int -> c -> GHC.ST.ST s (c, IndTree s b)
(bound at tcfail068.hs:38:8)
arr :: IndTree s b (bound at tcfail068.hs:36:33)
tcfail068.hs:36:45:
Couldn't match the rigid variable `s' against the rigid variable `s1'
`s' is bound by the polymorphic type `forall s. GHC.ST.ST s a'
at tcfail068.hs:36:39-62
`s1' is bound by the type signature for `itrapstate'
Expected type: GHC.ST.ST s (c, IndTree s1 b)
Inferred type: GHC.ST.ST s1 (c, IndTree s1 b)
In the application `itrapstate' i k s'
In the first argument of `runST', namely `(itrapstate' i k s)'
In the definition of `itrapstate':
itrapstate ((i, k), (j, l)) f c d s arr
= runST (itrapstate' i k s)
where
itrapstatesnd i k s
= if i > j then
return (s, arr)
else
((readSTArray arr (i, k)) >>= (\ val -> ...))
itrapstate' i k s
= if k > l then
return (s, arr)
else
((itrapstatesnd i k s) >>= (\ (s, arr) -> ...))
tcfail069.hs:20:9:
Couldn't match `[a]' against `(t, t1)'
Expected type: [a]
Inferred type: (t, t1)
In the scrutinee of a case expression: (list1, list2)
In the case expression: case (list1, list2) of [] -> error "foo"
tcfail069.hs:21:6:
Couldn't match `([Int], [Int])' against `[a]'
Expected type: ([Int], [Int])
Inferred type: [a]
When checking the pattern: []
In a case alternative: [] -> error "foo"
tcfail071.hs:5:0:
Mismatched contexts
When matching the contexts of the signatures for
tcfail071.hs:8:0:
Mis-match between the contexts of the signatures for
f :: forall d. (Ord d) => d -> d
g :: forall e. e -> e
The signature contexts in a mutually recursive group should all be identical
When generalising the type(s) for f, g
tcfail071.hs:10:21:
Cannot unify the type-signature variable `e' with the type `t -> t1'
Expected type: a -> b -> b
Inferred type: e
In the first argument of `f', namely `c'
In the first argument of `foldr', namely `(f c)'
tcfail072.hs:23:12:
Ambiguous type variable `q' in the top-level constraint:
`Ord q' arising from use of `g' at tcfail072.hs:23:12
tcfail072.hs:23:12:
Ambiguous type variable `p' in the top-level constraint:
`Ord p' arising from use of `g' at tcfail072.hs:23:12
tcfail072.hs:23:12:
Ambiguous type variable `q' in the top-level constraint:
`Ord q' arising from use of `g' at tcfail072.hs:23:12
tcfail073.hs:8:0:
Duplicate instance declarations:
tcfail073.hs:6:10:
Overlapping instances for Eq (a, a)
arising from use of `==' at tcfail073.hs:6:10-11
Matching instances:
tcfail073.hs:8:0: instance (Eq a) => Eq (a, b)
Imported from `Data.Tuple': instance (Eq a, Eq b) => Eq (a, b)
In the definition of `f': f x y = x == y
tcfail075.hs:11:0:
Top-level bindings for unlifted types aren't allowed: x = 1#
When generalising the type(s) for `x'
tcfail075.hs:1:0: Top-level bindings for unlifted types aren't allowed: x = 1#
tcfail075.hs:14:4:
Couldn't match kind `#' against `*'
When matching types `Int# :: #' and `t :: *'
When matching the kinds of `Int# :: #' and `a :: *'
Expected type: Int#
Inferred type: t
Inferred type: a
In the first argument of `(+#)', namely `x'
tcfail075.hs:17:14:
Couldn't match kind `#' against `*'
When matching types `Int# :: #' and `t :: *'
When matching the kinds of `Int# :: #' and `a :: *'
Expected type: Int#
Inferred type: t
Inferred type: a
In the first argument of `(-#)', namely `x'
tcfail075.hs:19:11:
Couldn't match kind `#' against `*'
When matching types `Int# :: #' and `t :: *'
When matching the kinds of `Int# :: #' and `a :: *'
Expected type: Int#
Inferred type: t
Inferred type: a
In the first argument of `(>#)', namely `z'
tcfail076.hs:18:63:
Inferred type is less polymorphic than expected
Quantified type variable `res' escapes
It is mentioned in the environment:
cont :: a -> m res (bound at tcfail076.hs:18:36)
In the first argument of `KContT', namely `(\ cont' -> cont a)'
In a lambda abstraction: \ a -> KContT (\ cont' -> cont a)
In the first argument of `f', namely `(\ a -> KContT (\ cont' -> cont a))'
tcfail076.hs:18:81:
Couldn't match the rigid variable `res' against the rigid variable `res1'
`res' is bound by the polymorphic type `forall res. (a -> m res) -> m res'
at tcfail076.hs:18:63-87
`res1' is bound by the polymorphic type `forall res. (a -> m res) -> m res'
at tcfail076.hs:18:27-95
Expected type: m res
Inferred type: m res1
In the application `cont a'
In a lambda abstraction: \ cont' -> cont a
tcfail083.hs:8:22:
tcfail083.hs:8:38:
Constructor `Bar' does not have field `baz'
When checking the pattern: Bar {flag = f, baz = b}
When checking the pattern: State {bar = Bar {flag = f, baz = b}}
In the definition of `display':
display (State {bar = Bar {flag = f, baz = b}}) = print (f, b)
tcfail090.hs:8:8:
Couldn't match kind `#' against `*'
When matching types `ByteArray# :: #' and `a :: *'
When matching the kinds of `ByteArray# :: #' and `a :: *'
Expected type: ByteArray#
Inferred type: a
In the definition of `die': die _ = undefined
tcfail095.hs:9:0:
Top-level bindings for unlifted types aren't allowed: x = 1#
When generalising the type(s) for `x'
tcfail095.hs:1:0: Top-level bindings for unlifted types aren't allowed: x = 1#
tcfail099.hs:9:15:
tcfail099.hs:9:0:
Inferred type is less polymorphic than expected
Quantified type variable `a' escapes
It is mentioned in the environment:
call :: DS -> a -> Int (bound at tcfail099.hs:9:0)
When checking an existential match that binds
f :: a -> Int
The pattern(s) have type(s): DS
......
tcfail105.hs:8:0:
All of the type variables in the constraint `Monad m' are already in scope
(at least one must be universally quantified here)
When checking the data constructor: (Monad m) => M {unM :: m (S m t a)}
tcfail105.hs:8:26:
Can't combine named fields with locally-quantified type variables or context
In the declaration of data constructor M
In the data type declaration for `M'
tcfail106.hs:11:0:
No instance for (S Int)
arising from the instance declaration at tcfail106.hs:11:0
arising from the superclasses of an instance declaration at tcfail106.hs:11:0
In the instance declaration for `C Int'
tcfail106.hs:14:0:
No instance for (S Int)
arising from the instance declaration at tcfail106.hs:14:0
arising from the superclasses of an instance declaration at tcfail106.hs:14:0
In the instance declaration for `D Int'
tcfail109.hs:16:0:
No instance for (Eq Stupid)
arising from the instance declaration at tcfail109.hs:16:0
arising from the superclasses of an instance declaration at tcfail109.hs:16:0
In the instance declaration for `Collects Bool Stupid'
tcfail115.hs:18:29:
Couldn't match kind `(#)' against `??'
When matching types `(# Int, Int #) :: (#)' and `t :: ??'
Expected type: (# Int, Int #)
Inferred type: t
tcfail115.hs:18:24:
Couldn't match kind `??' against `(#)'
When matching the kinds of `t :: ??' and `(# Int, Int #) :: (#)'
Expected type: t
Inferred type: (# Int, Int #)
In a case alternative: r -> r
tcfail115.hs:21:18:
tcfail115.hs:21:25:
Couldn't match kind `??' against `(#)'
When matching types `t :: ??' and `(# Int, Int #) :: (#)'
When matching the kinds of `t :: ??' and `(# Int, Int #) :: (#)'
Expected type: t
Inferred type: (# Int, Int #)
In the application `t x'
When checking the pattern: _
tcfail115.hs:24:23:
Couldn't match kind `(#)' against `??'
When matching types `(# Int, Int #) :: (#)' and `t :: ??'
When matching the kinds of `(# Int, Int #) :: (#)' and `t :: ??'
Expected type: (# Int, Int #)
Inferred type: t
In the expression: r :: (# Int, Int #)
tcfail118.hs:10:5:
Overlapping instances for Eq Foo
arising from the data type declaration at tcfail118.hs:10:5
arising from the 'deriving' clause of a data type declaration at tcfail118.hs:10:5
Matching instances:
tcfail118.hs:13:0: instance Eq Foo
tcfail118.hs:11:5: instance Eq Foo
......
......@@ -3,5 +3,5 @@ tcfail119.hs:11:7:
Couldn't match `Bool' against `[Char]'
Expected type: Bool
Inferred type: [Char]
When checking the pattern: "Foo"
In the definition of `b': b x "Foo" = ()
In the definition for method `b'
......@@ -30,7 +30,7 @@ test('tcrun023', normal, compile_and_run, ['-O'])
test('tcrun024', normal, compile_and_run, ['-O'])
test('tcrun025', normal, multimod_compile_and_run, ['tcrun025',''])
clean(['TcRun025_B.hi', 'TcRun025_B.o'])
test('tcrun026', normal, compile_and_run, [''])
test('tcrun026', normal, compile_fail, [''])
test('tcrun027', normal, compile_and_run, [''])
# Doesn't work with External Core due to datatype with no constructors
test('tcrun028', expect_fail_for(['extcore','optextcore']), compile_and_run, [''])
......
......@@ -4,6 +4,8 @@
-- panic: tcSplitTyConApp forall x{-r6S-} :: *.
-- Main.L{-rr-} x{-r6S-}
-- GHC 6.3: this is now an error (can do subsumption in patterns)
module Main where
newtype FA c = FA (forall x . c x)
......
tcrun026.hs:17:28:
Couldn't match `forall x. L x' against `L x'
When checking the pattern: FA (L x)
In a case alternative: FA (L x) -> "foo" ++ x
In the case expression: case my_nil of FA (L x) -> "foo" ++ x
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