Commit 40f9546b authored by Simon Peyton Jones's avatar Simon Peyton Jones

Monster patch of testsuite changes with the new typechecker

Very many of these changes are minor error-message wibbles,
but there are some to do with higher-rank and impredicativity
that are more substantial.  I'm looking at those separately,
but meanwhile validate works.
parent d07507d6
annfail05.hs:11:1:
No instance for (Data.Data.Data NoInstances)
arising from an annotation at annfail05.hs:11:1-25
arising from an annotation
Possible fix:
add an instance declaration for (Data.Data.Data NoInstances)
In the expression: NoInstances
......
annfail07.hs:9:17:
Couldn't match expected type `[a]' against inferred type `Bool'
Couldn't match expected type `[a]' with actual type `Bool'
In the first argument of `head', namely `True'
In the expression: (head True)
In the annotation: {-# ANN f (head True) #-}
annfail08.hs:9:1:
No instance for (Data.Data.Data (a -> a))
arising from an annotation at annfail08.hs:9:1-22
arising from an annotation
Possible fix:
add an instance declaration for (Data.Data.Data (a -> a))
In the expression: (id + 1)
......@@ -9,7 +9,7 @@ annfail08.hs:9:1:
annfail08.hs:9:17:
No instance for (Num (a -> a))
arising from the literal `1' at annfail08.hs:9:17
arising from the literal `1'
Possible fix: add an instance declaration for (Num (a -> a))
In the second argument of `(+)', namely `1'
In the expression: (id + 1)
......
annfail10.hs:9:11:
Ambiguous type variable `t' in the constraints:
`Num t' arising from the literal `1' at annfail10.hs:9:11
`Data.Data.Data t'
arising from an annotation at annfail10.hs:9:1-15
Ambiguous type variable `a' in the constraints:
(Num a) arising from the literal `1' at annfail10.hs:9:11
(Data.Data.Data a) arising from an annotation
at annfail10.hs:9:1-15
Probable fix: add a type signature that fixes these type variable(s)
In the expression: 1
In the annotation: {-# ANN f 1 #-}
arrowfail001.hs:16:36:
Ambiguous type variable `a' in the constraint:
`Foo a' arising from a use of `foo' at arrowfail001.hs:16:36-38
(Foo a) arising from a use of `foo'
Probable fix: add a type signature that fixes these type variable(s)
In the expression: foo
In the expression: proc x -> case x of { Bar a -> foo -< a }
In an equation for `get':
get = proc x -> case x of { Bar a -> foo -< a }
......@@ -4,11 +4,11 @@ arrowfail003.hs:8:7:
returnA -< []
was found where an expression was expected
In the expression: returnA -< []
In the definition of `foo': foo = returnA -< []
In an equation for `foo': foo = returnA -< []
arrowfail003.hs:9:7:
The arrow command
(|zeroArrow |)
was found where an expression was expected
In the expression: (|zeroArrow |)
In the definition of `bar': bar = (|zeroArrow |)
In an equation for `bar': bar = (|zeroArrow |)
arrowfail004.hs:12:15:
Illegal constructor `T' in a 'proc' pattern
Proc patterns cannot use existentials or GADTs
Proc patterns cannot use existential or GADT data constructors
In the pattern: T x
In the expression: proc (T x) -> do { returnA -< T x }
In the definition of `panic':
In an equation for `panic':
panic = proc (T x) -> do { returnA -< T x }
GadtOverlap.hs:19:1:
Warning: Pattern match(es) are non-exhaustive
In the definition of `h': Patterns not matched: T3
In an equation for `h': Patterns not matched: T3
T2395.hs:12:1:
Warning: Pattern match(es) are overlapped
In the definition of `bar': bar _ = ...
In an equation for `bar': bar _ = ...
ds002.hs:7:1:
Warning: Pattern match(es) are overlapped
In the definition of `f':
f y = ...
f z = ...
In an equation for `f':
f y = ...
f z = ...
ds002.hs:11:1:
Warning: Pattern match(es) are overlapped
In the definition of `g': g x y z = ...
In an equation for `g': g x y z = ...
ds003.hs:5:1:
Warning: Pattern match(es) are overlapped
In the definition of `f':
f (x : x1 : x2 : x3) ~(y, ys) z = ...
f x y True = ...
In an equation for `f':
f (x : x1 : x2 : x3) ~(y, ys) z = ...
f x y True = ...
ds019.hs:5:1:
Warning: Pattern match(es) are overlapped
In the definition of `f':
f d (j, k) p = ...
f (e, f, g) l q = ...
f h (m, n) r = ...
In an equation for `f':
f d (j, k) p = ...
f (e, f, g) l q = ...
f h (m, n) r = ...
ds020.hs:8:1:
Warning: Pattern match(es) are overlapped
In the definition of `a': a ~(~[], ~[], ~[]) = ...
ds020.hs:11:1:
Warning: Pattern match(es) are overlapped
In the definition of `b': b ~(~x : ~xs : ~ys) = ...
ds020.hs:16:1:
Warning: Pattern match(es) are overlapped
In the definition of `d':
d ~(n+43) = ...
d ~(n+999) = ...
ds020.hs:22:1:
Warning: Pattern match(es) are overlapped
In the definition of `f': f x@(~[]) = ...
ds020.hs:8:1:
Warning: Pattern match(es) are overlapped
In an equation for `a': a ~(~[], ~[], ~[]) = ...
ds020.hs:11:1:
Warning: Pattern match(es) are overlapped
In an equation for `b': b ~(~x : ~xs : ~ys) = ...
ds020.hs:16:1:
Warning: Pattern match(es) are overlapped
In an equation for `d':
d ~(n+43) = ...
d ~(n+999) = ...
ds020.hs:22:1:
Warning: Pattern match(es) are overlapped
In an equation for `f': f x@(~[]) = ...
ds022.hs:20:1:
Warning: Pattern match(es) are overlapped
In the definition of `i':
i 1 1.1 = ...
i 2 2.2 = ...
In an equation for `i':
i 1 1.1 = ...
i 2 2.2 = ...
ds041.hs:15:7:
Warning: Fields of `Foo' not initialised: x
In the expression: Foo {}
In the definition of `foo': foo = Foo {}
In the expression: Foo {}
In an equation for `foo': foo = Foo {}
ds051.hs:6:1:
Warning: Pattern match(es) are overlapped
In the definition of `f1': f1 "ab" = ...
In an equation for `f1': f1 "ab" = ...
ds051.hs:11:1:
Warning: Pattern match(es) are overlapped
In the definition of `f2': f2 ('a' : 'b' : []) = ...
In an equation for `f2': f2 ('a' : 'b' : []) = ...
ds051.hs:16:1:
Warning: Pattern match(es) are overlapped
In the definition of `f3': f3 "ab" = ...
In an equation for `f3': f3 "ab" = ...
ds056.hs:8:1:
Warning: Pattern match(es) are overlapped
In the definition of `g': g _ = ...
In an equation for `g': g _ = ...
......@@ -2,9 +2,7 @@
T2851.hs:9:15:
No instance for (Show (F a))
arising from the 'deriving' clause of a data type declaration
at T2851.hs:9:15-18
Possible fix:
add an instance declaration for (Show (F a))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Show (F a))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (D a))
drvfail-foldable-traversable1.hs:9:23:
No instance for (Functor Trivial1)
arising from the 'deriving' clause of a data type declaration
at drvfail-foldable-traversable1.hs:9:23-33
Possible fix:
add an instance declaration for (Functor Trivial1)
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial1)
drvfail-foldable-traversable1.hs:13:22:
No instance for (Foldable Trivial2)
arising from the 'deriving' clause of a data type declaration
at drvfail-foldable-traversable1.hs:13:22-32
Possible fix:
add an instance declaration for (Foldable Trivial2)
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial2)
drvfail-foldable-traversable1.hs:17:22:
Can't make a derived instance of `Foldable Infinite':
Constructor `Infinite' contains function types
In the data type declaration for `Infinite'
drvfail-foldable-traversable1.hs:17:31:
Can't make a derived instance of `Traversable Infinite':
Constructor `Infinite' contains function types
In the data type declaration for `Infinite'
drvfail-foldable-traversable1.hs:21:22:
Can't make a derived instance of `Foldable (Cont r)':
Constructor `Cont' contains function types
In the data type declaration for `Cont'
drvfail-foldable-traversable1.hs:21:31:
Can't make a derived instance of `Traversable (Cont r)':
Constructor `Cont' contains function types
In the data type declaration for `Cont'
drvfail-foldable-traversable1.hs:9:23:
No instance for (Functor Trivial1)
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Functor Trivial1)
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial1)
drvfail-foldable-traversable1.hs:13:22:
No instance for (Foldable Trivial2)
arising from the 'deriving' clause of a data type declaration
Possible fix: add an instance declaration for (Foldable Trivial2)
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Traversable Trivial2)
drvfail-foldable-traversable1.hs:17:22:
Can't make a derived instance of `Foldable Infinite':
Constructor `Infinite' contains function types
In the data type declaration for `Infinite'
drvfail-foldable-traversable1.hs:17:31:
Can't make a derived instance of `Traversable Infinite':
Constructor `Infinite' contains function types
In the data type declaration for `Infinite'
drvfail-foldable-traversable1.hs:21:22:
Can't make a derived instance of `Foldable (Cont r)':
Constructor `Cont' contains function types
In the data type declaration for `Cont'
drvfail-foldable-traversable1.hs:21:31:
Can't make a derived instance of `Traversable (Cont r)':
Constructor `Cont' contains function types
In the data type declaration for `Cont'
......@@ -2,9 +2,7 @@
drvfail001.hs:16:33:
No instance for (Show (f (f a)))
arising from the 'deriving' clause of a data type declaration
at drvfail001.hs:16:33-36
Possible fix:
add an instance declaration for (Show (f (f a)))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Show (f (f a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (SM f a))
......@@ -2,9 +2,7 @@
drvfail003.hs:16:56:
No instance for (Show (v (v a)))
arising from the 'deriving' clause of a data type declaration
at drvfail003.hs:16:56-59
Possible fix:
add an instance declaration for (Show (v (v a)))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Show (v (v a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Show (Square_ v w a))
......@@ -2,9 +2,7 @@
drvfail004.hs:8:12:
No instance for (Eq (Foo a b))
arising from the 'deriving' clause of a data type declaration
at drvfail004.hs:8:12-14
Possible fix:
add an instance declaration for (Eq (Foo a b))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Eq (Foo a b))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Ord (Foo a b))
......@@ -2,9 +2,7 @@
drvfail007.hs:4:38:
No instance for (Eq (Int -> Int))
arising from the 'deriving' clause of a data type declaration
at drvfail007.hs:4:38-39
Possible fix:
add an instance declaration for (Eq (Int -> Int))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Eq (Int -> Int))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq Foo)
drvfail011.hs:8:1:
Could not deduce (Eq a) from the context (Eq (T a))
arising from a use of `==' at drvfail011.hs:8:1-26
Possible fix: add (Eq a) to the context of the instance declaration
No instance for (Eq a)
arising from a use of `=='
In the expression: ((a1 == b1))
In the definition of `==': == (T1 a1) (T1 b1) = ((a1 == b1))
In an equation for `==': == (T1 a1) (T1 b1) = ((a1 == b1))
When typechecking a standalone-derived method for `Eq (T a)':
== (T1 a1) (T1 b1) = ((a1 == b1))
== a b
= case (ShouldFail.$con2tag_T a) of {
a#
-> case (ShouldFail.$con2tag_T b) of {
b# -> (a# GHC.Prim.==# b#) } }
a# -> case (ShouldFail.$con2tag_T b) of {
b# -> (a# GHC.Prim.==# b#) } }
In the instance declaration for `Eq (T a)'
......@@ -2,9 +2,7 @@
drvfail012.hs:5:33:
No instance for (Eq (Ego a))
arising from the 'deriving' clause of a data type declaration
at drvfail012.hs:5:33-35
Possible fix:
add an instance declaration for (Eq (Ego a))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Eq (Ego a))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Ord (Ego a))
......@@ -2,19 +2,15 @@
drvfail013.hs:4:70:
No instance for (Eq (m (Maybe a)))
arising from the 'deriving' clause of a data type declaration
at drvfail013.hs:4:70-71
Possible fix:
add an instance declaration for (Eq (m (Maybe a)))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Eq (m (Maybe a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq (MaybeT m a))
drvfail013.hs:6:70:
No instance for (Eq (m (Maybe a)))
arising from the 'deriving' clause of a data type declaration
at drvfail013.hs:6:70-71
Possible fix:
add an instance declaration for (Eq (m (Maybe a)))
or use a standalone 'deriving instance' declaration instead,
so you can specify the instance context yourself
Possible fix: add an instance declaration for (Eq (m (Maybe a)))
Alternatively, use a standalone 'deriving instance' declaration,
so you can specify the instance context yourself
When deriving the instance for (Eq (MaybeT' m a))
A.hs:8:6:
No instance for (Num (Int :- Int))
arising from the literal `1'
Possible fix: add an instance declaration for (Num (Int :- Int))
In the expression: 1
In the expression: (1, (2, 3))
In an equation for `f': f = (1, (2, 3))
A.hs:8:8:
Couldn't match expected type `Int' against inferred type `(t, t1)'
Couldn't match expected type `Int' with actual type `(t, t1)'
In the expression: (2, 3)
In the expression: (1, (2, 3))
In the definition of `f': f = (1, (2, 3))
In an equation for `f': f = (1, (2, 3))
......@@ -9,12 +9,12 @@ test('gadt3', normal, compile, [''])
test('gadt4', skip_if_fast, compile_and_run, [''])
test('gadt5', skip_if_fast, compile_and_run, [''])
test('gadt6', normal, compile, [''])
test('gadt7', normal, compile_fail, [''])
test('gadt7', normal, compile, [''])
test('gadt8', normal, compile, [''])
test('gadt9', normal, compile, [''])
test('gadt10', normal, compile_fail, [''])
test('gadt11', normal, compile_fail, [''])
test('gadt13', normal, compile_fail, [''])
test('gadt13', normal, compile, [''])
test('gadt14', normal, compile, [''])
test('gadt15', normal, compile, [''])
test('gadt16', normal, compile, [''])
......@@ -70,10 +70,8 @@ test('data2', normal, compile, [''])
test('termination', normal, compile, [''])
test('set', normal, compile, [''])
test('scoped', expect_broken(1823), compile, [''])
test('gadt-escape1', normal, compile_fail, [''])
test('scoped', normal, compile, [''])
test('gadt-escape1', normal, compile, [''])
# New ones from Dimitrios
......
......@@ -9,11 +9,12 @@ data Hidden = forall t . Hidden (ExpGADT t) (ExpGADT t)
hval = Hidden (ExpInt 0) (ExpInt 1)
-- With the type sig this is ok, but without it should
-- be rejected becuase the result type is wobbly
-- With the type sig this is ok, but without it maybe
-- should be rejected becuase the result type is wobbly
-- weird1 :: ExpGADT Int
weird1 = case (hval :: Hidden) of Hidden (ExpInt _) a -> a
-- Hidden t (ExpInt (co :: t ~ Int) _ :: ExpGADT t) (a :: ExpGADT t)
weird2 :: ExpGADT Int
weird2 = case (hval :: Hidden) of Hidden (ExpInt _) a -> a
gadt-escape1.hs:16:53:
GADT pattern match with non-rigid result type `t'
Solution: add a type signature for the entire case expression
In a case alternative: Hidden (ExpInt _) a -> a
In the expression:
case (hval :: Hidden) of { Hidden (ExpInt _) a -> a }
In the definition of `weird1':
weird1 = case (hval :: Hidden) of { Hidden (ExpInt _) a -> a }
......@@ -10,5 +10,5 @@ data Term a where
I :: Int -> Term Int
shw (I t) = ("I "++) . shows t
shw (B t) = ("B "++) . shows t
-- shw (B t) = ("B "++) . shows t
gadt13.hs:12:6:
GADT pattern match in non-rigid context for `I'
Probable solution: add a type signature for `shw'
In the pattern: I t
In the definition of `shw': shw (I t) = ("I " ++) . shows t
gadt21.hs:21:60:
Could not deduce (Ord a1) from the context (a ~ Set a1)
arising from a use of `f' at gadt21.hs:21:60-62
Possible fix:
add (Ord a1) to the context of the constructor `TypeSet'
In the first argument of `Just', namely `(f e)'
In the expression: Just (f e)
In the definition of `withOrdDynExpr':
withOrdDynExpr (DynExpr e@(Const (TypeSet _) _)) f = Just (f e)
gadt21.hs:21:60:
Could not deduce (Ord a1) from the context (a ~ Set a1)
arising from a use of `f'
Possible fix:
add (Ord a1) to the context of
the data constructor `TypeSet'
or the data constructor `DynExpr'
or the type signature for `withOrdDynExpr'
In the first argument of `Just', namely `(f e)'
In the expression: Just (f e)
In an equation for `withOrdDynExpr':
withOrdDynExpr (DynExpr e@(Const (TypeSet _) _)) f = Just (f e)
{-# OPTIONS -fglasgow-exts #-}
{-# LANGUAGE GADTs, RankNTypes, ScopedTypeVariables #-}
-- From Yann Regis-Gianas at INRIA
......
gadt7.hs:12:32:
GADT pattern match in non-rigid context for `K'
Probable solution: add a type signature for the scrutinee of the case expression
In the pattern: K
In a case alternative: K -> y1
In the expression: case t1 of { K -> y1 }
gadt7.hs:15:33:
GADT pattern match in non-rigid context for `K'
Probable solution: add a type signature for the scrutinee of the case expression
In the pattern: K
In a case alternative: K -> y1
In the expression: case t1 of { K -> y1 }
lazypat.hs:7:3:
A lazy (~) pattern cannot match existential or GADT data constructors
`a' is a rigid type variable bound by
the constructor `T' at lazypat.hs:7:5
lazypat.hs:7:5:
An existential or GADT data constructor cannot be used
inside a lazy (~) pattern
In the pattern: T x f
In the pattern: ~(T x f)
In the definition of `f': f ~(T x f) = f x
In an equation for `f': f ~(T x f) = f x
rw.hs:14:47:
Couldn't match expected type `a' against inferred type `Int'
Couldn't match type `a' with `Int'
`a' is a rigid type variable bound by
the type signature for `writeInt' at rw.hs:12:14
In the second argument of `writeIORef', namely `(1 :: Int)'
......@@ -8,7 +8,7 @@ rw.hs:14:47:
In a case alternative: ~(Li x) -> writeIORef ref (1 :: Int)
rw.hs:19:51:
Couldn't match expected type `a' against inferred type `Bool'
Couldn't match type `a' with `Bool'
`a' is a rigid type variable bound by
the type signature for `readBool' at rw.hs:16:14
In the second argument of `(.)', namely `not'
......
{-# OPTIONS_GHC -XGADTs -XScopedTypeVariables -XPatternSignatures #-}
{-# LANGUAGE GADTs, ScopedTypeVariables #-}
-- Tests for scoped type variables and GADTs
......