[add ghc typecheck failure tests
John Meacham <john@repetae.net>**20120205003034
 Ignore-this: bfd5fb0ec2acfbf7f702cc7d875fabd5
] adddir ./regress/tests/1_typecheck/4_fail/ghc
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef01.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef01.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef01 where
+
+class OtherCls a where
+    type OtherTyp a
+
+class Cls a where
+    type Typ a
+    type OtherType a = Int
+      -- Default for another class AT: want error
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef01.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef01.stderr 1
+
+AssocTyDef01.hs:9:10:
+    `OtherType' is not a (visible) associated type of class `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef02.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef02.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef02 where
+
+class Cls a where
+    type Typ a
+    type Typ b = Int
+      -- Default is not parametric in type class params
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef02.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef02.stderr 1
+
+AssocTyDef02.hs:6:5:
+    Type indexes must match class instance head
+    Found `b' but expected `a'
+    In the type synonym instance default declaration for `Typ'
+    In the class declaration for `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef03.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef03.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef03 where
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef03.hs 4
+class Cls a where
+    data Typ a
+    type Typ a = Int
+      -- Default for data family :-(
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef03.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef03.stderr 1
+
+AssocTyDef03.hs:6:5:
+    Wrong category of family instance; declaration was for a data type
+    In the type synonym instance default declaration for `Typ'
+    In the class declaration for `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef04.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef04.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef04 where
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef04.hs 4
+class Cls a where
+    type Typ a
+    type Typ a = Maybe
+      -- Wrong kind for default
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef04.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef04.stderr 1
+
+AssocTyDef04.hs:6:18:
+    Expecting one more argument to `Maybe'
+    In the type `Maybe'
+    In the type synonym instance default declaration for `Typ'
+    In the class declaration for `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef05.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef05.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef05 where
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef05.hs 4
+class Cls a where
+    type Typ a
+    type Typ = Maybe
+      -- Too few params for default
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef05.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef05.stderr 1
+
+AssocTyDef05.hs:6:5:
+    Number of parameters must match family declaration; expected 1
+    In the type synonym instance default declaration for `Typ'
+    In the class declaration for `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef06.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef06.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef06 where
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef06.hs 4
+class Cls a where
+    type Typ a
+    type Typ a Int = Int
+      -- Too many params for default
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef06.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef06.stderr 1
+
+AssocTyDef06.hs:6:5:
+    Number of parameters must match family declaration; expected 1
+    In the type synonym instance default declaration for `Typ'
+    In the class declaration for `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef07.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef07.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef07 where
+
+class Cls a where
+    type Typ a = Int
+     -- Default without family
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef07.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef07.stderr 1
+
+AssocTyDef07.hs:5:10:
+    `Typ' is not a (visible) associated type of class `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef08.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef08.hs 1
+module AssocTyDef07 where
+
+class Cls a where
+    type Typ a = Int
+     -- Default without family OR extension flag
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef08.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef08.stderr 1
+
+AssocTyDef08.hs:4:10:
+    `Typ' is not a (visible) associated type of class `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef09.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef09.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module AssocTyDef01 where
+
+type family OtherTyp a
+
+class Cls a where
+    type Typ a
+    type OtherType a = Int
+      -- Default for top level AT: want error
addfile ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef09.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/AssocTyDef09.stderr 1
+
+AssocTyDef09.hs:8:10:
+    `OtherType' is not a (visible) associated type of class `Cls'
addfile ./regress/tests/1_typecheck/4_fail/ghc/FailDueToGivenOverlapping.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/FailDueToGivenOverlapping.hs 1
+{-# LANGUAGE FlexibleContexts #-}
+
+module FailDueToGivenOverlapping where
+
+class C a where
+
+class D a where 
+ dop :: a -> ()
+
+
+instance C a => D [a] 
+
+-- should succeed since we can't learn anything more for 'a'
+foo :: (C a, D [Int]) => a -> () 
+foo x = dop [x] 
+
+
+class E a where 
+ eop :: a -> () 
+
+instance E [a] where 
+ eop = undefined
+
+-- should fail since we can never be sure that we learnt 
+-- everything about the free unification variable.
+bar :: E [Int] => () -> ()
+bar _ = eop [undefined]
addfile ./regress/tests/1_typecheck/4_fail/ghc/FailDueToGivenOverlapping.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/FailDueToGivenOverlapping.stderr 1
+
+FailDueToGivenOverlapping.hs:27:9:
+    Overlapping instances for E [t0]
+      arising from a use of `eop'
+    Matching instances:
+      instance E [a] -- Defined at FailDueToGivenOverlapping.hs:21:10
+    Matching givens (or their superclasses):
+      (E [Int])
+        bound by the type signature for bar :: E [Int] => () -> ()
+        at FailDueToGivenOverlapping.hs:27:1-23
+    (The choice depends on the instantiation of `t0')
+    In the expression: eop [undefined]
+    In an equation for `bar': bar _ = eop [undefined]
addfile ./regress/tests/1_typecheck/4_fail/ghc/FrozenErrorTests.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/FrozenErrorTests.hs 1
+{-# LANGUAGE RankNTypes, GADTs, TypeFamilies #-}
+module Test where 
+
+
+data T a where 
+  MkT :: a -> T a 
+  MkT2 :: forall a b. (b ~ T b) => b -> T a
+  MkT3 :: forall a. (a ~ Bool) => T a 
+-- Occurs checks in givens
+foo :: forall a. (a ~ T a) => a -> a 
+foo x = x 
+
+blah x = case x of 
+           MkT2 y -> ()
+
+-- Mismatches in givens 
+bloh :: T Int -> () 
+bloh x = case x of 
+           MkT3 -> () 
+
+type family F a b 
+type family G a b
+type instance F a Bool = a 
+type instance G a Char = a
+
+goo1 :: forall a b. (F a b ~ [a]) => b -> a  -> a
+goo1 = undefined 
+
+goo2 :: forall a. G a Char ~ [Int] => a -> a
+goo2 = undefined
+
+-- Just an occurs check
+test1 = goo1 False undefined
+
+-- A frozen occurs check, now transformed to decomposition error
+test2 = goo2 (goo1 False undefined)
+test3 = goo1 False (goo2 undefined)
+
+
+-- A frozen occurs check, now transformed to both a decomposition and occurs check
+data M a where 
+  M :: M a 
+data T2 a b where
+  T2 :: T2 a b 
+
+goo3 :: forall a b. F a b ~ T2 (M a) a => b -> a -> a 
+goo3 = undefined
+
+goo4 :: forall a c. G a Char ~ T2 (T2 c c) c => a -> a
+goo4 = undefined 
+
+test4 = goo4 (goo3 False undefined)
+test5 = goo3 False (goo4 undefined)
+
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/FrozenErrorTests.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/FrozenErrorTests.stderr 1
+
+FrozenErrorTests.hs:11:1:
+    Couldn't match type `a' with `T a'
+      `a' is a rigid type variable bound by
+          the type signature for foo :: a ~ T a => a -> a
+          at FrozenErrorTests.hs:11:1
+    Inaccessible code in
+      the type signature for foo :: a ~ T a => a -> a
+
+FrozenErrorTests.hs:14:12:
+    Couldn't match type `b' with `T b'
+      `b' is a rigid type variable bound by
+          a pattern with constructor
+            MkT2 :: forall a b. b ~ T b => b -> T a,
+          in a case alternative
+          at FrozenErrorTests.hs:14:12
+    Inaccessible code in
+      a pattern with constructor
+        MkT2 :: forall a b. b ~ T b => b -> T a,
+      in a case alternative
+    In the pattern: MkT2 y
+    In a case alternative: MkT2 y -> ()
+    In the expression: case x of { MkT2 y -> () }
+
+FrozenErrorTests.hs:19:12:
+    Couldn't match type `Int' with `Bool'
+    Inaccessible code in
+      a pattern with constructor
+        MkT3 :: forall a. a ~ Bool => T a,
+      in a case alternative
+    In the pattern: MkT3
+    In a case alternative: MkT3 -> ()
+    In the expression: case x of { MkT3 -> () }
+
+FrozenErrorTests.hs:33:9:
+    Occurs check: cannot construct the infinite type: a0 = [a0]
+    In the expression: goo1 False undefined
+    In an equation for `test1': test1 = goo1 False undefined
+
+FrozenErrorTests.hs:36:15:
+    Couldn't match type `[Int]' with `Int'
+    In the first argument of `goo2', namely `(goo1 False undefined)'
+    In the expression: goo2 (goo1 False undefined)
+    In an equation for `test2': test2 = goo2 (goo1 False undefined)
+
+FrozenErrorTests.hs:37:9:
+    Couldn't match type `Int' with `[Int]'
+    In the expression: goo1 False (goo2 undefined)
+    In an equation for `test3': test3 = goo1 False (goo2 undefined)
+
+FrozenErrorTests.hs:52:15:
+    Occurs check: cannot construct the infinite type:
+      c0 = T2 (T2 c0 c0) c0
+    In the first argument of `goo4', namely `(goo3 False undefined)'
+    In the expression: goo4 (goo3 False undefined)
+    In an equation for `test4': test4 = goo4 (goo3 False undefined)
+
+FrozenErrorTests.hs:52:15:
+    Couldn't match type `T2 c0' with `M'
+    In the first argument of `goo4', namely `(goo3 False undefined)'
+    In the expression: goo4 (goo3 False undefined)
+    In an equation for `test4': test4 = goo4 (goo3 False undefined)
+
+FrozenErrorTests.hs:53:9:
+    Occurs check: cannot construct the infinite type:
+      c0 = T2 (T2 c0 c0) c0
+    In the expression: goo3 False (goo4 undefined)
+    In an equation for `test5': test5 = goo3 False (goo4 undefined)
+
+FrozenErrorTests.hs:53:9:
+    Couldn't match type `T2 c0' with `M'
+    In the expression: goo3 False (goo4 undefined)
+    In an equation for `test5': test5 = goo3 False (goo4 undefined)
addfile ./regress/tests/1_typecheck/4_fail/ghc/IPFail.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/IPFail.hs 1
+{-# LANGUAGE ImplicitParams #-}
+
+module IPFail where
+
+f0 :: (?x :: Int) => () -> Bool
+f0 () = let ?x = 5 in ?x
addfile ./regress/tests/1_typecheck/4_fail/ghc/IPFail.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/IPFail.stderr 1
+
+IPFail.hs:6:18:
+    Could not deduce (Num Bool) arising from the literal `5'
+    from the context (?x::Int)
+      bound by the type signature for f0 :: (?x::Int) => () -> Bool
+      at IPFail.hs:6:1-24
+    Possible fix:
+      add (Num Bool) to the context of
+        the type signature for f0 :: (?x::Int) => () -> Bool
+      or add an instance declaration for (Num Bool)
+    In the expression: 5
+    In the expression: let ?x = 5 in ?x
+    In an equation for `f0': f0 () = let ?x = 5 in ?x
addfile ./regress/tests/1_typecheck/4_fail/ghc/LongWayOverlapping.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/LongWayOverlapping.hs 1
+{-# LANGUAGE TypeFamilies, MultiParamTypeClasses
+  , FlexibleContexts, FlexibleInstances, UndecidableInstances
+  , TypeSynonymInstances, GeneralizedNewtypeDeriving
+  , OverlappingInstances 
+  #-}
+
+module LongWayOverlapping where
+
+
+class M a where 
+
+class M a => XMLG a 
+
+instance M [a] 
+
+instance XMLG [m] where     -- Generates an implication wanted:  forall m. M [m]
+
+class M a => EmbAsChild a b where 
+  emb :: b -> [a]
+
+
+instance EmbAsChild [Char] Bool where 
+  emb _ = emb 'c'
+
+
+  -- This one generates an unsolvable EmbAsChild [Char] Char
+
+-- Original problem is: 
+-- [w] EmbAsChild [Char] Char 
+-- [w] forall m. M [m]
+-- Now, by converting the wanted to given and pushing it inside the implication 
+-- we have the following:
+-- [g] EmbAsChild [Char] Char 
+-- [g] M [Char]   <~~ The superclass of the first given! 
+-- [w] M [m] 
+-- And now OOPS we can't solve M [m] because we are supposed to delay our choice 
+-- as much as possible! 
+
+-- DV:
+-- One possible solution is to STOP PUSHING wanteds as givens inside an implication
+-- in a checking context. I think it's the best thing to do and I've implemented it.
+
+-- In inference mode that's ok and the error message is very comprehensible, see
+-- test case PushedInFlatsOverlap.hs 
addfile ./regress/tests/1_typecheck/4_fail/ghc/LongWayOverlapping.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/LongWayOverlapping.stderr 1
+
+LongWayOverlapping.hs:23:11:
+    No instance for (EmbAsChild [Char] Char)
+      arising from a use of `emb'
+    Possible fix:
+      add an instance declaration for (EmbAsChild [Char] Char)
+    In the expression: emb 'c'
+    In an equation for `emb': emb _ = emb 'c'
+    In the instance declaration for `EmbAsChild [Char] Bool'
addfile ./regress/tests/1_typecheck/4_fail/ghc/SCLoop.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/SCLoop.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
+
+-- This is a superclass loop test
+-- It should fail with a type error, but
+-- it's all too easy to succeed with a bogus recursive dictionary
+
+module SCLoop where
+
+class SC a where 
+  f :: a -> ()
+
+class SC a => A a b where 
+  op :: a -> b -> ()
+  op x _ = f x
+
+instance A a b => A a [b]
+-- dfun1 :: \d::(A a b) -> DA (sc d)
+
+instance SC a  => A a (Maybe b)
+-- dfun2 :: \d::SC a -> DA d
+
+foo = op () ([Just True])
+
+{- Here is the explanation: 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+[Wanted]  d1 : (A () [Maybe Bool])
+~~~>                              d1 := dfun1 d2 
+[Wanted]  d2 : (A () (Maybe Bool))
+~~~>                              d2 := dfun2 d3 
+[Wanted]  d3 : SC ()
+[Derived] d4 : SC ()               d4 := sc d1
+~~~> 
+      d3 := sc d1
+      isGoodRecEv will check: 
+                  d3 == sc d1 
+                     == sc (dfun1 d2) 
+                     == sc (dfun1 (dfun2 d3) ==> PASSES!   (gravity = 1)
+        This is BAD BAD BAD, because we get a loop
+
+      If we had inlined the definitions:
+                  d3 == sc d1 
+                     == sc (DA (sc d2))
+                     == sc (DA (sc (DA d3))) ==> DOES NOT! (gravity = 0)
+
+We should get "No instance for SC ()"
+-}
+
+
+
+
+
+
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/SCLoop.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/SCLoop.stderr 1
+
+SCLoop.hs:22:7:
+    No instance for (SC ())
+      arising from a use of `op'
+    Possible fix: add an instance declaration for (SC ())
+    In the expression: op () ([Just True])
+    In an equation for `foo': foo = op () ([Just True])
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1595.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1595.hs 1
+--
+-- Check that we produce only one error message for each type
+-- signature. See ticket #1595.
+--
+
+module T1595 where
+
+foo1, bar1 :: DoesNotExist
+foo1 = undefined
+bar1 = undefined
+
+class Test a where
+  foo2, bar2 :: a -> DoesNotExist
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1595.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1595.stderr 1
+
+T1595.hs:8:15:
+    Not in scope: type constructor or class `DoesNotExist'
+
+T1595.hs:13:22:
+    Not in scope: type constructor or class `DoesNotExist'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1633.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1633.hs 1
+-- This just tests what the kind error message looks like
+-- Trac #1633
+
+module T1633 where
+
+instance Functor Bool
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1633.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1633.stderr 1
+
+T1633.hs:6:18:
+    Kind mis-match
+    The first argument of `Functor' should have kind `* -> *',
+    but `Bool' has kind `*'
+    In the instance declaration for `Functor Bool'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1897a.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1897a.hs 1
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module Foo where
+
+class Wob a b where
+   to :: a -> b
+   from :: b -> a
+
+foo x = [x, to (from x)]
+-- Ambiguous type:  Wob a b => b -> [b]
+-- Should be rejected
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1897a.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1897a.stderr 1
+
+T1897a.hs:9:1:
+    Ambiguous type variable `a0' in the constraint:
+      (Wob a0 b) arising from the ambiguity check for `foo'
+    Probable fix: add a type signature that fixes these type variable(s)
+    When checking that `foo'
+      has the inferred type `forall a b. Wob a b => b -> [b]'
+    Probable cause: the inferred type is ambiguous
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1899.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1899.hs 1
+-- Test for Trac #1899
+
+module T1899 where
+
+ data Constraint a = Formula [[Proposition a]]
+ data Proposition a = Prop a
+                    | Auxiliary [Proposition a]
+
+ transRHS :: [a] -> Int -> Constraint a
+ transRHS varSet b =
+     if b < 0
+       then Formula [[Prop (Auxiliary undefined)]]
+       else Formula $
+                 [[Prop (Auxiliary varSet),
+                   Prop (Auxiliary varSet)]
+                 ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1899.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1899.stderr 1
+
+T1899.hs:14:36:
+    Couldn't match type `a' with `Proposition a0'
+      `a' is a rigid type variable bound by
+          the type signature for transRHS :: [a] -> Int -> Constraint a
+          at T1899.hs:10:2
+    Expected type: [Proposition a0]
+      Actual type: [a]
+    In the first argument of `Auxiliary', namely `varSet'
+    In the first argument of `Prop', namely `(Auxiliary varSet)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T1987a.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T1987a.stderr 1
-
+ 
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2126.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2126.hs 1
+-- Trac #2126
+
+module Foo where
+
+newtype X
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2126.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2126.stderr 1
+
+T2126.hs:5:1:
+    A newtype must have exactly one constructor, but `X' has none
+    In the newtype declaration for `X'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2307.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2307.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+              OverlappingInstances, UndecidableInstances,
+	      IncoherentInstances,
+              FlexibleInstances #-}
+
+-- Trac #2307
+
+module ShouldFail where
+
+ class C a b c | a -> b, a -> c
+ instance C Int (Maybe String) Float
+ instance C Int (Maybe Bool)   Double
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2307.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2307.stderr 1
+
+T2307.hs:11:11:
+    Functional dependencies conflict between instance declarations:
+      instance [incoherent] C Int (Maybe String) Float
+        -- Defined at T2307.hs:11:11
+      instance [incoherent] C Int (Maybe Bool) Double
+        -- Defined at T2307.hs:12:11
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2414.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2414.hs 1
+-- Test for Trac #2414
+-- Should provoke an occurs-check error
+
+module ShouldFail where
+
+unfoldr :: (b -> Maybe (Bool, b)) -> Bool
+unfoldr = unfoldr
+
+f = unfoldr Just
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2414.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2414.stderr 1
+
+T2414.hs:9:13:
+    Occurs check: cannot construct the infinite type: b0 = (Bool, b0)
+    Expected type: b0 -> Maybe (Bool, b0)
+      Actual type: b0 -> Maybe b0
+    In the first argument of `unfoldr', namely `Just'
+    In the expression: unfoldr Just
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2538.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2538.hs 1
+
+-- Trac #2538
+module ShouldFail where
+import Data.Ix
+
+f :: (Eq a => a -> a) -> Int
+f = error "urk"
+
+g :: [Eq a => a -> a] -> Int
+g = error "urk"
+
+h :: Ix (Eq a => a -> a) => Int
+h = error "urk"
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2538.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2538.stderr 1
+
+T2538.hs:6:1:
+    Illegal polymorphic or qualified type: Eq a => a -> a
+    Perhaps you intended to use -XRankNTypes or -XRank2Types
+    In the type signature for `f': f :: (Eq a => a -> a) -> Int
+
+T2538.hs:9:1:
+    Illegal polymorphic or qualified type: Eq a => a -> a
+    Perhaps you intended to use -XImpredicativeTypes
+    In the type signature for `g': g :: [Eq a => a -> a] -> Int
+
+T2538.hs:12:1:
+    Illegal polymorphic or qualified type: Eq a => a -> a
+    In the type signature for `h': h :: Ix (Eq a => a -> a) => Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2688.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2688.hs 1
+{-# OPTIONS_GHC -XFunctionalDependencies -XMultiParamTypeClasses #-}
+
+module T2688 where
+
+class VectorSpace v s | v -> s where
+    (*^)    :: s -> v -> v
+    (^/)    :: v -> s -> v
+    v ^/ s = v *^ (1/s)
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2688.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2688.stderr 1
+
+T2688.hs:8:22:
+    Could not deduce (s ~ v)
+    from the context (VectorSpace v s)
+      bound by the class declaration for `VectorSpace'
+      at T2688.hs:(5,1)-(8,23)
+      `s' is a rigid type variable bound by
+          the class declaration for `VectorSpace' at T2688.hs:5:21
+      `v' is a rigid type variable bound by
+          the class declaration for `VectorSpace' at T2688.hs:5:19
+    In the second argument of `(/)', namely `s'
+    In the second argument of `(*^)', namely `(1 / s)'
+    In the expression: v *^ (1 / s)
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2714.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2714.hs 1
-
+{-# LANGUAGE ScopedTypeVariables #-}
+
+-- Trac #2714
+
+module T2714 where
+
+f :: ((a -> b) -> b) -> (forall c. c -> a)
+f = ffmap
+
+ffmap :: Functor f => (p->q) -> f p -> f q
+ffmap = error "urk"
+
+{-
+   a ~ f q
+   c ~ f p
+   (p->q) ~ (a->b) -> b
+
+ =>
+   a ~ f q
+   c ~ f p
+   p ~ a->b
+   q ~ b
+ =>
+   a ~ f b
+   c ~ f (a->b)
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2714.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2714.stderr 1
+
+T2714.hs:8:5:
+    Couldn't match type `a' with `f0 b'
+      `a' is a rigid type variable bound by
+          the type signature for f :: ((a -> b) -> b) -> forall c. c -> a
+          at T2714.hs:8:1
+    Expected type: ((a -> b) -> b) -> c -> a
+      Actual type: ((a -> b) -> b) -> f0 (a -> b) -> f0 b
+    In the expression: ffmap
+    In an equation for `f': f = ffmap
+
+T2714.hs:8:5:
+    Couldn't match type `c' with `f0 (f0 b -> b)'
+      `c' is a rigid type variable bound by
+          the type signature for f :: ((a -> b) -> b) -> c -> a
+          at T2714.hs:8:1
+    Expected type: c
+      Actual type: f0 (a -> b)
+    Expected type: ((a -> b) -> b) -> c -> a
+      Actual type: ((a -> b) -> b) -> f0 (a -> b) -> f0 b
+    In the expression: ffmap
+    In an equation for `f': f = ffmap
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2806.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2806.hs 1
+
+{-# LANGUAGE MagicHash #-}
+{-# OPTIONS_GHC -Werror #-}
+
+-- Trac #2806
+
+module Foo where
+
+import GHC.Base
+
+foo :: Int
+foo = 3
+    where (I# _x) = 4
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2806.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2806.stderr 1
+
+T2806.hs:13:11:
+    Warning: Pattern bindings containing unlifted types should use an outermost bang pattern:
+               (I# _x) = 4
+    In an equation for `foo':
+        foo
+          = 3
+          where
+              (I# _x) = 4
+
+<no location info>: 
+Failing due to -Werror.
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2846b.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2846b.hs 1
+{-# LANGUAGE ImpredicativeTypes, FlexibleContexts #-}
+module T2846 where
+
+f :: String
+f = show ([1,2,3] :: [Num a => a])
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2846b.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2846b.stderr 1
+
+T2846b.hs:5:5:
+    No instance for (Show (Num a0 => a0))
+      arising from a use of `show'
+    Possible fix: add an instance declaration for (Show (Num a0 => a0))
+    In the expression: show ([1, 2, 3] :: [Num a => a])
+    In an equation for `f': f = show ([1, 2, 3] :: [Num a => a])
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2994.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2994.hs 1
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+-- Trac #2994
+
+module T2994 where
+
+class MonadReader a b 
+
+newtype Reader' r a = Reader' (r -> a)
+
+instance MonadReader Int
+
+instance MonadReader (Reader' r)
+
+instance MonadReader r r (Reader' r)
addfile ./regress/tests/1_typecheck/4_fail/ghc/T2994.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T2994.stderr 1
+
+T2994.hs:11:10:
+    Expecting one more argument to `MonadReader Int'
+    In the instance declaration for `MonadReader Int'
+
+T2994.hs:13:23:
+    Expecting one more argument to `Reader' r'
+    In the instance declaration for `MonadReader (Reader' r)'
+
+T2994.hs:15:10:
+    `MonadReader' is applied to too many type arguments
+    In the instance declaration for `MonadReader r r (Reader' r)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3102.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3102.hs 1
+{-# OPTIONS -XImplicitParams -XRankNTypes #-}
+ module Bug where
+
+t :: forall a. ((?p :: Int) => a) -> String
+t _ = "Hello"
+
+f :: (forall a. a -> String) -> Int
+f _ = 3
+
+result :: Int
+result = f t
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3102.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3102.stderr 1
+
+T3102.hs:11:12:
+    Couldn't match type `a' with `(?p::Int) => a0'
+      `a' is a rigid type variable bound by
+          a type expected by the context: a -> String at T3102.hs:11:10
+    Expected type: a -> String
+      Actual type: ((?p::Int) => a0) -> String
+    In the first argument of `f', namely `t'
+    In the expression: f t
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3155.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3155.hs 1
+{-# LANGUAGE GADTs, TypeOperators #-}
+module T3155 where
+
+-- Test Trac #3155
+-- Gave bad error message in GHC 6.10
+
+data Any s where
+  Any :: s ix -> ix -> Any s
+
+data AnyR s r where
+  AnyR :: s ix -> r ix -> AnyR s r
+
+unR :: (forall ix. r ix -> ix) -> AnyR s r -> Any s
+unR f (AnyR ix rix) = Any ix (f rix)
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3155.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3155.stderr 1
+
+T3155.hs:13:18:
+    Illegal symbol '.' in type
+    Perhaps you intended -XRankNTypes or similar flag
+    to enable explicit-forall syntax: forall <tvs>. <type>
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3176.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3176.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- Trac #3176
+
+module Foo where
+
+data ES = forall a. Show a => ES {unES:: a}
+
+smallPrintES f t = show $ unES $ f t 
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3176.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3176.stderr 1
+
+T3176.hs:9:27:
+    Cannot use record selector `unES' as a function due to escaped type variables
+    Probable fix: use pattern-matching syntax instead
+    In the expression: unES
+    In the second argument of `($)', namely `unES $ f t'
+    In the expression: show $ unES $ f t
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3323.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3323.hs 1
+-- Trac #3323
+module T3323 where
+
+import GHC.IO.Handle.Types
+import GHC.IO.Handle.Internals
+
+-- The point here is that Handle__ is an existential type, 
+-- so the haDevice field can't be updated.
+--
+-- The bug was that, haDevice is a "naughty" selector, we 
+-- couldn't find its type constructor.  
+-- 
+-- This only happened when you go via an interface file, which is why
+-- this test imports an existential.  To make the test more
+-- standalone, you'd need to make it a two-module test
+
+f :: Handle__ -> Handle__
+f h = h {haDevice=undefined}
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3323.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3323.stderr 1
+
+T3323.hs:18:7:
+    Record update for insufficiently polymorphic field: haDevice :: dev
+    In the expression: h {haDevice = undefined}
+    In an equation for `f': f h = h {haDevice = undefined}
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3406.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3406.hs 1
-
+{-# LANGUAGE ScopedTypeVariables #-}
+
+-- Trac #3406
+-- A pattern signature that discards the bound variables
+
+module T3406 where
+
+type ItemColID a b = Int  -- Discards a,b
+
+get :: ItemColID a b -> a -> ItemColID a b
+get (x :: ItemColID a b) = x :: ItemColID a b
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3406.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3406.stderr 1
+
+T3406.hs:11:6:
+    The type variables `a, b'
+    should be bound by the pattern signature `ItemColID a b'
+    but are actually discarded by a type synonym
+    To fix this, expand the type synonym
+    [Note: I hope to lift this restriction in due course]
+    In the pattern: x :: ItemColID a b
+    In an equation for `get':
+        get (x :: ItemColID a b) = x :: ItemColID a b
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3468.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3468.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+module T3468 where
+
+import {-# SOURCE #-} T3468
+
+data Tool d = forall a r . F a
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3468.hs-boot
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3468.hs-boot 1
+module T3468 where
+
+data Tool 
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3468.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3468.stderr 1
+
+T3468.hs-boot:3:6:
+    Type constructor `Tool' has conflicting definitions in the module and its hs-boot file
+    Main module: data Tool d
+                     RecFlag Recursive
+                     = F :: forall d a r. a -> Tool d Stricts: _
+                     FamilyInstance: none
+    Boot file:   abstract(False) Tool
+                     RecFlag NonRecursive
+                     FamilyInstance: none
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3540.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3540.hs 1
+{-# LANGUAGE ImplicitParams, TypeFamilies #-}
+module T3540 where
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3540.hs 4
+thing ::  (a~Int)
+thing = undefined
+
+thing1 ::  Int -> (a~Int)
+thing1 = undefined
+
+thing2 ::  (a~Int) -> Int
+thing2 = undefined
+
+thing3 :: (?dude :: Int) -> Int
+thing3 = undefined
+
+thing4:: (Eq a) -> Int
+thing4 = undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3540.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3540.stderr 1
+
+T3540.hs:4:12:
+    Predicate `a ~ Int' used as a type
+    In the type signature for `thing': thing :: a ~ Int
+
+T3540.hs:7:20:
+    Predicate `a ~ Int' used as a type
+    In the type signature for `thing1': thing1 :: Int -> (a ~ Int)
+
+T3540.hs:10:13:
+    Predicate `a ~ Int' used as a type
+    In the type signature for `thing2': thing2 :: (a ~ Int) -> Int
+
+T3540.hs:13:12:
+    Predicate `?dude :: Int' used as a type
+    In the type signature for `thing3': thing3 :: (?dude :: Int) -> Int
+
+T3540.hs:16:11:
+    Predicate `Eq a' used as a type
+    In the type signature for `thing4': thing4 :: (Eq a) -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3592.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3592.hs 1
+{-# LANGUAGE RankNTypes #-}
+
+module T3592 where
+
+type T a = Show a => a
+
+f :: T a -> String
+f = show
+
+g :: T a -> String
+g x = show x
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3592.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3592.stderr 1
+
+T3592.hs:8:5:
+    No instance for (Show (T a))
+      arising from a use of `show'
+    Possible fix: add an instance declaration for (Show (T a))
+    In the expression: show
+    In an equation for `f': f = show
+
+T3592.hs:11:7:
+    No instance for (Show a)
+      arising from a use of `show'
+    In the expression: show x
+    In an equation for `g': g x = show x
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3613.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3613.hs 1
+-- c.f Trac #3613
+
+module T3613 where
+
+import Control.Monad
+
+foo :: Maybe ()
+foo = return ()
+
+bar :: IO ()
+bar = return ()
+
+fun1 = let fooThen m = foo>> m
+       in fooThen (bar>> undefined)
+
+fun2 = let fooThen m = foo>> m
+       in fooThen (do {bar; undefined})
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3613.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3613.stderr 1
+
+T3613.hs:14:20:
+    Couldn't match expected type `Maybe a0' with actual type `IO ()'
+    In the first argument of `(>>)', namely `bar'
+    In the first argument of `fooThen', namely `(bar >> undefined)'
+    In the expression: fooThen (bar >> undefined)
+
+T3613.hs:17:24:
+    Couldn't match expected type `Maybe a0' with actual type `IO ()'
+    In a stmt of a 'do' block: bar
+    In the first argument of `fooThen', namely
+      `(do { bar;
+             undefined })'
+    In the expression:
+      fooThen
+        (do { bar;
+              undefined })
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3950.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3950.hs 1
+{-# LANGUAGE GADTs #-}
+
+module T3950 where
+
+-- Id :: (* -> * -> *) -> * -> * -> *
+data Id p x y = Id (p x y)
+
+-- Sealed :: (* -> *) -> *
+data Sealed p where
+    Sealed :: p x -> Sealed p
+
+-- w :: (* -> * -> *) -> *
+-- Id p :: * -> * -> *
+rp :: Bool -> Maybe (w (Id p))
+rp _ = Just rp'
+     where rp' :: Sealed (Id p x)
+           rp' = undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3950.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3950.stderr 1
+
+T3950.hs:15:13:
+    Couldn't match expected type `Id p' with actual type `Id p x0'
+    Expected type: w (Id p)
+      Actual type: Sealed (Id p x0)
+    In the first argument of `Just', namely rp'
+    In the expression: Just rp'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3966.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3966.hs 1
+{-# OPTIONS_GHC -Werror -O #-}
+-- Add -O so the UNPACK has some effect
+
+module T3966 where
+
+data Foo a b = Foo {-# UNPACK #-} !(a -> b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/T3966.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T3966.stderr 1
+
+T3966.hs:6:16:
+    Warning: Ignoring unusable UNPACK pragma on the
+             first argument of `Foo'
+    In the definition of data constructor `Foo'
+    In the data type declaration for `Foo'
+
+<no location info>: 
+Failing due to -Werror.
addfile ./regress/tests/1_typecheck/4_fail/ghc/T4875.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T4875.hs 1
+ {-# OPTIONS  -XMultiParamTypeClasses  -XFunctionalDependencies  -XFlexibleInstances #-}  
+module HaskellBug where
+
+data Relation c -- The basic Relation
+      = Rel { relnm :: String -- The name of the relation
+            , relsrc :: c -- Source concept
+            , reltrg :: c -- ^Target concept
+            }
+        deriving Eq
+
+-- This declaration is ok; should not get an error here
+class (Eq concept)=> Association rel concept | rel -> concept where
+     source, target :: rel -> concept
+      -- e.g. Declaration Concept -> Concept
+     sign  :: rel -> (concept,concept)
+     sign x = (source x,target x)
+     homogeneous :: rel -> Bool
+     homogeneous s = source s == target s
+
+instance (Eq c)=>Association (Relation c) c where
+     source = relsrc
+     target = reltrg
+
+-- This declaration has a kind error
+-- The error should be reported here
+class (Eq c, Association r c) => Morphic r c where
+     multiplicities :: r c -> [c]
+     multiplicities _ = []
addfile ./regress/tests/1_typecheck/4_fail/ghc/T4875.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T4875.stderr 1
+
+T4875.hs:27:24:
+    `r' is applied to too many type arguments
+    In the type `r c -> [c]'
+    In the class declaration for `Morphic'
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5084.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5084.hs 1
+module T5084 where
+
+-- Superclass method pragma test (fail)
+class Foo a where
+    bar :: a -> a
+    {-# INLINE bar #-}
+
+-- Instance test (ok)
+instance Foo Int where
+    bar = (+1)
+    {-# INLINE bar #-}
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5084.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5084.stderr 1
+
+T5084.hs:6:5:
+    The INLINE pragma for default method `bar' lacks an accompanying binding
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5095.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5095.hs 1
+{-# LANGUAGE FlexibleInstances, OverlappingInstances, UndecidableInstances #-}
+
+module Test where
+
+instance Show a => Eq a where
+   x == y =  length (show x) == length (show y)
+
+f :: Show a => a -> a -> Bool
+f x y = x == y
+
+p = f (3 :: Int) 4
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5095.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5095.stderr 1
+
+T5095.hs:9:11:
+    Overlapping instances for Eq a
+      arising from a use of `=='
+    Matching instances:
+      instance [overlap ok] Show a => Eq a -- Defined at T5095.hs:5:10
+      instance Eq () -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b) => Eq (a, b) -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) =>
+               Eq (a, b, c, d, e, f)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) =>
+               Eq (a, b, c, d, e, f, g)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) =>
+               Eq (a, b, c, d, e, f, g, h)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) =>
+               Eq (a, b, c, d, e, f, g, h, i)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
+                Eq j) =>
+               Eq (a, b, c, d, e, f, g, h, i, j)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
+                Eq j, Eq k) =>
+               Eq (a, b, c, d, e, f, g, h, i, j, k)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
+                Eq j, Eq k, Eq l) =>
+               Eq (a, b, c, d, e, f, g, h, i, j, k, l)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
+                Eq j, Eq k, Eq l, Eq m) =>
+               Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
+                Eq j, Eq k, Eq l, Eq m, Eq n) =>
+               Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
+        -- Defined in `GHC.Classes'
+      instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i,
+                Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) =>
+               Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
+        -- Defined in `GHC.Classes'
+      instance Eq GHC.Generics.Arity -- Defined in `GHC.Classes'
+      instance Eq GHC.Generics.Associativity -- Defined in `GHC.Classes'
+      instance Eq Bool -- Defined in `GHC.Classes'
+      instance Eq Char -- Defined in `GHC.Classes'
+      instance Eq Double -- Defined in `GHC.Classes'
+      instance Eq GHC.Generics.Fixity -- Defined in `GHC.Classes'
+      instance Eq Float -- Defined in `GHC.Classes'
+      instance Eq Int -- Defined in `GHC.Classes'
+      instance Eq Ordering -- Defined in `GHC.Classes'
+      instance Eq a => Eq [a] -- Defined in `GHC.Classes'
+      instance Eq Integer -- Defined in `integer-gmp:GHC.Integer.Type'
+    (The choice depends on the instantiation of `a'
+     To pick the first instance above, use -XIncoherentInstances
+     when compiling the other instance declarations)
+    In the expression: x == y
+    In an equation for `f': f x y = x == y
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5236.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5236.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts  #-}
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5236.hs 3
+module Main where 
+
+data A
+data B
+
+class Id a b | a -> b, b -> a
+
+instance Id A A
+instance Id B B
+
+loop :: Id A B => Bool
+loop = True
+
+f :: Bool 
+f = loop
+
+
+main :: IO () 
+main = return ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5236.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5236.stderr 1
+
+T5236.hs:17:5:
+    Couldn't match type `A' with `B'
+    When using functional dependencies to combine
+      Id A A,
+        arising from the dependency `a -> b'
+        in the instance declaration at T5236.hs:10:10
+      Id A B, arising from a use of `loop' at T5236.hs:17:5-8
+    In the expression: loop
+    In an equation for `f': f = loop
+
+T5236.hs:17:5:
+    Couldn't match type `B' with `A'
+    When using functional dependencies to combine
+      Id B B,
+        arising from the dependency `b -> a'
+        in the instance declaration at T5236.hs:11:10
+      Id A B, arising from a use of `loop' at T5236.hs:17:5-8
+    In the expression: loop
+    In an equation for `f': f = loop
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5246.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5246.hs 1
+{-# LANGUAGE ImplicitParams #-}
+
+-- Produced a duplicated error message in 7.0
+
+module T5246 where
+
+foo :: (?x :: Int) => a
+foo = undefined
+
+bar = let ?x = "hello"
+      in foo
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5246.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5246.stderr 1
+
+T5246.hs:11:10:
+    Couldn't match type `Int' with `[Char]'
+    In the expression: foo
+    In the expression: let ?x = "hello" in foo
+    In an equation for `bar': bar = let ?x = "hello" in foo
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5300.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5300.hs 1
+{-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses #-}
+module T5300 where
+
+import Control.Monad.State (StateT)
+
+class C1 a b c | a -> b
+class C2 a b c
+
+data T b = T
+
+f1 :: (Monad m, C1 a b c) => a -> StateT (T b) m a
+f1 f = undefined
+
+f2 :: (Monad m, C1 a1 b1 c1, C2 a2 b2 c2) => a1 -> StateT (T b2) m a2
+f2 fm = f1 fm >>= return . undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5300.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5300.stderr 1
+
+T5300.hs:15:9:
+    Ambiguous type variable `c0' in the constraint:
+      (C1 a1 b2 c0) arising from a use of `f1'
+    Probable fix: add a type signature that fixes these type variable(s)
+    In the first argument of `(>>=)', namely `f1 fm'
+    In the expression: f1 fm >>= return . undefined
+    In an equation for `f2': f2 fm = f1 fm >>= return . undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5570.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5570.hs 1
+{-# LANGUAGE MagicHash #-}
+module T5570 where
+
+import GHC.Exts
+
+main :: IO ()
+main = print $ D# $ 3.0##
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5570.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5570.stderr 1
+
+T5570.hs:7:16:
+    Couldn't match kind `#' against `*'
+    In the second argument of `($)', namely `D# $ 3.0##'
+    In the expression: print $ D# $ 3.0##
+    In an equation for `main': main = print $ D# $ 3.0##
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5573a.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5573a.hs 1
+{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
+module T5573a where
+
+import GHC.Exts
+
+-- This is ok
+foo1 x = (# x,x #)
+bar y = let (# x,  _ #) = foo1 y in x
+
+-- Nested unboxed tuple not ok
+foo2 x = (# x, (# True, False #) #)
+
+-- Unboxed tuple argument not ok
+foo3 (# x,y #) = x
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5573a.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5573a.stderr 1
+
+T5573a.hs:11:16:
+    Couldn't match kind `ArgKind' against `(#)'
+    Kind incompatibility when matching types:
+      t0 :: ArgKind
+      (# t1, t2 #) :: (#)
+    In the expression: (# True, False #)
+    In the expression: (# x, (# True, False #) #)
+
+T5573a.hs:14:6:
+    Couldn't match kind `ArgKind' against `(#)'
+    Kind incompatibility when matching types:
+      t0 :: ArgKind
+      (# t1, t2 #) :: (#)
+    In the pattern: (# x, y #)
+    In an equation for `foo3': foo3 (# x, y #) = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5573b.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5573b.hs 1
+{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
+module T5573b where
+
+import GHC.Exts
+
+foo :: Double# -> (# (# Double#, Double# #), Double# #)
+foo x = (# (# x, x #), x #)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/T5573b.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/T5573b.stderr 1
+
+T5573b.hs:6:22:
+    Kind mis-match
+    The first argument of an unboxed tuple should have kind `ArgKind',
+    but `(# Double#, Double# #)' has kind `(#)'
+    In the type signature for `foo':
+      foo :: Double# -> (# (# Double#, Double# #), Double# #)
addfile ./regress/tests/1_typecheck/4_fail/ghc/Tcfail186_Help.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/Tcfail186_Help.hs 1
+module Tcfail186_Help where
+
+type PhantomSyn a  = Int
+
+f = (\_ -> 2) :: PhantomSyn a -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/all.T
hunk ./regress/tests/1_typecheck/4_fail/ghc/all.T 1
+ 
+test('tcfail001', normal, compile_fail, [''])
+test('tcfail002', normal, compile_fail, [''])
+test('tcfail003', normal, compile_fail, [''])
+test('tcfail004', normal, compile_fail, [''])
+test('tcfail005', normal, compile_fail, [''])
+test('tcfail006', normal, compile_fail, [''])
+test('tcfail007', normal, compile_fail, [''])
+test('tcfail008', normal, compile_fail, [''])
+test('tcfail009', normal, compile_fail, [''])
+test('tcfail010', normal, compile_fail, [''])
+test('tcfail011', normal, compile_fail, [''])
+test('tcfail012', normal, compile_fail, [''])
+test('tcfail013', normal, compile_fail, [''])
+test('tcfail014', normal, compile_fail, [''])
+test('tcfail015', normal, compile_fail, [''])
+test('tcfail016', normal, compile_fail, [''])
+test('tcfail017', normal, compile_fail, [''])
+test('tcfail018', normal, compile_fail, [''])
+test('tcfail019', normal, compile_fail, [''])
+test('tcfail020', normal, compile_fail, [''])
+test('tcfail021', normal, compile_fail, [''])
+test('tcfail023', normal, compile_fail, [''])
+test('tcfail027', normal, compile_fail, [''])
+test('tcfail028', normal, compile_fail, [''])
+test('tcfail029', normal, compile_fail, [''])
+test('tcfail030', if_compiler_type('hugs', expect_fail), compile_fail, [''])
+test('tcfail031', normal, compile_fail, [''])
+test('tcfail032', normal, compile_fail, [''])
+test('tcfail033', normal, compile_fail, [''])
+test('tcfail034', normal, compile_fail, [''])
+test('tcfail035', normal, compile_fail, [''])
+test('tcfail036', normal, compile_fail, [''])
+test('tcfail037', normal, compile_fail, [''])
+test('tcfail038', normal, compile_fail, [''])
+test('tcfail040', normal, compile_fail, [''])
+test('tcfail041', normal, compile_fail, [''])
+test('tcfail042', normal, compile_fail, [''])
+test('tcfail043', normal, compile_fail, [''])
+test('tcfail044', normal, compile_fail, [''])
+test('tcfail046', normal, compile_fail, [''])
+test('tcfail047', normal, compile_fail, [''])
+test('tcfail048', normal, compile_fail, [''])
+test('tcfail049', normal, compile_fail, [''])
+test('tcfail050', normal, compile_fail, [''])
+test('tcfail051', normal, compile_fail, [''])
+test('tcfail052', normal, compile_fail, [''])
+test('tcfail053', normal, compile_fail, [''])
+test('tcfail054', normal, compile_fail, [''])
+test('tcfail055', normal, compile_fail, [''])
+test('tcfail056', normal, compile_fail, [''])
+test('tcfail057', normal, compile_fail, [''])
+test('tcfail058', normal, compile_fail, [''])
+test('tcfail061', normal, compile_fail, [''])
+test('tcfail062', normal, compile_fail, [''])
+test('tcfail063', normal, compile_fail, [''])
+test('tcfail065', normal, compile_fail, [''])
+test('tcfail067', normal, compile_fail, [''])
+test('tcfail068', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail069', normal, compile_fail, [''])
+test('tcfail070', normal, compile_fail, [''])
+test('tcfail071', normal, compile, [''])
+test('tcfail072', normal, compile_fail, [''])
+test('tcfail073', normal, compile_fail, [''])
+test('tcfail075', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail076', normal, compile_fail, [''])
+test('tcfail077', normal, compile_fail, [''])
+test('tcfail078', normal, compile_fail, [''])
+test('tcfail079', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail080', if_compiler_type('ghc', expect_fail), compile_fail, [''])
+test('tcfail082', normal, compile_fail, [''])
+test('tcfail083', normal, compile_fail, [''])
+test('tcfail084', normal, compile_fail, [''])
+test('tcfail085', normal, compile_fail, [''])
+test('tcfail086', normal, compile_fail, [''])
+test('tcfail087', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail088', normal, compile_fail, [''])
+test('tcfail089', normal, compile_fail, [''])
+test('tcfail090', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail092', normal, compile_fail, [''])
+test('tcfail093', normal, compile, [''])
+test('tcfail094', normal, compile_fail, [''])
+test('tcfail095', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail096', normal, compile_fail, [''])
+test('tcfail097', normal, compile_fail, [''])
+test('tcfail098', normal, compile_fail, [''])
+test('tcfail099', normal, compile_fail, [''])
+test('tcfail100', normal, compile_fail, [''])
+test('tcfail101', normal, compile_fail, [''])
+test('tcfail102', normal, compile_fail, [''])
+test('tcfail103', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail104', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail105', normal, compile, [''])
+test('tcfail106', normal, compile_fail, [''])
+test('tcfail107', normal, compile_fail, [''])
+test('tcfail108', normal, compile_fail, [''])
+test('tcfail109', normal, compile_fail, [''])
+test('tcfail110', normal, compile_fail, [''])
+test('tcfail112', normal, compile_fail, [''])
+test('tcfail113', normal, compile_fail, [''])
+test('tcfail114', normal, compile_fail, [''])
+test('tcfail115', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail116', normal, compile_fail, [''])
+test('tcfail117', normal, compile_fail, [''])
+test('tcfail118', normal, compile_fail, [''])
+test('tcfail119', normal, compile_fail, [''])
+test('tcfail120', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail121', normal, compile_fail, [''])
+test('tcfail122', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail123', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail124', only_compiler_types(['ghc']), compile, [''])
+test('tcfail125', normal, compile_fail, [''])
+test('tcfail126', reqlib('mtl'), compile, [''])
+test('tcfail127', normal, compile_fail, [''])
+test('tcfail128', normal, compile_fail, [''])
+test('tcfail129', normal, compile_fail, [''])
+test('tcfail130', normal, compile_fail, [''])
+test('tcfail131', normal, compile_fail, [''])
+test('tcfail132', normal, compile_fail, [''])
+test('tcfail133', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail134', normal, compile_fail, [''])
+test('tcfail135', normal, compile_fail, [''])
+test('tcfail136', normal, compile_fail, [''])
+test('tcfail137', normal, compile_fail, [''])
+
+test('tcfail138', normal, compile, [''])
+# Now fails; see notes in file
+
+test('tcfail139', normal, compile_fail, [''])
+test('tcfail140', normal, compile_fail, [''])
+test('tcfail141', only_compiler_types(['ghc']), compile_fail, [''])
+test('tcfail142', normal, compile_fail, [''])
+test('tcfail143', normal, compile_fail, [''])
+test('tcfail144', normal, compile, [''])
+test('tcfail145', normal, compile, [''])
+test('tcfail146', normal, compile_fail, [''])
+test('tcfail147', normal, compile_fail, [''])
+test('tcfail148', normal, compile_fail, [''])
+test('tcfail149', normal, compile_and_run, [''])
+test('tcfail150', normal, compile, [''])
+test('tcfail151', normal, compile_fail, [''])
+test('tcfail152', normal, compile_fail, [''])
+test('tcfail153', normal, compile_fail, [''])
+test('tcfail154', normal, compile_fail, [''])
+test('tcfail155', normal, compile_fail, [''])
+test('tcfail156', normal, compile_fail, [''])
+test('tcfail157', normal, compile_fail, [''])
+test('tcfail158', normal, compile_fail, [''])
+test('tcfail159', normal, compile_fail, [''])
+test('tcfail160', normal, compile_fail, [''])
+test('tcfail161', normal, compile_fail, [''])
+test('tcfail162', normal, compile_fail, [''])
+test('tcfail164', normal, compile_fail, [''])
+test('tcfail165', normal, compile_fail, [''])
+test('tcfail166', normal, compile_fail, [''])
+test('tcfail167', normal, compile_fail, [''])
+test('tcfail168', normal, compile_fail, [''])
+test('tcfail169', normal, compile_fail, [''])
+test('tcfail170', normal, compile_fail, [''])
+test('tcfail171', normal, compile_fail, [''])
+test('tcfail172', normal, compile, [''])
+test('tcfail173', normal, compile_fail, [''])
+test('tcfail174', normal, compile_fail, [''])
+test('tcfail175', normal, compile_fail, [''])
+test('tcfail176', normal, compile_fail, [''])
+test('tcfail177', normal, compile_fail, [''])
+test('tcfail178', normal, compile_fail, [''])
+test('tcfail179', normal, compile_fail, [''])
+test('tcfail180', normal, compile_fail, [''])
+test('tcfail181', normal, compile_fail, [''])
+test('tcfail182', normal, compile_fail, [''])
+test('tcfail183', normal, compile_fail, [''])
+test('tcfail184', normal, compile_fail, [''])
+test('tcfail185', normal, compile_fail, [''])
+test('tcfail186',
+     extra_clean(['Tcfail186_Help.hi', 'Tcfail186_Help.o']),
+     multimod_compile_fail, ['tcfail186', '-v0'])
+test('tcfail187', normal, compile_fail, [''])
+
+test('tcfail188', normal, compile, [''])
+
+test('tcfail189', normal, compile_fail, [''])
+test('tcfail190', normal, compile_fail, [''])
+test('tcfail191', normal, compile_fail, [''])
+test('tcfail192', normal, compile_fail, [''])
+test('tcfail193', normal, compile_fail, [''])
+test('tcfail194', normal, compile_fail, [''])
+test('tcfail195', normal, compile_fail, [''])
+test('tcfail196', normal, compile_fail, [''])
+test('tcfail197', normal, compile_fail, [''])
+test('tcfail198', normal, compile_fail, [''])
+test('tcfail199', normal, compile_fail, [''])
+test('tcfail200', normal, compile_fail, [''])
+test('tcfail201', normal, compile_fail, [''])
+test('tcfail202', normal, compile_fail, [''])
+test('tcfail203', normal, compile, [''])
+test('tcfail203a', normal, compile_fail, [''])
+test('tcfail204', normal, compile_fail, [''])
+test('tcfail206', normal, compile_fail, [''])
+
+test('T1595', normal, compile_fail, [''])
+test('T1899', normal, compile_fail, [''])
+test('T2126', normal, compile_fail, [''])
+test('T2307', normal, compile_fail, [''])
+test('T2414', normal, compile_fail, [''])
+test('T2538', normal, compile_fail, [''])
+test('T2688', normal, compile_fail, [''])
+test('T2714', normal, compile_fail, [''])
+test('T2994', normal, compile_fail, [''])
+test('T3155', normal, compile_fail, [''])
+test('T3176', normal, compile_fail, [''])
+test('T1633', normal, compile_fail, [''])
+test('T2806', normal, compile_fail, [''])
+test('T3323', normal, compile_fail, [''])
+test('T3406', normal, compile_fail, [''])
+test('T3540', normal, compile_fail, [''])
+test('T3102', normal, compile_fail, [''])
+test('T3613', normal, compile_fail, [''])
+test('fd-loop', normal, compile_fail, [''])
+test('T3950', normal, compile_fail, [''])
+test('T3966', normal, compile_fail, [''])
+test('IPFail', normal, compile_fail, [''])
+
+test('T3468', extra_clean(['T3468.hi-boot', 'T3468.o-boot']), 
+     multimod_compile_fail, ['T3468', '-v0'])
+test('T2846b', normal, compile_fail, [''])
+test('FrozenErrorTests', normal, compile_fail, [''])
+test('SCLoop', normal, compile_fail, [''])
+test('T4875', normal, compile_fail, [''])
+test('mc19', normal, compile_fail, [''])
+test('mc20', normal, compile_fail, [''])
+test('mc21', normal, compile_fail, [''])
+test('mc22', normal, compile_fail, [''])
+test('mc23', normal, compile_fail, [''])
+test('mc24', normal, compile_fail, [''])
+test('mc25', normal, compile_fail, [''])
+test('tcfail207', normal, compile_fail, [''])
+test('T5084', normal, compile_fail, [''])
+test('tcfail208', normal, compile_fail, [''])
+test('tcfail209', normal, compile_fail, [''])
+test('tcfail210', normal, compile_fail, [''])
+test('tcfail211', normal, compile_fail, [''])
+test('tcfail212', normal, compile_fail, [''])
+test('tcfail213', normal, compile_fail, [''])
+test('tcfail214', normal, compile_fail, [''])
+test('tcfail215', normal, compile_fail, [''])
+test('tcfail216', normal, compile_fail, [''])
+test('tcfail217', normal, compile_fail, [''])
+
+test('FailDueToGivenOverlapping', normal, compile_fail, [''])
+test('LongWayOverlapping', normal, compile_fail, [''])
+test('T5236',normal,compile_fail,[''])
+test('T5246',normal,compile_fail,[''])
+test('T5300',normal,compile_fail,[''])
+test('T5095',normal,compile_fail,[''])
+test('T1897a',normal,compile_fail,[''])
+
+test('AssocTyDef01', normal, compile_fail, [''])
+test('AssocTyDef02', normal, compile_fail, [''])
+test('AssocTyDef03', normal, compile_fail, [''])
+test('AssocTyDef04', normal, compile_fail, [''])
+test('AssocTyDef05', normal, compile_fail, [''])
+test('AssocTyDef06', normal, compile_fail, [''])
+test('AssocTyDef07', normal, compile_fail, [''])
+test('AssocTyDef08', normal, compile_fail, [''])
+test('AssocTyDef09', normal, compile_fail, [''])
+test('T3592', normal, compile_fail, [''])
+test('T5570', normal, compile_fail, [''])
+test('T5573a', normal, compile_fail, [''])
+test('T5573b', normal, compile_fail, [''])
addfile ./regress/tests/1_typecheck/4_fail/ghc/config.yaml
hunk ./regress/tests/1_typecheck/4_fail/ghc/config.yaml 1
+tests:
+   T3468:
+     skip: no SOURCE pragma
+   T3966:
+     skip: no UNPACK pragma
+   Tcfail186_Help:
+     skip: not test
+   T5084:
+     skip: not error in jhc
addfile ./regress/tests/1_typecheck/4_fail/ghc/fd-loop.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/fd-loop.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
+
+-- Here's a nice example of a fundep loop, correctly
+-- rejected by the undecidable-instance check.
+-- See comments below.
+
+module FDLoop where
+
+class C a b | a -> b where f :: a -> b
+newtype T a = T a
+
+instance (C a b, Eq b) => Eq (T a) where (==) = undefined
+
+g x = (undefined :: d -> d -> d -> ()) (T x) (f x) (undefined :: Eq e => e)
+
+{-    Analysis
+
+   f :: C a b => a -> b
+   x :: a
+   b ~ T a
+   need: C a b
+   b ~ e
+   need: Eq e
+
+Hence need (C a (T a), Eq (T a))
+Apply instance for Eq
+     = (C a (T a), C a g, Eq g)
+Apply functional dependency: g ~ T a
+     = (C a (T a), C a (T a), Eq (T a))
+And now we are back where we started
+-}
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/fd-loop.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/fd-loop.stderr 1
+
+fd-loop.hs:12:10:
+    Variable occurs more often in a constraint than in the instance head
+      in the constraint: C a b
+    (Use -XUndecidableInstances to permit this)
+    In the instance declaration for `Eq (T a)'
+
+fd-loop.hs:12:10:
+    Variable occurs more often in a constraint than in the instance head
+      in the constraint: Eq b
+    (Use -XUndecidableInstances to permit this)
+    In the instance declaration for `Eq (T a)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc19.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc19.hs 1
+-- Checks that the correct type is used checking the using clause of the transform
+
+{-# LANGUAGE MonadComprehensions, TransformListComp #-}
+
+module ShouldFail where
+
+import Data.List(inits)
+
+z :: [Int]
+z = [x | x <- [3, 2, 1], then inits]
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc19.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc19.stderr 1
+
+mc19.hs:10:31:
+    Couldn't match type `a' with `[a]'
+      `a' is a rigid type variable bound by
+          a type expected by the context: [a] -> [a] at mc19.hs:10:26
+    Expected type: [a] -> [a]
+      Actual type: [a] -> [[a]]
+    In the expression: inits
+    In a stmt of a monad comprehension: then inits
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc20.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc20.hs 1
+
+-- Checks that the ordering constraint on the groupWith function is respected
+
+{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
+
+module ShouldFail where
+
+import GHC.Exts (groupWith)
+
+data Unorderable = Gnorf | Pinky | Brain
+
+foo = [ ()
+      | x <- [Gnorf, Brain]
+      , then group by x using groupWith
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc20.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc20.stderr 1
+
+mc20.hs:14:31:
+    No instance for (Ord Unorderable)
+      arising from a use of `groupWith'
+    Possible fix: add an instance declaration for (Ord Unorderable)
+    In the expression: groupWith
+    In a stmt of a monad comprehension: then group by x using groupWith
+    In the expression:
+      [() | x <- [Gnorf, Brain], then group by x using groupWith]
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc21.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc21.hs 1
+-- Checks that the correct type is used checking the using clause of the group
+
+{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
+
+module ShouldFail where
+import GHC.Exts( the )
+
+data Unorderable = Gnorf | Pinky | Brain
+
+foo = [ length x
+      | x <- [Gnorf, Brain]
+      , then group using take 5
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc21.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc21.stderr 1
+
+mc21.hs:12:26:
+    Couldn't match type `a' with `[a]'
+      `a' is a rigid type variable bound by
+          a type expected by the context: [a] -> [[a]] at mc21.hs:12:9
+    Expected type: [a] -> [[a]]
+      Actual type: [a] -> [a]
+    In the return type of a call of `take'
+    In the expression: take 5
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc22.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc22.hs 1
+-- Checks that the types of the old binder and the binder 
+-- implicitly introduced by grouping are linked
+
+{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
+
+module ShouldFail where
+
+foo = [ x + 1
+      | x <- ["Hello", "World"]
+      , then group using take 5
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc22.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc22.stderr 1
+
+mc22.hs:10:26:
+    Couldn't match type `a' with `t0 a'
+      `a' is a rigid type variable bound by
+          a type expected by the context: [a] -> [t0 a] at mc22.hs:10:9
+    Expected type: [a] -> [t0 a]
+      Actual type: [a] -> [a]
+    In the return type of a call of `take'
+    In the expression: take 5
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc23.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc23.hs 1
+-- Checks that using the "by" clause in a transform requires a function parameter
+
+{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
+
+module ShouldFail where
+
+import Data.List(take)
+
+z = [x | x <- [1..10], then take 5 by x ]
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc23.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc23.stderr 1
+
+mc23.hs:9:29:
+    Couldn't match expected type `a -> t0' with actual type `[a0]'
+    Expected type: (a -> t0) -> [a] -> t1 a
+      Actual type: [a0] -> [a0]
+    In the return type of a call of `take'
+    Probable cause: `take' is applied to too many arguments
+    In the expression: take 5
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc24.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc24.hs 1
+-- Checks that the correct type is used checking the using clause of 
+-- the group when a by clause is present
+
+{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
+
+module ShouldFail where
+
+foo = [ length x
+      | x <- [1..10]
+      , then group by x using take 2
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc24.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc24.stderr 1
+
+mc24.hs:10:31:
+    Couldn't match expected type `a -> t0' with actual type `[a0]'
+    Expected type: (a -> t0) -> [a] -> t1 (t2 a)
+      Actual type: [a0] -> [a0]
+    In the return type of a call of `take'
+    Probable cause: `take' is applied to too many arguments
+    In the expression: take 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc25.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc25.hs 1
+-- Checks that using the "by" clause in a transform requires a function parameter
+
+{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
+
+module ShouldFail where
+
+import Data.List(take)
+
+z = [x | x <- [1..10], then group by x using take ]
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/mc25.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/mc25.stderr 1
+
+mc25.hs:9:46:
+    Couldn't match expected type `a -> t0' with actual type `Int'
+    Expected type: (a -> t0) -> [a] -> t1 (t2 a)
+      Actual type: Int -> [a0] -> [a0]
+    In the expression: take
+    In a stmt of a monad comprehension: then group by x using take
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail001.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail001.hs 1
+-- !!! This should fail with a type error: the instance method
+-- !!! has a function type when it should have the type [a].
+module ShouldFail where
+
+class A a where
+ op :: a
+
+instance (A a, A a) => A [a] where
+ op [] = []
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail001.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail001.stderr 1
+
+tcfail001.hs:9:2:
+    The equation(s) for `op' have one argument,
+    but its type `[a]' has none
+    In the instance declaration for `A [a]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail001.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail001.stderr-hugs 1
+ERROR "tcfail001.hs":9 - Type error in instance member binding
+*** Term           : op
+*** Type           : [b] -> [c]
+*** Does not match : [a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail002.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail002.hs 1
+module ShouldFail where
+
+c (x:y) = x
+c z = z
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail002.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail002.stderr 1
+
+tcfail002.hs:4:7:
+    Occurs check: cannot construct the infinite type: t0 = [t0]
+    In the expression: z
+    In an equation for `c': c z = z
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail002.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail002.stderr-hugs 1
+ERROR "tcfail002.hs":4 - Type error in function binding
+*** Term           : c
+*** Type           : a -> a
+*** Does not match : [a] -> a
+*** Because        : unification would give infinite type
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail003.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail003.hs 1
+module ShouldFail where
+
+(d:e) = [1,'a']
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail003.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail003.stderr 1
+
+tcfail003.hs:3:10:
+    No instance for (Num Char)
+      arising from the literal `1'
+    Possible fix: add an instance declaration for (Num Char)
+    In the expression: 1
+    In the expression: [1, 'a']
+    In a pattern binding: (d : e) = [1, 'a']
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail003.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail003.stderr-hugs 1
+ERROR "tcfail003.hs":3 - Unresolved top-level overloading
+*** Binding             : d
+*** Outstanding context : Num Char
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail004.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail004.hs 1
+module ShouldFail where
+
+(f,g) = (1,2,3)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail004.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail004.stderr 1
+
+tcfail004.hs:3:9:
+    Couldn't match expected type `(t0, t1)'
+                with actual type `(t2, t3, t4)'
+    In the expression: (1, 2, 3)
+    In a pattern binding: (f, g) = (1, 2, 3)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail004.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail004.stderr-hugs 1
+ERROR "tcfail004.hs":3 - Type error in right hand side
+*** Term           : (1,2,3)
+*** Type           : (c,d,e)
+*** Does not match : (a,b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail005.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail005.hs 1
+module ShouldFail where
+
+(h:i) = (1,'a')
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail005.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail005.stderr 1
+
+tcfail005.hs:3:9:
+    Couldn't match expected type `[t0]' with actual type `(t1, t2)'
+    In the expression: (1, 'a')
+    In a pattern binding: (h : i) = (1, 'a')
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail005.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail005.stderr-hugs 1
+ERROR "tcfail005.hs":3 - Type error in right hand side
+*** Term           : (1,'a')
+*** Type           : (b,Char)
+*** Does not match : [a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail006.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail006.hs 1
+module ShouldFail where
+
+(j,k) = case (if True then True else False) of
+         True -> (True,1)
+         False -> (1,True)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail006.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail006.stderr 1
+
+tcfail006.hs:4:24:
+    No instance for (Num Bool)
+      arising from the literal `1'
+    Possible fix: add an instance declaration for (Num Bool)
+    In the expression: 1
+    In the expression: (True, 1)
+    In a case alternative: True -> (True, 1)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail006.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail006.stderr-hugs 1
+ERROR "tcfail006.hs":3 - Unresolved top-level overloading
+*** Binding             : j
+*** Outstanding context : Num Bool
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail007.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail007.hs 1
+module ShouldFail where
+
+n x | True = x+1
+    | False = True
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail007.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail007.stderr 1
+
+tcfail007.hs:3:15:
+    No instance for (Num Bool)
+      arising from a use of `+'
+    Possible fix: add an instance declaration for (Num Bool)
+    In the expression: x + 1
+    In an equation for `n':
+        n x
+          | True = x + 1
+          | False = True
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail007.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail007.stderr-hugs 1
+ERROR "tcfail007.hs":3 - Instance of Num Bool required for definition of n
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail008.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail008.hs 1
+module ShouldFail where
+
+o = 1:2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail008.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail008.stderr 1
+
+tcfail008.hs:3:7:
+    No instance for (Num [a0])
+      arising from the literal `2'
+    Possible fix: add an instance declaration for (Num [a0])
+    In the second argument of `(:)', namely `2'
+    In the expression: 1 : 2
+    In an equation for `o': o = 1 : 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail008.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail008.stderr-hugs 1
+ERROR "tcfail008.hs":3 - Unresolved top-level overloading
+*** Binding             : o
+*** Outstanding context : (Num [b], Num b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail009.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail009.hs 1
+module ShouldFail where
+
+p = [(1::Int)..(2::Integer)]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail009.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail009.stderr 1
+
+tcfail009.hs:3:17:
+    Couldn't match expected type `Int' with actual type `Integer'
+    In the expression: (2 :: Integer)
+    In the expression: [(1 :: Int) .. (2 :: Integer)]
+    In an equation for `p': p = [(1 :: Int) .. (2 :: Integer)]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail009.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail009.stderr-hugs 1
+ERROR "tcfail009.hs":3 - Type error in application
+*** Expression     : enumFromTo 1 2
+*** Term           : 1
+*** Type           : Int
+*** Does not match : Integer
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail010.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail010.hs 1
+module ShouldFail where
+
+q = \ (y:z) -> z+2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail010.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail010.stderr 1
+
+tcfail010.hs:3:17:
+    No instance for (Num [t0])
+      arising from a use of `+'
+    Possible fix: add an instance declaration for (Num [t0])
+    In the expression: z + 2
+    In the expression: \ (y : z) -> z + 2
+    In an equation for `q': q = \ (y : z) -> z + 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail010.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail010.stderr-hugs 1
+ERROR "tcfail010.hs":3 - Unresolved top-level overloading
+*** Binding             : q
+*** Outstanding context : Num [b]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail011.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail011.hs 1
+module ShouldFail where
+
+z = \y -> x x where x = y
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail011.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail011.stderr 1
+
+tcfail011.hs:3:25: Not in scope: `y'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail011.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail011.stderr-hugs 1
+ERROR "tcfail011.hs":3 - Undefined variable "y"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail012.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail012.hs 1
+module ShouldFail where
+
+True = []
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail012.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail012.stderr 1
+
+tcfail012.hs:3:8:
+    Couldn't match expected type `Bool' with actual type `[a0]'
+    In the expression: []
+    In a pattern binding: True = []
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail012.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail012.stderr-hugs 1
+ERROR "tcfail012.hs":3 - Type error in right hand side
+*** Term           : []
+*** Type           : [a]
+*** Does not match : Bool
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail013.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail013.hs 1
+module ShouldFail where
+
+f [] = 1
+f True = 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail013.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail013.stderr 1
+
+tcfail013.hs:4:3:
+    Couldn't match expected type `[t0]' with actual type `Bool'
+    In the pattern: True
+    In an equation for `f': f True = 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail013.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail013.stderr-hugs 1
+ERROR "tcfail013.hs":4 - Type error in function binding
+*** Term           : f
+*** Type           : Bool -> b
+*** Does not match : [a] -> b
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail014.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail014.hs 1
+module ShouldFail where
+
+f x = g+1
+      where g y = h+2
+                  where h z = z z
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail014.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail014.stderr 1
+
+tcfail014.hs:5:33:
+    Occurs check: cannot construct the infinite type: t1 = t1 -> t0
+    In the first argument of `z', namely `z'
+    In the expression: z z
+    In an equation for `h': h z = z z
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail014.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail014.stderr-hugs 1
+ERROR "tcfail014.hs":5 - Type error in application
+*** Expression     : z z
+*** Term           : z
+*** Type           : a -> b
+*** Does not match : a
+*** Because        : unification would give infinite type
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail015.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail015.hs 1
+module ShouldFail where
+
+data AList a = ANull | ANode a (AList a)
+
+type IntList = AList Int
+
+g (ANull) = 2
+g (ANode b (ANode c d)) | b = c+1
+                        | otherwise = 4
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail015.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail015.stderr 1
+
+tcfail015.hs:7:13:
+    No instance for (Num Bool)
+      arising from the literal `2'
+    Possible fix: add an instance declaration for (Num Bool)
+    In the expression: 2
+    In an equation for `g': g (ANull) = 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail015.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail015.stderr-hugs 1
+ERROR "tcfail015.hs":7 - Instance of Num Bool required for definition of g
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.hs 1
+module ShouldFail where
+
+type AnnExpr a = (a,Expr a)
+
+data Expr a = Var [Char]
+              | App (AnnExpr a) (AnnExpr a)
+
+g (Var name) = [name]
+g (App e1 e2) = (g e1)++(g e2)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.stderr 1
+
+tcfail016.hs:9:20:
+    Couldn't match expected type `Expr t0'
+                with actual type `AnnExpr t0'
+    In the first argument of `g', namely `e1'
+    In the first argument of `(++)', namely `(g e1)'
+    In the expression: (g e1) ++ (g e2)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.stderr-ghc-7.0
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.stderr-ghc-7.0 1
+
+tcfail016.hs:9:20:
+    Couldn't match expected type `Expr t0'
+                with actual type `(t0, Expr t0)'
+      Expected type: Expr t0
+        Actual type: AnnExpr t0
+    In the first argument of `g', namely `e1'
+    In the first argument of `(++)', namely `(g e1)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail016.stderr-hugs 1
+ERROR "tcfail016.hs":9 - Type error in application
+*** Expression     : g e2
+*** Term           : e2
+*** Type           : (b,Expr b)
+*** Does not match : Expr a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail017.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail017.hs 1
+
+module ShouldFail where
+
+class C a where
+ op1 :: a -> a
+
+class (C a) => B a where
+ op2 :: a -> a -> a
+
+instance (B a) => B [a] where
+ op2 xs ys = xs
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail017.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail017.stderr 1
+
+tcfail017.hs:10:10:
+    Could not deduce (C [a])
+      arising from the superclasses of an instance declaration
+    from the context (B a)
+      bound by the instance declaration at tcfail017.hs:10:10-23
+    Possible fix:
+      add (C [a]) to the context of the instance declaration
+      or add an instance declaration for (C [a])
+    In the instance declaration for `B [a]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail017.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail017.stderr-hugs 1
+ERROR "tcfail017.hs":10 - Cannot build superclass instance
+*** Instance            : B [a]
+*** Context supplied    : B a
+*** Required superclass : C [a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail018.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail018.hs 1
+
+
+module ShouldFail where
+
+(a:[]) = 1
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail018.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail018.stderr 1
+
+tcfail018.hs:5:10:
+    No instance for (Num [t0])
+      arising from the literal `1'
+    Possible fix: add an instance declaration for (Num [t0])
+    In the expression: 1
+    In a pattern binding: (a : []) = 1
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail018.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail018.stderr-hugs 1
+ERROR "tcfail018.hs":5 - Unresolved top-level overloading
+*** Binding             : a
+*** Outstanding context : Num [b]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail019.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail019.hs 1
+module ShouldFail where
+
+class A a where
+ p1 :: a -> a
+ p2 :: a -> a -> a
+
+class (A b) => B b where
+ p3 :: b
+ p4 :: b -> b
+
+class (A c) => C c where
+ p5 :: c -> c
+ p6 :: c -> Int
+
+class (B d,C d) => D d where
+ p7 :: d -> d
+
+instance D [a] where
+ p7 l = []
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail019.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail019.stderr 1
+
+tcfail019.hs:18:10:
+    No instance for (B [a])
+      arising from the superclasses of an instance declaration
+    Possible fix: add an instance declaration for (B [a])
+    In the instance declaration for `D [a]'
+
+tcfail019.hs:18:10:
+    No instance for (C [a])
+      arising from the superclasses of an instance declaration
+    Possible fix: add an instance declaration for (C [a])
+    In the instance declaration for `D [a]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail019.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail019.stderr-hugs 1
+ERROR "tcfail019.hs":18 - Cannot build superclass instance
+*** Instance            : D [a]
+*** Context supplied    : ()
+*** Required superclass : B [a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail020.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail020.hs 1
+module ShouldFail where
+
+class A a where
+ p1 :: a -> a
+ p2 :: a -> a -> a
+
+class (A b) => B b where
+ p3 :: b
+
+instance (A a) => B [a] where
+ p3 = []
+
+data X = XC --, causes stack dump
+
+--instance B Bool where
+-- p3 = True
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail020.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail020.stderr 1
+
+tcfail020.hs:10:10:
+    Could not deduce (A [a])
+      arising from the superclasses of an instance declaration
+    from the context (A a)
+      bound by the instance declaration at tcfail020.hs:10:10-23
+    Possible fix:
+      add (A [a]) to the context of the instance declaration
+      or add an instance declaration for (A [a])
+    In the instance declaration for `B [a]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail020.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail020.stderr-hugs 1
+ERROR "tcfail020.hs":10 - Cannot build superclass instance
+*** Instance            : B [a]
+*** Context supplied    : A a
+*** Required superclass : A [a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail021.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail021.hs 1
+-- !!! Illegally giving methods in a pattern binding (for no v good reason...)
+
+module ShouldFail where
+
+data Foo = MkFoo Int
+
+instance Eq Foo where
+    ((==), (/=)) = (\x -> \y -> True, \x -> \y -> False)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail021.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail021.stderr 1
+
+tcfail021.hs:8:5:
+    Pattern bindings (except simple variables) not allowed in instance declarations
+	(==, /=) = (\ x -> \ y -> True, \ x -> \ y -> False)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail021.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail021.stderr-hugs 1
+ERROR "tcfail021.hs":8 - Pattern binding illegal in instance declaration
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail023.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail023.hs 1
+module ShouldFail where
+
+-- !!! Duplicate instances
+
+data B = C
+
+class A a where
+ op :: a -> Bool
+
+instance A B where
+ op C = True
+
+instance A B where
+ op C = True
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail023.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail023.stderr 1
+
+tcfail023.hs:10:10:
+    Duplicate instance declarations:
+      instance A B -- Defined at tcfail023.hs:10:10
+      instance A B -- Defined at tcfail023.hs:13:10
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail023.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail023.stderr-hugs 1
+ERROR "tcfail023.hs":13 - Overlapping instances for class "A"
+*** This instance   : A B
+*** Overlaps with   : A B
+*** Common instance : A B
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail025.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail025.stderr 1
+ 
+tcfail025.hs:2:
+    Conflicting exports for local name:  A
+	module Main
+	module Main
+
+
+Compilation had errors
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail026.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail026.stderr 1
+ 
+tcfail026.hs:2:
+    Conflicting exports for local name:  A
+	module Main
+	module Main
+ 
+tcfail026.hs:6:
+    Class type variable ``a'' does not appear in method signature:
+	op2 ::
+	    `b' -> `b'
+
+
+Compilation had errors
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail027.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail027.hs 1
+-- !!! tests for CycleErr in classes
+module TcFail where
+
+class (B a) => A a where
+ op1 :: a -> a
+
+class (A a) => B a where
+ op2 :: a -> a -> a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail027.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail027.stderr 1
+
+tcfail027.hs:4:1:
+    Cycle in class declaration (via superclasses): A -> B -> A
+    In the class declaration for `A'
+
+tcfail027.hs:7:1:
+    Cycle in class declaration (via superclasses): B -> A -> B
+    In the class declaration for `B'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail027.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail027.stderr-hugs 1
+ERROR "tcfail027.hs":7 - Superclass relation for "B" is cyclic
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail028.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail028.hs 1
+-- !!! tests for ArityErr
+module TcFail where
+
+data A a b = B (A a)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail028.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail028.stderr 1
+
+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 type declaration for `A'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail028.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail028.stderr-hugs 1
+ERROR "tcfail028.hs":4 - Illegal type "A a -> A a b" in constructor application
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail029.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail029.hs 1
+-- !!! tests for InstOpErr
+module ShouldFail where
+
+data Foo = Bar | Baz
+
+f x = x > Bar
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail029.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail029.stderr 1
+
+tcfail029.hs:6:9:
+    No instance for (Ord Foo)
+      arising from a use of `>'
+    Possible fix: add an instance declaration for (Ord Foo)
+    In the expression: x > Bar
+    In an equation for `f': f x = x > Bar
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail029.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail029.stderr-hugs 1
+ERROR "tcfail029.hs":6 - Instance of Ord Foo required for definition of f
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail030.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail030.hs 1
+-- !!! empty file
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail030.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail030.stderr 1
+
+tcfail030.hs:1:1:
+    The function `main' is not defined in module `Main'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail031.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail031.hs 1
+module ShouldFail where
+
+f x = if 'a' then 1 else 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail031.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail031.stderr 1
+
+tcfail031.hs:3:10:
+    Couldn't match expected type `Bool' with actual type `Char'
+    In the expression: 'a'
+    In the expression: if 'a' then 1 else 2
+    In an equation for `f': f x = if 'a' then 1 else 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail031.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail031.stderr-hugs 1
+ERROR "tcfail031.hs":3 - Type error in conditional
+*** Expression     : if 'a' then 1 else 2
+*** Term           : 'a'
+*** Type           : Char
+*** Does not match : Bool
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail032.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail032.hs 1
+{- This test gives the following not-very-wonderful error message.
+
+  "tc_sig.hs", line 3: Type signature does not match the inferred type:
+    Signature: t76 -> Int
+    Inferred type: t75
+
+It *is* an error, because x does not have the polytype 
+	forall a. Eq a => a -> Int
+becuase it is monomorphic, but the error message isn't very illuminating.
+-}
+
+module ShouldFail where
+
+f x = (x :: (Eq a) => a -> Int)
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail032.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail032.stderr 1
+
+tcfail032.hs:14:8:
+    Could not deduce (t ~ (a1 -> Int))
+    from the context (Eq a)
+      bound by the inferred type of f :: Eq a => t -> a -> Int
+      at tcfail032.hs:14:1-31
+    or from (Eq a1)
+      bound by an expression type signature: Eq a1 => a1 -> Int
+      at tcfail032.hs:14:8-30
+      `t' is a rigid type variable bound by
+          the inferred type of f :: Eq a => t -> a -> Int
+          at tcfail032.hs:14:1
+    In the expression: (x :: Eq a => a -> Int)
+    In an equation for `f': f x = (x :: Eq a => a -> Int)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail032.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail032.stderr-hugs 1
+ERROR "tcfail032.hs":14 - Inferred type is not general enough
+*** Expression    : x
+*** Expected type : Eq a => a -> Int
+*** Inferred type : Eq _5 => _5 -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail033.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail033.hs 1
+-- from Jon Hill
+module ShouldFail where
+
+buglet = [ x | (x,y) <- buglet ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail033.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail033.stderr 1
+
+tcfail033.hs:4:12:
+    Occurs check: cannot construct the infinite type: t0 = (t0, t1)
+    In the expression: x
+    In the expression: [x | (x, y) <- buglet]
+    In an equation for `buglet': buglet = [x | (x, y) <- buglet]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail033.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail033.stderr-hugs 1
+ERROR "tcfail033.hs":4 - Type error in function binding
+*** Term           : buglet
+*** Type           : [a]
+*** Does not match : [(a,b)]
+*** Because        : unification would give infinite type
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail034.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail034.hs 1
+{-
+From: Jon Hill <hilly@dcs.qmw.ac.uk@jess.gla.ac.uk@pp.dcs.glasgow.ac.uk>
+To: glasgow-haskell-bugs
+Subject: Unfriendly error message
+Date: Thu, 25 Jun 1992 09:22:55 +0100
+
+Hello again,
+
+I came across a rather nasty error message when I gave a function an
+incorrect type signature (the context is wrong). I can remember reading 
+in the source about this problem - I just thought I'd let you know anyway :-)
+-}
+module ShouldFail where
+
+
+test::(Num a, Eq a) => a -> Bool
+test x = (x `mod` 3) == 0
+
+{-
+granite> ndph bug002.ldh
+Data Parallel Haskell Compiler, version 0.01 (Glasgow 0.07)
+
+ 
+"<unknown>", line <unknown>: Cannot express dicts in terms of dictionaries available:
+dicts_encl:
+   "<built-in>", line : dict.87 :: <Num a>
+   "<built-in>", line : dict.88 :: <Eq a>
+dicts_encl':
+   "<built-in>", line : dict.87 :: <Num a>
+   "<built-in>", line : dict.88 :: <Eq a>
+dicts:
+   "<built-in>", line : dict.87 :: <Num a>
+   "<built-in>", line : dict.88 :: <Eq a>
+super_class_dict: "<built-in>", line : dict.80 :: <Integral a>
+Fail: Compilation errors found
+
+dph: execution of the Haskell compiler had trouble
+
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail034.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail034.stderr 1
+
+tcfail034.hs:17:13:
+    Could not deduce (Integral a) arising from a use of `mod'
+    from the context (Num a, Eq a)
+      bound by the type signature for test :: (Num a, Eq a) => a -> Bool
+      at tcfail034.hs:17:1-25
+    Possible fix:
+      add (Integral a) to the context of
+        the type signature for test :: (Num a, Eq a) => a -> Bool
+    In the first argument of `(==)', namely `(x `mod` 3)'
+    In the expression: (x `mod` 3) == 0
+    In an equation for `test': test x = (x `mod` 3) == 0
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail035.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail035.hs 1
+-- !!! instances with empty where parts: duplicate
+--
+module ShouldFail where
+
+data NUM = ONE | TWO
+instance Num NUM
+instance Num NUM
+instance Eq NUM
+instance Show NUM
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail035.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail035.stderr 1
+
+tcfail035.hs:6:10:
+    Duplicate instance declarations:
+      instance Num NUM -- Defined at tcfail035.hs:6:10
+      instance Num NUM -- Defined at tcfail035.hs:7:10
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail035.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail035.stderr-hugs 1
+ERROR "tcfail035.hs":7 - Overlapping instances for class "Num"
+*** This instance   : Num NUM
+*** Overlaps with   : Num NUM
+*** Common instance : Num NUM
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail036.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail036.hs 1
+-- !!! prelude class name in an instance-tycon position
+--
+module ShouldFail where
+
+data NUM = ONE | TWO
+instance Num NUM
+  where ONE + ONE = TWO
+instance Num NUM
+instance Eq Num
+--instance Text Num
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail036.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail036.stderr 1
+
+tcfail036.hs:6:10:
+    Duplicate instance declarations:
+      instance Num NUM -- Defined at tcfail036.hs:6:10
+      instance Num NUM -- Defined at tcfail036.hs:8:10
+
+tcfail036.hs:9:13:
+    Expecting one more argument to `Num'
+    In the instance declaration for `Eq Num'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail036.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail036.stderr-hugs 1
+ERROR "tcfail036.hs":8 - Overlapping instances for class "Num"
+*** This instance   : Num NUM
+*** Overlaps with   : Num NUM
+*** Common instance : Num NUM
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail037.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail037.hs 1
+-- !!! PreludeCore entities cannot be redefined at the top-level
+--
+module ShouldFail where
+
+data NUM = ONE | TWO
+
+f a b = a + b
+f :: NUM -> NUM -> NUM
+
+ONE + ONE = TWO
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail037.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail037.stderr 1
+
+tcfail037.hs:7:11:
+    Ambiguous occurrence `+'
+    It could refer to either `ShouldFail.+',
+                             defined at tcfail037.hs:10:5
+                          or `Prelude.+',
+                             imported from `Prelude' at tcfail037.hs:3:8-17
+                             (and originally defined in `GHC.Num')
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail037.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail037.stderr-hugs 1
+ERROR "tcfail037.hs":7 - Ambiguous variable occurrence "+"
+*** Could refer to: ShouldFail.+ Hugs.Prelude.+ 
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail038.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail038.hs 1
+-- !!! duplicate class-method declarations
+
+module ShouldFail where
+
+data NUM = ONE | TWO
+instance Eq NUM where
+	a == b = True
+	a /= b = False
+	a == b = False
+	a /= b = True
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail038.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail038.stderr 1
+
+tcfail038.hs:7:11:
+    Conflicting definitions for `=='
+    Bound at: tcfail038.hs:7:11-12
+              tcfail038.hs:9:11-12
+
+tcfail038.hs:8:11:
+    Conflicting definitions for `/='
+    Bound at: tcfail038.hs:8:11-12
+              tcfail038.hs:10:11-12
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail038.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail038.stderr-hugs 1
+ERROR "tcfail038.hs":8 - "/=" multiply defined
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail040.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail040.hs 1
+-- !!! instances of functions
+--
+module ShouldFail where
+
+data NUM = ONE | TWO
+
+class EQ a where
+	(===) :: a -> a -> Bool
+
+class ORD a where
+	(<<) :: a -> a -> Bool
+	a << b = True
+
+instance EQ (a -> b) where
+	f === g = True
+
+instance ORD (a -> b)
+
+f = (<<) === (<<)
+--f :: (EQ a,Num a) => a -> a -> Bool
+
+
+{-
+instance EQ NUM where
+--	a /= b = False
+	a === b = True
+--	a /= b = False
+
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail040.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail040.stderr 1
+
+tcfail040.hs:19:5:
+    Ambiguous type variable `a0' in the constraint:
+      (ORD a0) arising from a use of `<<'
+    Probable fix: add a type signature that fixes these type variable(s)
+    In the first argument of `(===)', namely `(<<)'
+    In the expression: (<<) === (<<)
+    In an equation for `f': f = (<<) === (<<)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail040.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail040.stderr-hugs 1
+ERROR "tcfail040.hs":19 - Unresolved top-level overloading
+*** Binding             : f
+*** Outstanding context : ORD b
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail041.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail041.hs 1
+{-# LANGUAGE ImplicitParams #-}
+
+module ShouldFail where
+
+class (?imp :: Int) => D t where
+    methodD :: t -> t
+
+-- Don't repeat implicit parameter constraint on the instance
+instance D Int where
+    methodD x = x + ?imp
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail041.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail041.stderr 1
+
+tcfail041.hs:9:10:
+    Unbound implicit parameter (?imp::Int)
+      arising from the superclasses of an instance declaration
+    In the instance declaration for `D Int'
+
+tcfail041.hs:10:21:
+    Unbound implicit parameter (?imp::Int)
+      arising from a use of implicit parameter `?imp'
+    In the second argument of `(+)', namely `?imp'
+    In the expression: x + ?imp
+    In an equation for `methodD': methodD x = x + ?imp
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail042.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail042.hs 1
+module ShouldFail where
+
+-- !!! weird class/instance examples off the haskell list
+--
+
+class Foo a          where foo :: a -> a
+class Foo a => Bar a where bar :: a -> a
+
+
+instance Num a => Foo [a] where
+    foo []     = []
+    foo (x:xs) = map (x+) xs
+
+
+instance (Eq a, Show a) => Bar [a] where
+    bar []     = []
+    bar (x:xs) = foo xs where u = x==x
+                              v = show x
+
+------------------------------------------
+
+{-
+class Foo a => Bar2 a where bar2 :: a -> a
+
+instance (Eq a, Show a) => Foo [a]
+
+instance Num a => Bar2 [a]
+
+data X a = X a
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail042.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail042.stderr 1
+
+tcfail042.hs:15:10:
+    Could not deduce (Num a)
+      arising from the superclasses of an instance declaration
+    from the context (Eq a, Show a)
+      bound by the instance declaration at tcfail042.hs:15:10-34
+    Possible fix:
+      add (Num a) to the context of the instance declaration
+    In the instance declaration for `Bar [a]'
+
+tcfail042.hs:17:18:
+    Could not deduce (Num a) arising from a use of `foo'
+    from the context (Eq a, Show a)
+      bound by the instance declaration at tcfail042.hs:15:10-34
+    Possible fix:
+      add (Num a) to the context of the instance declaration
+    In the expression: foo xs
+    In an equation for `bar':
+        bar (x : xs)
+          = foo xs
+          where
+              u = x == x
+              v = show x
+    In the instance declaration for `Bar [a]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail042.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail042.stderr-hugs 1
+ERROR "tcfail042.hs":15 - Cannot build superclass instance
+*** Instance            : Bar [a]
+*** Context supplied    : (Eq a, Show a)
+*** Required superclass : Foo [a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail043.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail043.hs 1
+-- The translation of this program should assign only one dictionary to
+-- the function search (an Ord dictionary). Instead, it assigns two.
+-- The output produced currently displays this.
+
+-- 10/12/92:  This program is actually erroneous.  The pattern-binding for
+-- search falls under the monomorphism restriction, and there is no
+-- call to search which might fix its type.  So there should be a complaint.
+-- But the actual error message is horrible:
+-- 
+-- "bug001.hs", line 26: Ambiguous overloading:
+--     class "Ord_", type "a" (at a use of an overloaded identifier: gt)
+--     class "Eq_", type "a" (at a use of an overloaded identifier: eq)
+
+
+module TcFail where
+
+class Eq_ a where
+ eq :: a -> a -> Bool
+
+instance Eq_ Int where
+ eq = eqIntEq
+
+instance (Eq_ a) => Eq_ [a] where
+ eq = \ xs ys -> 
+     if (null xs) 
+        then (null ys)
+        else if (null ys) 
+                then False
+                else (&&) (eq (hd xs) (hd ys)) (eq (tl xs) (tl ys))
+
+class (Eq_ a) => Ord_ a where
+ gt :: a -> a -> Bool
+
+instance Ord_ Int where
+ gt = ordIntGt
+
+search 
+ = \ a bs -> if gt (hd bs) a
+                then False 
+                else if eq a (hd bs) then True else search a (tl bs)
+
+
+hd :: [a] -> a
+hd (a:as) = a
+
+tl :: [a] -> [a]
+tl (a:as) = as
+
+ordIntGt :: Int -> Int -> Bool
+ordIntGt 2 3 = True
+
+eqIntEq :: Int -> Int -> Bool
+eqIntEq  2 3 = True
+
+
+
+
+{-
+
+===============================================
+Main.Eq__INST_PreludeBuiltin.Int =
+    let
+      AbsBinds [] [] [(eq, eq)]
+	  {- nonrec -}
+	  {-# LINE 2 "test3.hs" -}
+
+	  eq :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+	  eq = Main.eqIntEq
+    in ({-dict-} [] [eq])
+
+Main.Eq__INST_PreludeBuiltin.List =
+    /\ t135 ->
+	\{-dict-} _dict138 ->
+	    let
+	      {- nonrec -}
+	      _dict136 = {-singleDict-} _dict138
+	      {- nonrec -}
+	      _dict129 = {-singleDict-} _dict136
+	      AbsBinds [] [] [(eq, eq)]
+		  {- nonrec -}
+
+		  _dict133 =
+		      Main.Eq__INST_PreludeBuiltin.List
+			  [t135] [{-singleDict-} _dict136]
+		  {- nonrec -}
+		  {-# LINE 5 "test3.hs" -}
+
+		  eq :: [t135] -> [t135] -> PreludeCore.Bool
+		  eq = \ xs ys -> 
+
+if (Main.null t135) xs then
+				      (Main.null t135) ys
+				  else
+
+				      if (Main.null t135) ys then
+					  PreludeCore.False
+				      else
+
+					  Main.and
+
+
+					      ((Main.Eq_.eq t135 _dict129)
+
+
+						   ((Main.hd t135) xs)
+						   ((Main.hd t135) ys))
+					      
+
+
+
+
+
+(Main.Eq_.eq [t135] _dict133)
+
+
+
+						   ((Main.tl t135) xs)
+						   ((Main.tl t135) ys))
+	    in ({-dict-} [] [eq])
+Main.Ord__INST_PreludeBuiltin.Int =
+    let
+      {- nonrec -}
+      _dict142 = Main.Eq__INST_PreludeBuiltin.Int [] []
+      AbsBinds [] [] [(gt, gt)]
+	  {- nonrec -}
+	  {-# LINE 16 "test3.hs" -}
+
+	  gt :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+	  gt = Main.ordIntGt
+    in ({-dict-} [_dict142] [gt])
+
+Main.Eq_.eq = /\ a -> \{-classdict-} [] [eq] -> eq
+
+Main.Ord_.gt = /\ a -> \{-classdict-} [_dict56] [gt] -> gt
+
+Main.Ord__TO_Main.Eq_ = /\ a -> \{-classdict-} [_dict58] [gt] -> ???_dict58???
+
+AbsBinds [t60] [] [(hd, Main.hd)]
+    {- nonrec -}
+
+
+
+    hd :: [t60] -> t60
+    hd (a PreludeBuiltin.: as)
+	       = a
+
+AbsBinds [t68] [] [(tl, Main.tl)]
+    {- nonrec -}
+
+
+
+
+    tl :: [t68] -> [t68]
+    tl (a PreludeBuiltin.: as)
+	       = as
+
+
+AbsBinds [t91] [_dict85, _dict88] [(search, Main.search)]
+    {- rec -}
+    {-# LINE 19 "test3.hs" -}
+
+
+    search :: t91 -> [t91] -> PreludeCore.Bool
+    search
+	= \ a bs -> 
+
+
+if (Main.Ord_.gt t91 _dict85) ((Main.hd t91) bs) a then
+			PreludeCore.False
+		    else
+
+			if (Main.Eq_.eq t91 _dict88) a ((Main.hd t91) bs) then
+			    PreludeCore.True
+			else
+
+			    search a ((Main.tl t91) bs)
+AbsBinds [] [] [(and, Main.and)]
+    {- nonrec -}
+    and :: PreludeCore.Bool -> PreludeCore.Bool -> PreludeCore.Bool
+    and PreludeCore.True PreludeCore.True
+		= PreludeCore.True
+AbsBinds [] [] [(ordIntGt, Main.ordIntGt)]
+    {- nonrec -}
+    _dict97 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+    _dict98 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+    _dict100 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+    _dict101 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+
+
+
+    ordIntGt :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+    ordIntGt
+	2 3 = PreludeCore.True
+AbsBinds [] [] [(eqIntEq, Main.eqIntEq)]
+    {- nonrec -}
+    _dict105 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+    _dict106 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+    _dict108 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+    _dict109 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+    {- nonrec -}
+
+    eqIntEq :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+    eqIntEq
+	2 3 = PreludeCore.True
+
+
+AbsBinds [t112] [] [(null, Main.null)]
+    {- nonrec -}
+
+    null :: [t112] -> PreludeCore.Bool
+    null [] = PreludeCore.True
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail043.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail043.stderr 1
+
+tcfail043.hs:38:17:
+    Ambiguous type variable `a0' in the constraints:
+      (Ord_ a0) arising from a use of `gt' at tcfail043.hs:38:17-18
+      (Eq_ a0) arising from a use of `eq' at tcfail043.hs:40:25-26
+    Possible cause: the monomorphism restriction applied to the following:
+      search :: a0 -> [a0] -> Bool (bound at tcfail043.hs:37:1)
+    Probable fix: give these definition(s) an explicit type signature
+                  or use -XNoMonomorphismRestriction
+    In the expression: gt (hd bs) a
+    In the expression:
+      if gt (hd bs) a then
+          False
+      else
+          if eq a (hd bs) then True else search a (tl bs)
+    In the expression:
+      \ a bs
+        -> if gt (hd bs) a then
+               False
+           else
+               if eq a (hd bs) then True else search a (tl bs)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail043.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail043.stderr-hugs 1
+ERROR "tcfail043.hs":38 - Unresolved top-level overloading
+*** Binding             : search
+*** Outstanding context : Ord_ b
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail044.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail044.hs 1
+-- !!! tcfail044: duplicated type variable in instance decls
+--
+module ShouldFail where
+
+instance (Eq a) => Eq (a->a)
+instance Show (a->b)
+
+instance (Num a) => Num (a->a) where
+    f + g    = \x -> f x + g x
+    negate f = \x -> - (f x)
+    f * g    = \x -> f x * g x
+    fromInteger n = \x -> fromInteger n
+
+ss :: Float -> Float
+cc :: Float -> Float
+tt :: Float -> Float
+
+ss = sin * sin
+cc = cos * cos
+tt = ss + cc
+
+--main = putStr ((show (tt 0.4))++ "  "++(show (tt 1.652)))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail044.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail044.stderr 1
+
+tcfail044.hs:5:20:
+    Illegal instance declaration for `Eq (a -> a)'
+      (All instance types must be of the form (T a1 ... an)
+       where a1 ... an are *distinct type variables*,
+       and each type variable appears at most once in the instance head.
+       Use -XFlexibleInstances if you want to disable this.)
+    In the instance declaration for `Eq (a -> a)'
+
+tcfail044.hs:8:21:
+    Illegal instance declaration for `Num (a -> a)'
+      (All instance types must be of the form (T a1 ... an)
+       where a1 ... an are *distinct type variables*,
+       and each type variable appears at most once in the instance head.
+       Use -XFlexibleInstances if you want to disable this.)
+    In the instance declaration for `Num (a -> a)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail044.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail044.stderr-hugs 1
+ERROR "tcfail044.hs":5 - Repeated type variable "a" in instance head
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail046.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail046.hs 1
+-- !! function types in deriving Eq things
+-- From a bug report by Dave Harrison <D.A.Harrison@newcastle.ac.uk>
+
+module ShouldFail where
+
+
+type    Process a = Pid -> Time -> Message a -> ( MessList a,
+			     		   	  Continuation a)
+
+data    Continuation a = Do (Process a) deriving Eq
+
+
+type 	ProcList a = [ (Pid, Status, Process a) ]
+data 	Status     = Active | Passive | Busy Integer | Terminated
+		     deriving Eq
+
+
+data Message a = Create (Process a) | Created Pid   | Activate Pid  | 
+	      	 Passivate Pid      | Terminate Pid | Wait Pid Time | 
+		 Query Pid a        | Data Pid a    | Event         |
+	      	 Output Pid String
+               deriving Eq
+
+type 	MessList a = [ Message a ]
+
+type	Pid  = Integer
+type 	Time = Integer
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail046.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail046.stderr 1
+
+tcfail046.hs:10:50:
+    No instance for (Eq (Process a))
+      arising from the 'deriving' clause of a data type declaration
+    Possible fix:
+      add an instance declaration for (Eq (Process a))
+      or use a standalone 'deriving instance' declaration,
+           so you can specify the instance context yourself
+    When deriving the instance for (Eq (Continuation a))
+
+tcfail046.hs:22:25:
+    No instance for (Eq (Process a))
+      arising from the 'deriving' clause of a data type declaration
+    Possible fix:
+      add an instance declaration for (Eq (Process a))
+      or use a standalone 'deriving instance' declaration,
+           so you can specify the instance context yourself
+    When deriving the instance for (Eq (Message a))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail046.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail046.stderr-hugs 1
+ERROR "tcfail046.hs":9 - An instance of Eq (Process a) is required to derive Eq (Continuation a)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail047.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail047.hs 1
+module ShouldFail where
+
+class A a where
+ op1 :: a -> a
+
+instance A (a,(b,c)) where
+ op1 a = a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail047.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail047.stderr 1
+
+tcfail047.hs:6:10:
+    Illegal instance declaration for `A (a, (b, c))'
+      (All instance types must be of the form (T a1 ... an)
+       where a1 ... an are *distinct type variables*,
+       and each type variable appears at most once in the instance head.
+       Use -XFlexibleInstances if you want to disable this.)
+    In the instance declaration for `A (a, (b, c))'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail047.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail047.stderr-hugs 1
+ERROR "tcfail047.hs":6 - Syntax error in instance head (variable expected)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail048.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail048.hs 1
+module ShouldFail where
+
+class (B a) => C a where
+ op1 :: a -> a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail048.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail048.stderr 1
+
+tcfail048.hs:3:8: Not in scope: type constructor or class `B'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail048.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail048.stderr-hugs 1
+ERROR "tcfail048.hs":3 - Undefined class "B"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail049.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail049.hs 1
+module ShouldFail where
+
+f x = g x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail049.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail049.stderr 1
+
+tcfail049.hs:3:7: Not in scope: `g'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail049.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail049.stderr-hugs 1
+ERROR "tcfail049.hs":3 - Undefined variable "g"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail050.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail050.hs 1
+module ShouldFail where
+
+f x = B x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail050.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail050.stderr 1
+
+tcfail050.hs:3:7: Not in scope: data constructor `B'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail050.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail050.stderr-hugs 1
+ERROR "tcfail050.hs":3 - Undefined data constructor "B"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail051.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail051.hs 1
+module ShouldFail where
+
+instance B Bool where
+ op1 a = a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail051.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail051.stderr 1
+
+tcfail051.hs:3:10: Not in scope: type constructor or class `B'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail051.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail051.stderr-hugs 1
+ERROR "tcfail051.hs":3 - Undefined class "B"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail052.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail052.hs 1
+module ShouldFail where
+
+data C a = B a c
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail052.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail052.stderr 1
+
+tcfail052.hs:3:16: Not in scope: type variable `c'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail052.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail052.stderr-hugs 1
+ERROR "tcfail052.hs":3 - Undefined type variable "c"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail053.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail053.hs 1
+module TcFail where
+
+data B = C A
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail053.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail053.stderr 1
+
+tcfail053.hs:3:12: Not in scope: type constructor or class `A'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail053.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail053.stderr-hugs 1
+ERROR "tcfail053.hs":3 - Undefined type constructor "A"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail054.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail054.hs 1
+module ShouldFail where
+
+f (B a) = True
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail054.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail054.stderr 1
+
+tcfail054.hs:3:4: Not in scope: data constructor `B'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail054.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail054.stderr-hugs 1
+ERROR "tcfail054.hs":3 - Undefined data constructor "B"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail055.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail055.hs 1
+module ShouldFail where
+
+f x = (x + 1 :: Int) :: Float
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail055.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail055.stderr 1
+
+tcfail055.hs:3:8:
+    Couldn't match expected type `Float' with actual type `Int'
+    In the expression: (x + 1 :: Int) :: Float
+    In an equation for `f': f x = (x + 1 :: Int) :: Float
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail055.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail055.stderr-hugs 1
+ERROR "tcfail055.hs":3 - Type error in type annotation
+*** Term           : x + 1
+*** Type           : Int
+*** Does not match : Float
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail056.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail056.hs 1
+module ShouldFail where
+
+data Foo = MkFoo Bool
+
+instance Eq Foo where
+    (MkFoo x) == (MkFoo y) = x == y
+
+instance Eq Foo where
+    -- forgot to type "Ord" above
+    (MkFoo x) <= (MkFoo y) = x <= y
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail056.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail056.stderr 1
+
+tcfail056.hs:10:15: `<=' is not a (visible) method of class `Eq'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail056.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail056.stderr-hugs 1
+ERROR "tcfail056.hs":8 - Overlapping instances for class "Eq"
+*** This instance   : Eq Foo
+*** Overlaps with   : Eq Foo
+*** Common instance : Eq Foo
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail057.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail057.hs 1
+module ShouldFail where
+
+-- !!! inadvertently using -> instead of =>
+
+f :: (RealFrac a) -> a -> a
+f x = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail057.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail057.stderr 1
+
+tcfail057.hs:5:7:
+    Predicate `RealFrac a' used as a type
+    In the type signature for `f': f :: (RealFrac a) -> a -> a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail057.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail057.stderr-hugs 1
+ERROR "tcfail057.hs":5 - Undefined type constructor "RealFrac"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail058.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail058.hs 1
+module ShouldFail where
+import Data.Array
+
+-- !!! inadvertently using => instead of ->
+
+f :: (Array a) => a -> b
+f x = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail058.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail058.stderr 1
+
+tcfail058.hs:6:7:
+    Expecting one more argument to `Array a'
+    In the type signature for `f': f :: Array a => a -> b
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail058.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail058.stderr-hugs 1
+ERROR "tcfail058.hs":6 - Undefined class "Array"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail061.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail061.hs 1
+-- !! signature bugs exposed by Sigbjorn Finne
+--
+module ShouldFail where
+
+type Flarp a = (b,b)
+
+--More fun can be had if we change the signature slightly
+
+type Bob a = a
+
+type Flarp2 a = Bob (b,b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail061.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail061.stderr 1
+
+tcfail061.hs:5:17: Not in scope: type variable `b'
+
+tcfail061.hs:5:19: Not in scope: type variable `b'
+
+tcfail061.hs:11:22: Not in scope: type variable `b'
+
+tcfail061.hs:11:24: Not in scope: type variable `b'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail061.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail061.stderr-hugs 1
+ERROR "tcfail061.hs":11 - Undefined type variable "b"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail062.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail062.hs 1
+-- !!! bug report from Satnam
+--
+module ShouldFail
+where
+
+type Module = (String,[Declaration])
+
+data Declaration
+  = Architecture String StructuralExpression |
+    Behaviour String Parameter Parameter BehaviouralExpression
+    deriving (Eq, Show)
+
+data Parameter = ParameterVariable String | ParameterList [Parameter]
+                 deriving (Eq, Show)
+
+nameOfModule :: Module -> String
+nameOfModule (name, _) = name
+
+data StructuralExpression 
+  = Variable String |
+    Serial StructuralExpression StructuralExpression | 
+    Par [StructuralExpression] 
+    deriving (Eq, Show)
+
+data BehaviouralExpression
+  = BehaviouralVariable String 
+    | AndExpr BehaviouralExpression BehaviouralExpression
+    | OrExpr BehaviouralExpression BehaviouralExpression
+    | NotExpr BehaviouralExpression
+    deriving (Eq, Show)
+
+
+type BehaviouralRelation
+  = (behaviouralExpression, behaviouralExpression)
+---- ^ typo ----------------^ typo (but so what?)
+
+type BehaviouralRelationList = [BehaviouralRelation]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail062.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail062.stderr 1
+
+tcfail062.hs:34:6:
+    Not in scope: type variable `behaviouralExpression'
+
+tcfail062.hs:34:29:
+    Not in scope: type variable `behaviouralExpression'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail062.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail062.stderr-hugs 1
+ERROR "tcfail062.hs":34 - Undefined type variable "behaviouralExpression"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail063.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail063.hs 1
+-- !!! no type variable on a context
+-- !!! reported by Sigbjorn Finne
+
+module ShouldFail where
+
+moby :: Num => Int -> a -> Int
+moby x y = x+y
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail063.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail063.stderr 1
+
+tcfail063.hs:6:9:
+    Expecting one more argument to `Num'
+    In the type signature for `moby': moby :: Num => Int -> a -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail063.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail063.stderr-hugs 1
+ERROR "tcfail063.hs":6 - Haskell 98 does not support tag classes
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail065.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail065.hs 1
+{-
+
+------- Forwarded Message
+
+Date:    Wed, 30 Nov 1994 16:34:18 +0100
+From:    John Hughes <rjmh@cs.chalmers.se>
+To:      augustss@cs.chalmers.se, simonpj@dcs.gla.ac.uk
+Subject: Nice little program
+
+
+Lennart, Simon,
+
+You might like to look at the fun little program below.
+
+THUMBS DOWN to hbc for compiling it (it prints [72, 101, 108, 108, 111])
+THUMBS UP to ghc for rejecting it --- but what an error message!
+nhc and gofer both reject it with the right error message.
+I haven't tried Yale Haskell.
+
+Enjoy!
+- ----------------------------
+-}
+
+class HasX a where
+  setX :: x->a->a
+
+data X x = X x
+instance HasX (X x) where
+  setX x (X _) = X x
+
+changetype x = case setX x (X (error "change type!")) of X y->y
+
+main = print (changetype "Hello" :: [Int])
+
+{-
+------- End of Forwarded Message
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail065.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail065.stderr 1
+
+tcfail065.hs:29:20:
+    Couldn't match type `x1' with `x'
+      `x1' is a rigid type variable bound by
+           the type signature for setX :: x1 -> X x -> X x
+           at tcfail065.hs:29:3
+      `x' is a rigid type variable bound by
+          the instance declaration at tcfail065.hs:28:18
+    In the first argument of `X', namely `x'
+    In the expression: X x
+    In an equation for `setX': setX x (X _) = X x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail065.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail065.stderr-hugs 1
+ERROR "tcfail065.hs":29 - Inferred type is not general enough
+*** Expression    : setX
+*** Expected type : HasX (X a) => b -> X a -> X a
+*** Inferred type : HasX (X a) => a -> X a -> X a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail067.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail067.hs 1
+{-# LANGUAGE DatatypeContexts #-}
+module ShouldFail where
+
+infixr 1 `rangeOf`
+
+data Ord a => SubRange a = SubRange (a, a) a
+
+type IntSubRange = SubRange Int 
+
+
+subRangeValue :: SubRange a -> a
+subRangeValue (SubRange (lower, upper) value) = value
+
+subRange :: SubRange a -> (a, a)
+subRange (SubRange r value) = r
+
+newRange :: (Ord a, Show a) => (a, a) -> a -> SubRange a
+newRange r value = checkRange (SubRange r value)
+
+
+checkRange :: (Ord a, Show a) => SubRange a -> SubRange a
+checkRange (SubRange (lower, upper) value)
+  = if (value < lower) || (value > upper) then
+      error ("### sub range error. range = " ++ show lower ++ 
+              ".." ++ show upper ++ " value = " ++ show value ++ "\n")
+    else
+      SubRange (lower, upper) value
+
+
+instance Eq a => Eq (SubRange a) where
+  (==) a b = subRangeValue a == subRangeValue  b
+
+instance (Ord a) => Ord (SubRange a) where
+  (<)  = relOp (<)
+  (<=) = relOp (<=)
+  (>=) = relOp (>=)
+  (>)  = relOp (>)
+
+relOp :: Ord a => (a->a->Bool) -> SubRange a -> SubRange a -> Bool
+relOp op a b = (subRangeValue a) `op` (subRangeValue b)
+
+rangeOf :: (Ord a, Show a) => SubRange a -> SubRange a -> SubRange a
+rangeOf a b = checkRange (SubRange (subRange b) (subRangeValue a))
+
+showRange :: Show a => SubRange a -> String
+showRange (SubRange (lower, upper) value)
+  = show value ++ " :" ++ show lower ++ ".." ++ show upper
+
+showRangePair :: (Show a, Show b) => (SubRange a, SubRange b) -> String
+showRangePair (a, b)
+  = "(" ++ showRange a ++ ", " ++ showRange b ++ ")"
+
+showRangeTriple :: (Show a, Show b, Show c) =>
+                   (SubRange a, SubRange b, SubRange c) -> String
+showRangeTriple (a, b, c) 
+  = "(" ++ showRange a ++ ", " ++ showRange b ++ ", " ++ showRange c ++ ")"
+
+
+
+instance Num a => Num (SubRange a) where
+  negate = numSubRangeNegate
+  (+) = numSubRangeAdd
+  (-) = numSubRangeSubtract
+  (*) = numSubRangeMultiply
+  fromInteger a = SubRange (fromInteger a, fromInteger a) (fromInteger a)
+
+numSubRangeNegate :: (Ord a, Show a, Num a) => SubRange a -> SubRange a
+numSubRangeNegate (SubRange (lower, upper) value)
+  = checkRange (SubRange (lower, upper) (-value))
+
+numSubRangeBinOp :: Num a => (a -> a -> a) -> 
+                    SubRange a -> SubRange a -> SubRange a
+numSubRangeBinOp op a b
+  = SubRange (result, result) result
+    where
+    result = (subRangeValue a) `op` (subRangeValue b)
+
+-- partain:
+numSubRangeAdd, numSubRangeSubtract, numSubRangeMultiply :: Num a => SubRange a -> SubRange a -> SubRange a
+
+numSubRangeAdd = numSubRangeBinOp (+)
+numSubRangeSubtract = numSubRangeBinOp (-)
+numSubRangeMultiply = numSubRangeBinOp (*)
+
+unsignedBits :: Int -> (Int, Int)
+unsignedBits n = (0, 2^n-1)
+
+signedBits :: Int -> (Int, Int)
+signedBits n = (-2^(n-1), 2^(n-1)-1)   
+
+
+si_n :: Int -> Int -> IntSubRange
+si_n bits value = SubRange (signedBits bits) value
+
+si8, si10, si16 :: Int -> IntSubRange
+si8  = si_n 8
+si10 = si_n 10
+si16 = si_n 16
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail067.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail067.stderr 1
+
+tcfail067.hs:1:14:
+    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail067.hs:12:16:
+    No instance for (Ord a)
+      arising from a use of `SubRange'
+    In the pattern: SubRange (lower, upper) value
+    In an equation for `subRangeValue':
+        subRangeValue (SubRange (lower, upper) value) = value
+
+tcfail067.hs:15:11:
+    No instance for (Ord a)
+      arising from a use of `SubRange'
+    In the pattern: SubRange r value
+    In an equation for `subRange': subRange (SubRange r value) = r
+
+tcfail067.hs:46:12:
+    Could not deduce (Ord a) arising from a use of `SubRange'
+    from the context (Show a)
+      bound by the type signature for
+                 showRange :: Show a => SubRange a -> String
+      at tcfail067.hs:(46,1)-(47,58)
+    Possible fix:
+      add (Ord a) to the context of
+        the type signature for showRange :: Show a => SubRange a -> String
+    In the pattern: SubRange (lower, upper) value
+    In an equation for `showRange':
+        showRange (SubRange (lower, upper) value)
+          = show value ++ " :" ++ show lower ++ ".." ++ show upper
+
+tcfail067.hs:61:12:
+    Could not deduce (Ord a, Show a)
+      arising from a use of `numSubRangeNegate'
+    from the context (Num a)
+      bound by the instance declaration at tcfail067.hs:60:10-34
+    Possible fix:
+      add (Ord a, Show a) to the context of the instance declaration
+    In the expression: numSubRangeNegate
+    In an equation for `negate': negate = numSubRangeNegate
+    In the instance declaration for `Num (SubRange a)'
+
+tcfail067.hs:65:19:
+    Could not deduce (Ord a) arising from a use of `SubRange'
+    from the context (Num a)
+      bound by the instance declaration at tcfail067.hs:60:10-34
+    Possible fix:
+      add (Ord a) to the context of the instance declaration
+    In the expression:
+      SubRange (fromInteger a, fromInteger a) (fromInteger a)
+    In an equation for `fromInteger':
+        fromInteger a
+          = SubRange (fromInteger a, fromInteger a) (fromInteger a)
+    In the instance declaration for `Num (SubRange a)'
+
+tcfail067.hs:74:5:
+    Could not deduce (Ord a) arising from a use of `SubRange'
+    from the context (Num a)
+      bound by the type signature for
+                 numSubRangeBinOp :: Num a =>
+                                     (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
+      at tcfail067.hs:(73,1)-(76,53)
+    Possible fix:
+      add (Ord a) to the context of
+        the type signature for
+          numSubRangeBinOp :: Num a =>
+                              (a -> a -> a) -> SubRange a -> SubRange a -> SubRange a
+    In the expression: SubRange (result, result) result
+    In an equation for `numSubRangeBinOp':
+        numSubRangeBinOp op a b
+          = SubRange (result, result) result
+          where
+              result = (subRangeValue a) `op` (subRangeValue b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail067.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail067.stderr-hugs 1
+ERROR "tcfail067.hs":12 - Cannot justify constraints in explicitly typed binding
+*** Expression    : subRangeValue
+*** Type          : SubRange a -> a
+*** Given context : ()
+*** Constraints   : Ord a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail068.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail068.hs 1
+-- !! Make sure that state threads don't escape
+-- !! (example from Neil Ashton at York)
+--
+module ShouldFail where
+
+import GHC.Arr
+import Control.Monad.ST	( runST )
+
+type IndTree s t = STArray s (Int,Int) t
+
+itgen :: Constructed a => (Int,Int) -> a -> IndTree s a
+itgen n x = 
+	runST (
+	newSTArray ((1,1),n) x)
+
+itiap :: Constructed a => (Int,Int) -> (a->a) -> IndTree s a -> IndTree s a
+itiap i f arr =
+	runST (
+	readSTArray arr i >>= \val ->
+	writeSTArray arr i (f val) >>
+	return arr)
+
+itrap :: Constructed a => ((Int,Int),(Int,Int)) -> (a->a) -> IndTree s a -> IndTree s a
+itrap ((i,k),(j,l)) f arr = runST(itrap' i k)
+	where
+	itrap' i k = if k > l then return arr
+		     else (itrapsnd i k >>
+			itrap' i (k+1))
+	itrapsnd i k = if i > j then return arr
+                     else (readSTArray arr (i,k) >>= \val ->
+		        writeSTArray arr (i,k) (f val) >>
+		        itrapsnd (i+1) k)
+
+itrapstate :: Constructed b => ((Int,Int),(Int,Int)) -> (a->b->(a,b)) -> ((Int,Int)->c->a) ->
+		(a->c) -> c -> IndTree s b -> (c, IndTree s b)
+itrapstate ((i,k),(j,l)) f c d s arr = runST(itrapstate' i k s)
+	where
+	itrapstate' i k s = if k > l then return (s,arr)
+			    else (itrapstatesnd i k s >>= \(s,arr) ->
+				itrapstate' i (k+1) s)
+	itrapstatesnd i k s = if i > j then return (s,arr)
+                            else (readSTArray arr (i,k) >>= \val ->
+		               let (newstate, newval) = f (c (i,k) s) val
+		               in writeSTArray arr (i,k) newval >>
+		               itrapstatesnd (i+1) k (d newstate))
+
+-- stuff from Auxiliary: copied here (partain)
+
+sap :: (a->b) -> (c,a) -> (c,b)
+sap f (x,y) = (x, f y)
+
+fap :: (a->b) -> (a,c) -> (b,c)
+fap f (x,y) = (f x, y)
+
+nonempty :: [a] -> Bool
+nonempty []    = False
+nonempty (_:_) = True
+
+-- const :: a -> b -> a
+-- const k x = k
+
+-- id :: a -> a
+-- id x = x
+
+compose :: [a->a] -> a -> a
+compose = foldr (.) id
+
+class Constructed a where
+   normal :: a -> Bool
+
+instance Constructed Bool where
+   normal True = True
+   normal False = True
+
+instance Constructed Int where
+   normal 0 = True
+   normal n = True
+
+instance (Constructed a, Constructed b) => Constructed (a,b) where
+   normal (x,y) = normal x && normal y
+
+-- pair :: (Constructed a, Constructed b) => a -> b -> (a,b)
+-- pair x y | normal x && normal y = (x,y)
+
+instance Constructed (Maybe a) where
+   normal Nothing = True
+   normal (Just _) = True
+
+just :: Constructed a => a -> Maybe a
+just x | normal x = Just x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail068.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail068.stderr 1
+
+tcfail068.hs:14:9:
+    Could not deduce (s1 ~ s)
+    from the context (Constructed a)
+      bound by the type signature for
+                 itgen :: Constructed a => (Int, Int) -> a -> IndTree s a
+      at tcfail068.hs:(12,1)-(14,31)
+      `s1' is a rigid type variable bound by
+           a type expected by the context: GHC.ST.ST s1 (IndTree s a)
+           at tcfail068.hs:13:9
+      `s' is a rigid type variable bound by
+          the type signature for
+            itgen :: Constructed a => (Int, Int) -> a -> IndTree s a
+          at tcfail068.hs:12:1
+    Expected type: GHC.ST.ST s (IndTree s1 a)
+      Actual type: GHC.ST.ST s (STArray s (Int, Int) a)
+    In the return type of a call of `newSTArray'
+    In the first argument of `runST', namely
+      `(newSTArray ((1, 1), n) x)'
+
+tcfail068.hs:19:21:
+    Could not deduce (s ~ s1)
+    from the context (Constructed a)
+      bound by the type signature for
+                 itiap :: Constructed a =>
+                          (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+      at tcfail068.hs:(17,1)-(21,19)
+      `s' is a rigid type variable bound by
+          the type signature for
+            itiap :: Constructed a =>
+                     (Int, Int) -> (a -> a) -> IndTree s a -> IndTree s a
+          at tcfail068.hs:17:1
+      `s1' is a rigid type variable bound by
+           a type expected by the context: GHC.ST.ST s1 (IndTree s a)
+           at tcfail068.hs:18:9
+    Expected type: STArray s1 (Int, Int) a
+      Actual type: IndTree s a
+    In the first argument of `readSTArray', namely `arr'
+    In the first argument of `(>>=)', namely `readSTArray arr i'
+
+tcfail068.hs:24:35:
+    Could not deduce (s ~ s1)
+    from the context (Constructed a)
+      bound by the type signature for
+                 itrap :: Constructed a =>
+                          ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
+      at tcfail068.hs:(24,1)-(32,41)
+      `s' is a rigid type variable bound by
+          the type signature for
+            itrap :: Constructed a =>
+                     ((Int, Int), (Int, Int)) -> (a -> a) -> IndTree s a -> IndTree s a
+          at tcfail068.hs:24:1
+      `s1' is a rigid type variable bound by
+           a type expected by the context: GHC.ST.ST s1 (IndTree s a)
+           at tcfail068.hs:24:29
+    Expected type: GHC.ST.ST s1 (IndTree s a)
+      Actual type: GHC.ST.ST s (IndTree s a)
+    In the return type of a call of itrap'
+    In the first argument of `runST', namely `(itrap' i k)'
+
+tcfail068.hs:36:46:
+    Could not deduce (s ~ s1)
+    from the context (Constructed b)
+      bound by the type signature for
+                 itrapstate :: Constructed b =>
+                               ((Int, Int), (Int, Int))
+                               -> (a -> b -> (a, b))
+                               -> ((Int, Int) -> c -> a)
+                               -> (a -> c)
+                               -> c
+                               -> IndTree s b
+                               -> (c, IndTree s b)
+      at tcfail068.hs:(36,1)-(45,66)
+      `s' is a rigid type variable bound by
+          the type signature for
+            itrapstate :: Constructed b =>
+                          ((Int, Int), (Int, Int))
+                          -> (a -> b -> (a, b))
+                          -> ((Int, Int) -> c -> a)
+                          -> (a -> c)
+                          -> c
+                          -> IndTree s b
+                          -> (c, IndTree s b)
+          at tcfail068.hs:36:1
+      `s1' is a rigid type variable bound by
+           a type expected by the context: GHC.ST.ST s1 (c, IndTree s b)
+           at tcfail068.hs:36:40
+    Expected type: GHC.ST.ST s1 (c, IndTree s b)
+      Actual type: GHC.ST.ST s (c, IndTree s b)
+    In the return type of a call of itrapstate'
+    In the first argument of `runST', namely `(itrapstate' i k s)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail069.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail069.hs 1
+{- 
+From: Marc van Dongen <dongen@cs.ucc.ie>
+Date: Wed, 9 Apr 1997 14:06:39 +0100 (BST)
+
+I just wanted to report that the erroneous and tiny
+program added below can not be compiled within 6MB of
+heap (Admitted it can be compiled with a bigger heap).
+It was part of a bigger program that could not be
+compiled within 20MB of heap.
+
+[GHC 2.03 and earlier.]  Turned out to be a bug in the
+error recovery mechanism.
+
+-}
+
+module ShouldFail where
+
+too_much :: [Int] -> [(Int,Int)] -> [(Int,[Int])] -> Bool
+too_much ds ((k,m):q1) s0
+  = case (list1,list2) of
+      []  -> error "foo" -- too_much ds q2m  s2m
+  where list1 = ds
+	list2 = ds
+	{-
+	list1 = [k' | k' <- ds, k == k']
+        list2 = [k' | k' <- ds, m == k']
+        s1   = aas s0 k
+        raM  = []
+        raKM = listUnion (\a b -> a) [] []
+        s1k  = s1
+        q1k  = raM
+        s2k  = s1
+        q2k  = raM
+        s2m  = s1
+        q2m  = raM
+        s2km = foldr (flip aas) s1 raKM
+        q2km = raKM
+	-}
+
+listUnion :: (v -> v -> Bool) -> [v] -> [v] -> [v]
+listUnion _  _ _
+  = []
+
+aas :: (a,b) -> a -> (a,b)
+aas s _
+  = s
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail069.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail069.stderr 1
+
+tcfail069.hs:21:7:
+    Couldn't match expected type `([Int], [Int])'
+                with actual type `[t0]'
+    In the pattern: []
+    In a case alternative: [] -> error "foo"
+    In the expression: case (list1, list2) of { [] -> error "foo" }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail069.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail069.stderr-hugs 1
+ERROR "tcfail069.hs":20 - Type error in case pattern
+*** Term           : []
+*** Type           : [a]
+*** Does not match : ([Int],[Int])
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail070.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail070.hs 1
+{- 
+From: Wolfgang Drotschmann <drotschm@athene.informatik.uni-bonn.de>
+Resent-Date:  Thu, 15 May 1997 17:23:09 +0100
+
+I'm still using the old ghc-2.01. In one program I ran into a problem
+I couldn't fix. But I played around with it, I found a small little
+script which reproduces it very well:
+
+panic! (the `impossible' happened):
+	tlist
+-}
+
+module TcFail where
+
+type State = ([Int] Bool)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail070.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail070.stderr 1
+
+tcfail070.hs:15:15:
+    `[Int]' is applied to too many type arguments
+    In the type `[Int] Bool'
+    In the type synonym declaration for `State'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail070.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail070.stderr-hugs 1
+ERROR "tcfail070.hs":15 - Illegal type "[] Int Bool" in constructor application
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail071.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail071.hs 1
+-- !!! Mis-matched contexts in a mutually recursive group
+
+{-  # LANGUAGE NoRelaxedPolyRec #-}
+-- With the new type checker you can't turn off RelaxedPolyRec
+-- so this test always succeeds
+
+module ShouldFail where
+
+f :: (Ord d) => d -> d
+f c = g c
+
+g :: e -> e
+g c = c
+  where p = f (1 :: Int)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail071.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail072.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail072.hs 1
+{- This program crashed GHC 2.03
+
+   From: Marc van Dongen <dongen@cs.ucc.ie>
+   Date: Sat, 31 May 1997 14:35:40 +0100 (BST)
+
+  zonkIdOcc: g_aoQ
+
+  panic! (the `impossible' happened):
+          lookupBindC:no info!
+  for: g_aoQ
+  (probably: data dependencies broken by an optimisation pass)
+  static binds for:
+  Tmp.$d1{-rmM,x-}
+  local binds for:
+-}
+
+module ShouldFail where
+
+data AB p q = A
+            | B p q
+
+g :: (Ord p,Ord q) => (AB p q) -> Bool
+g (B _ _) = g A
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail072.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail072.stderr 1
+
+tcfail072.hs:23:13:
+    Ambiguous type variable `p0' in the constraint:
+      (Ord p0) arising from a use of `g'
+    Probable fix: add a type signature that fixes these type variable(s)
+    In the expression: g A
+    In an equation for `g': g (B _ _) = g A
+
+tcfail072.hs:23:13:
+    Ambiguous type variable `q0' in the constraint:
+      (Ord q0) arising from a use of `g'
+    Probable fix: add a type signature that fixes these type variable(s)
+    In the expression: g A
+    In an equation for `g': g (B _ _) = g A
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail072.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail072.stderr-hugs 1
+ERROR "tcfail072.hs":23 - Cannot justify constraints in explicitly typed binding
+*** Expression    : g
+*** Type          : (Ord a, Ord b) => AB a b -> Bool
+*** Given context : (Ord a, Ord b)
+*** Constraints   : (Ord c, Ord d)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail073.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail073.hs 1
+-- what error do you get if you redefined Prelude instances?
+
+module ShouldFail where
+
+f :: (Eq a) => (a,a) -> (a,a) -> Bool
+f x y = x == y
+
+instance Eq a => Eq (a,b) where
+    (m,n) == (o,p) = m == o
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail073.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail073.stderr 1
+
+tcfail073.hs:8:10:
+    Duplicate instance declarations:
+      instance Eq a => Eq (a, b) -- Defined at tcfail073.hs:8:10
+      instance (Eq a, Eq b) => Eq (a, b) -- Defined in `GHC.Classes'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail073.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail073.stderr-hugs 1
+ERROR "tcfail073.hs":8 - Overlapping instances for class "Eq"
+*** This instance   : Eq (a,b)
+*** Overlaps with   : Eq (a,b)
+*** Common instance : Eq (a,b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail075.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail075.hs 1
+{-# LANGUAGE MagicHash #-}
+
+-- !!! Test top-level unboxed types
+
+module ShouldFail where
+
+import GHC.Base
+import GHC.Prim
+
+x = 1#
+
+y :: Int#
+y = x +# 1#
+
+main =  let 
+	  z = x -# y
+	in
+	if z ># 3# then putStrLn "Yes"
+		   else putStrLn "No"
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail075.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail075.stderr 1
+
+tcfail075.hs:10:1:
+    Top-level bindings for unlifted types aren't allowed: x = 1#
+
+tcfail075.hs:13:1:
+    Top-level bindings for unlifted types aren't allowed: y = x +# 1#
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail076.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail076.hs 1
+{-# LANGUAGE Rank2Types #-}
+
+{- 
+	From: Ralf Hinze <ralf@uran.informatik.uni-bonn.de>
+	Date: Fri, 15 Aug 1997 15:20:51 +0200 (MET DST)
+
+I *suppose* that there is a bug in GHC's type checker. The following
+program, which I think is ill-typed, passes silently the type checker.
+Needless to say that it uses some of GHC's arcane type extensions.
+-}
+
+module ShouldFail where
+
+data ContT m a		=  KContT (forall res. (a -> m res) -> m res)
+unKContT (KContT x)	=  x
+
+callcc			:: ((a -> ContT m b) -> ContT m a) -> ContT m a
+callcc f		=  KContT (\cont -> unKContT (f (\a -> KContT (\cont' -> cont a))) cont)
+
+{-
+`ContT' is a continuation monad transformer. Note that we locally
+qualify over the result type `res' (sometimes called answer or
+output).  IMHO this make it impossible to define control constructs
+like `callcc'. Let's have a closer look: the code of `callcc' contains
+the subexpression `KContT (\cont' -> cont a)'. To be well-typed the
+argument of `KContT' must have the type `(All res) => (a -> m res) -> m
+res'. Quantification is not possible, however, since the type variable
+in `cont's type cannot be forall'd, since it also appears at an outer
+level.  Right? Or wrong?
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail076.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail076.stderr 1
+
+tcfail076.hs:18:82:
+    Couldn't match type `res' with `res1'
+      `res' is a rigid type variable bound by
+            a type expected by the context: (a -> m res) -> m res
+            at tcfail076.hs:18:28
+      `res1' is a rigid type variable bound by
+             a type expected by the context: (b -> m res1) -> m res1
+             at tcfail076.hs:18:64
+    Expected type: m res1
+      Actual type: m res
+    In the return type of a call of `cont'
+    In the expression: cont a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail076.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail076.stderr-hugs 1
+ERROR "tcfail076.hs":18 - Inferred type is not general enough
+*** Expression    : \cont' -> cont a
+*** Expected type : (_29 -> _28 a) -> _28 a
+*** Inferred type : (_29 -> _28 _30) -> _28 _30
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail077.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail077.hs 1
+module ShouldFail where
+
+-- !!! declaring a default method in a class that doesn't have that method.
+
+class Foo a where
+  op :: a -> a
+
+  op2 x = x	-- Bogus declaration
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail077.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail077.stderr 1
+
+tcfail077.hs:8:3: `op2' is not a (visible) method of class `Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail077.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail077.stderr-hugs 1
+ERROR "tcfail077.hs":8 - No member "op2" in class "Foo"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail078.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail078.hs 1
+module ShouldFail where
+
+-- !!! Using a type constructor as a class name
+
+f :: Integer i => i 
+f =               0    
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail078.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail078.stderr 1
+
+tcfail078.hs:5:6:
+    `Integer' is applied to too many type arguments
+    In the type signature for `f': f :: Integer i => i
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail078.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail078.stderr-hugs 1
+ERROR "tcfail078.hs":5 - Undefined class "Integer"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail079.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail079.hs 1
+{-# LANGUAGE MagicHash #-}
+
+module ShouldFail where
+
+-- !!! unboxed field in newtype declaration
+
+import GHC.Exts ( Int# )
+
+newtype Unboxed = Unboxed Int#
+
+f = [ Unboxed 1#, Unboxed 2# ] -- shouldn't be allowed!
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail079.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail079.stderr 1
+
+tcfail079.hs:9:27:
+    Expecting a lifted type, but `Int#' is unlifted
+    In the type `Int#'
+    In the definition of data constructor `Unboxed'
+    In the newtype declaration for `Unboxed'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail080.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail080.hs 1
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+-- !!! Multi-param type classes test: ambiguity bug
+
+-- GHC actually accepts this program because
+--	q :: Collection c a => a -> Bool
+-- and there is no a priori reason to suppose that
+-- q would be ambiguous in every context. For example,
+-- it could be fine if we had
+--	instance c Int where ...
+-- Of course, it'd be hard to fill in the "..." in this particular
+-- case, but that relies on observations about the form of the types
+-- of the class methods, surely beyond what a compiler should do.
+-- That's why GHC accepts it
+
+module ShouldFail where
+
+class Collection c a where
+    empty :: c a
+    add :: a -> c a -> c a
+    isempty :: c a -> Bool
+
+singleton x = add x empty
+
+q x = isempty (singleton x)
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail080.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail080.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail080.stderr-hugs 1
+ERROR "tcfail080.hs":25 - Ambiguous type signature in inferred type
+*** ambiguous type : Collection a b => b -> Bool
+*** assigned to    : q
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail082.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail082.hs 1
+module Main(main) where
+import Data82
+import Inst82_1
+import Inst82_2
+
+data Baz = Baz deriving Read
+
+main     = print ((read "FooData")::FooData)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail082.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail082.stderr 1
+
+tcfail082.hs:2:1:
+    Failed to load interface for `Data82'
+    Use -v to see a list of the files searched for.
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail082.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail082.stderr-hugs 1
+ERROR "tcfail082.hs" - Can't find imported module "Inst82_2"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail083.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail083.hs 1
+module ShouldFail where
+
+data Bar = Bar { flag :: Bool } deriving( Show )
+
+data State = State { bar :: Bar, baz :: Float }
+
+display :: State -> IO ()
+display (State{ bar = Bar { flag = f, baz = b }}) = print (f,b)
+
+-- Typo! The line above should better be:
+-- display (State{ bar = Bar { flag = f }, baz = b }) = print (f,b)
+
+-- GHC 4.04 (as released) crashed with
+--	panic! (the `impossible' happened): tcLookupValue: b{-r4n-}
+-- Bug reported by Sven Panne
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail083.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail083.stderr 1
+
+tcfail083.hs:8:39:
+    Constructor `Bar' does not have field `baz'
+    In the pattern: Bar {flag = f, baz = b}
+    In the pattern: State {bar = Bar {flag = f, baz = b}}
+    In an equation for `display':
+        display (State {bar = Bar {flag = f, baz = b}}) = print (f, b)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail083.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail083.stderr-hugs 1
+ERROR "tcfail083.hs":8 - No constructor has all of the fields specified in Bar {flag = f, baz = b}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail084.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail084.hs 1
+-- !!! Check that using a label belonging to another constructor
+-- !!! is flagged as being incorrect.
+module ShouldFail where
+
+data F
+ = F { x :: Int }
+ | G { y :: Int }
+
+z :: F
+z = F { y = 2 }
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail084.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail084.stderr 1
+
+tcfail084.hs:10:5:
+    Constructor `F' does not have field `y'
+    In the expression: F {y = 2}
+    In an equation for `z': z = F {y = 2}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail084.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail084.stderr-hugs 1
+ERROR "tcfail084.hs":10 - Constructor "F" does not have selected fields in F {y = 2}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail085.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail085.hs 1
+-- !!! Check that not supplying bindings for strict fields
+-- !!! is flagged as being incorrect.
+module ShouldFail where
+
+data F
+ = F { x :: Int, y :: !Int }
+
+z :: F
+z = F { x = 2 }
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail085.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail085.stderr 1
+
+tcfail085.hs:9:5:
+    Constructor `F' does not have the required strict field(s): y
+    In the expression: F {x = 2}
+    In an equation for `z': z = F {x = 2}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail085.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail085.stderr-hugs 1
+ERROR "tcfail085.hs":9 - Construction does not define strict field
+Expression : F {x = 2}
+Field      : y
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail086.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail086.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- !!! Check that we can't derive instances of existential types
+module ShouldFail where
+
+data Ex = forall a. Ex [a] deriving( Eq )
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail086.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail086.stderr 1
+
+tcfail086.hs:6:38:
+    Can't make a derived instance of `Eq Ex':
+      Constructor `Ex' must have a Haskell-98 type
+      Possible fix: use a standalone deriving declaration instead
+    In the data type declaration for `Ex'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail086.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail086.stderr-hugs 1
+ERROR "tcfail086.hs":6 - Cannot derive instances for types with existentially typed components
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail087.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail087.hs 1
+{-# LANGUAGE UnboxedTuples #-}
+
+-- !!! Check that unboxed tuples can't be function arguments
+module ShouldFail where
+
+data Ex = Ex (# Int,Int #)
+
+f :: (# Int,Int #) -> Int
+f x = error "urk"
+
+g (# x,y #) = x
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail087.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail087.stderr 1
+
+tcfail087.hs:6:14:
+    Kind mis-match
+    Expected kind `ArgKind', but `(# Int, Int #)' has kind `(#)'
+    In the type `(# Int, Int #)'
+    In the definition of data constructor `Ex'
+    In the data type declaration for `Ex'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail088.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail088.hs 1
+{-# LANGUAGE Rank2Types, FlexibleInstances #-}
+
+-- !!! Check that forall types can't be arguments
+module ShouldFail where
+
+
+data T s a = MkT s a
+ 
+instance Ord a => Ord (forall s. T s a) 
+-- A for-all should not appear as an argument to Ord
+
+
+
+g :: T s (forall b.b)
+g = error "urk"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail088.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail088.stderr 1
+
+tcfail088.hs:9:19:
+    Illegal polymorphic or qualified type: forall s. T s a
+    In the instance declaration for `Ord (forall s. T s a)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail088.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail088.stderr-hugs 1
+ERROR "tcfail088.hs":9 - Syntax error in type expression (unexpected keyword "forall")
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail089.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail089.hs 1
+
+
+-- !!! Check non-constructors in patterns fail tidily
+-- !!! The -O made ghc 4.08 go into a loop!
+-- Unfortunately the -O has to go in the Makefile
+
+module ShouldFail where
+
+compute :: String -> String
+compute ("hd" ++ _) = "_"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail089.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail089.stderr 1
+
+tcfail089.hs:10:10: Parse error in pattern: "hd" ++ _
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail089.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail089.stderr-hugs 1
+ERROR "tcfail089.hs":10 - Syntax error in declaration (unexpected symbol "++")
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail090.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail090.hs 1
+{-# LANGUAGE MagicHash #-}
+
+module ShouldFail where
+
+import GHC.Base
+
+die :: Int -> ByteArray#
+die _ = undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail090.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail090.stderr 1
+
+tcfail090.hs:8:9:
+    Couldn't match kind `*' against `#'
+    Kind incompatibility when matching types:
+      a0 :: *
+      ByteArray# :: #
+    In the expression: undefined
+    In an equation for `die': die _ = undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail091.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail091.stderr 1
+
+tcfail091.hs:8:1:
+    Illegal constraint ?imp::Int
+    In the context: (?imp::Int)
+    While checking the super-classes of class `C'
+    In the class declaration for `C'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail091.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail091.stderr-hugs 1
+ERROR "tcfail091.hs":8 - Implicit parameters not permitted in class context
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail092.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail092.hs 1
+{-# LANGUAGE ParallelListComp #-}
+
+-- !!! Illegal conflicting parallel bindings
+
+module ShouldFail where
+
+xys = [ () | let a = 13 | let a = 17 ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail092.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail092.stderr 1
+
+tcfail092.hs:7:27:
+    Duplicate binding in parallel list comprehension for: `a'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail093.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail093.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+             FlexibleInstances, UndecidableInstances #-}
+-- UndecidableInstances now needed because the Coverage Condition fails
+
+module ShouldFail where
+
+-- A stripped down functional-dependency 
+-- example that causes GHC 4.08.1 to crash with:
+-- "basicTypes/Var.lhs:194: Non-exhaustive patterns in function readMutTyVar"
+-- Reported by Thomas Hallgren Nov 00
+
+-- July 07: I'm changing this from "should fail" to "should succeed"
+-- See Note [Important subtlety in oclose] in FunDeps
+
+
+primDup :: Int -> IO Int
+primDup = undefined
+
+dup () = call primDup
+
+-- 	call :: Call c h => c -> h
+--
+--	call primDup :: {Call (Int -> IO Int) h} => h  with  
+--  Using the instance decl gives
+--	call primDup :: {Call (IO Int) h'} => Int -> h'
+--  The functional dependency means that h must be constant
+--  Hence program is rejected because it can't find an instance 
+--  for {Call (IO Int) h'}
+
+class Call    c h | c -> h where
+    call  :: c -> h
+
+instance Call c h => Call (Int->c) (Int->h) where 
+    call f = call . f
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail094.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail094.hs 1
+
+
+module ShouldFail where
+
+-- This nonsense tickled a missing-kind-check error in ghc5.00.2
+
+type A = Int 1
+
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail094.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail094.stderr 1
+
+tcfail094.hs:7:14: parse error on input `1'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail094.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail094.stderr-hugs 1
+ERROR "tcfail094.hs":7 - Syntax error in input (unexpected numeric literal)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail095.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail095.hs 1
+{-# LANGUAGE MagicHash #-}
+
+-- !!! Test top-level unboxed types
+
+module ShouldFail where
+
+import GHC.Base
+
+x = 1#
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail095.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail095.stderr 1
+
+tcfail095.hs:9:1:
+    Top-level bindings for unlifted types aren't allowed: x = 1#
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail096.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail096.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+             FlexibleInstances #-}
+module ShouldFail where
+
+class Foo f a r | f a -> r where
+      foo::f->a->r
+
+-- These instances are incompatible because we can unify
+-- the first two paramters, though it's rather obscure:
+--	p -> (a,b)
+--	t -> (,) (a,a)
+--	c -> (,) a
+--	r -> s
+--
+-- So a constraint which would sow this up is
+--	Foo ((Int,Int)->Int)
+--	    ((Int,Int), (Int,Int))
+--	    t
+-- This matches both.  Not easy to spot, and the error
+-- message would be improved by giving the unifier, or
+-- a witness.
+
+instance Foo (p->s)     (t p)    (t s)
+instance Foo ((a,b)->r) (c a,c b)(c r)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail096.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail096.stderr 1
+
+tcfail096.hs:23:10:
+    Functional dependencies conflict between instance declarations:
+      instance Foo (p -> s) (t p) (t s) -- Defined at tcfail096.hs:23:10
+      instance Foo ((a, b) -> r) (c a, c b) (c r)
+        -- Defined at tcfail096.hs:24:10
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail096.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail096.stderr-hugs 1
+ERROR "tcfail096.hs":24 - Instances are not consistent with dependencies
+*** This instance    : Foo ((a,b) -> c) (d a,d b) (d c)
+*** Conflicts with   : Foo (a -> b) (c a) (c b)
+*** For class        : Foo a b c
+*** Under dependency : a b -> c
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail097.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail097.hs 1
+module ShouldFail where
+
+-- !!! Ambiguous constraint in type signature
+
+f :: Eq a => Int -> Int
+f x = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail097.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail097.stderr 1
+
+tcfail097.hs:5:1:
+    Ambiguous constraint `Eq a'
+        At least one of the forall'd type variables mentioned by the constraint
+        must be reachable from the type after the '=>'
+    In the type signature for `f': f :: Eq a => Int -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail097.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail097.stderr-hugs 1
+ERROR "tcfail097.hs":5 - Ambiguous type signature in type declaration
+*** ambiguous type : Eq a => Int -> Int
+*** assigned to    : f
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail098.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail098.hs 1
+
+{-# LANGUAGE UndecidableInstances #-}
+
+module ShouldFail where
+
+-- !!! ambiguous constraint in the context of an instance declaration
+class Bar a
+instance Bar a => Bar Bool
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail098.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail098.stderr 1
+
+tcfail098.hs:8:10:
+    Ambiguous constraint `Bar a'
+        At least one of the forall'd type variables mentioned by the constraint
+        must be reachable from the type after the '=>'
+    In the instance declaration for `Bar Bool'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail098.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail098.stderr-hugs 1
+ERROR "tcfail098.hs":5 - Ambiguous type variable "a"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail099.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail099.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- This bogus program slipped past GHC 5.02!
+
+module ShouldFail where
+
+data DS = forall a. C (a -> Int)
+
+call (C f) arg = f arg
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail099.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail099.stderr 1
+
+tcfail099.hs:9:20:
+    Couldn't match type `t' with `a'
+      `t' is a rigid type variable bound by
+          the inferred type of call :: DS -> t -> Int at tcfail099.hs:9:1
+      `a' is a rigid type variable bound by
+          a pattern with constructor
+            C :: forall a. (a -> Int) -> DS,
+          in an equation for `call'
+          at tcfail099.hs:9:7
+    In the first argument of `f', namely `arg'
+    In the expression: f arg
+    In an equation for `call': call (C f) arg = f arg
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail099.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail099.stderr-hugs 1
+ERROR "tcfail099.hs":9 - Existentially quantified variable in inferred type
+*** Variable     : _6
+*** From pattern : C f
+*** Result type  : DS -> _6 -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail100.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail100.hs 1
+-- This one broke GHC 5.02, because of the unsaturated
+-- uses of type synonyms, which are nevertheless kind-correct.
+
+module ShouldCompile where
+
+type A i = i
+type B = A
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail100.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail100.stderr 1
+
+tcfail100.hs:7:1:
+    Type synonym `A' should have 1 argument, but has been given none
+    In the type synonym declaration for `B'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail100.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail100.stderr-hugs 1
+ERROR "tcfail100.hs":7 - Not enough arguments for type synonym "A"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail101.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail101.hs 1
+-- This one broke GHC 5.02, because of the unsaturated
+-- uses of type synonyms, which are nevertheless kind-correct.
+
+module ShouldCompile where
+
+type A i = i
+data T k = MkT (k Int)
+
+f :: T A	-- BAD!
+f = error "foo"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail101.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail101.stderr 1
+
+tcfail101.hs:9:1:
+    Type synonym `A' should have 1 argument, but has been given none
+    In the type signature for `f': f :: T A
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail101.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail101.stderr-hugs 1
+ERROR "tcfail101.hs":9 - Not enough arguments for type synonym "A"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail102.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail102.hs 1
+{-# LANGUAGE DatatypeContexts #-}
+module ShouldFail where
+
+import Data.Ratio
+
+data Integral a => P a = P { p :: a }
+
+f :: Integral a => P (Ratio a) -> P (Ratio a)
+f x = x { p = p x }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail102.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail102.stderr 1
+
+tcfail102.hs:1:14:
+    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail102.hs:9:15:
+    Could not deduce (Integral (Ratio a)) arising from a use of `p'
+    from the context (Integral a)
+      bound by the type signature for
+                 f :: Integral a => P (Ratio a) -> P (Ratio a)
+      at tcfail102.hs:9:1-19
+    Possible fix:
+      add (Integral (Ratio a)) to the context of
+        the type signature for
+          f :: Integral a => P (Ratio a) -> P (Ratio a)
+      or add an instance declaration for (Integral (Ratio a))
+    In the `p' field of a record
+    In the expression: x {p = p x}
+    In an equation for `f': f x = x {p = p x}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail102.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail102.stderr-hugs 1
+ERROR "tcfail102.hs":8 - Cannot justify constraints in explicitly typed binding
+*** Expression    : f
+*** Type          : Integral a => P (Ratio a) -> P (Ratio a)
+*** Given context : Integral a
+*** Constraints   : Integral (Ratio a)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail103.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail103.hs 1
+
+
+module ShouldCompile where
+import GHC.ST
+import GHC.STRef
+import GHC.Arr
+
+-- Another 'escape' example
+
+f:: ST t Int
+f = do
+    v <- newSTRef 5
+    let g :: ST s Int
+	-- Implicitly forall s. ST s Int
+        g = readSTRef v
+    g
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail103.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail103.stderr 1
+
+tcfail103.hs:15:23:
+    Couldn't match type `t' with `s'
+      `t' is a rigid type variable bound by
+          the type signature for f :: ST t Int at tcfail103.hs:11:1
+      `s' is a rigid type variable bound by
+          the type signature for g :: ST s Int at tcfail103.hs:15:9
+    Expected type: STRef s Int
+      Actual type: STRef t Int
+    In the first argument of `readSTRef', namely `v'
+    In the expression: readSTRef v
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail104.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail104.hs 1
+{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
+
+-- Test the handling of conditionals in rank-n stuff
+-- Should fail, regardless of branch ordering
+
+module ShouldFail where
+
+-- These two are ok
+f1 = (\ (x :: forall a. a->a) -> x) 
+f2 = (\ (x :: forall a. a->a) -> x) id 'c'
+
+-- These fail
+f3 v = (if v then
+	  (\ (x :: forall a. a->a) -> x) 
+	else
+	  (\ x -> x) 
+      ) id 'c'
+
+f4 v = (if v then
+	  (\ x -> x) 
+	else
+	  (\ (x :: forall a. a->a) -> x) 
+       ) id 'c'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail104.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail104.stderr 1
+
+tcfail104.hs:16:19:
+    Couldn't match expected type `a0 -> a0'
+                with actual type `forall a. a -> a'
+    In the expression: x
+    In the expression: (\ x -> x)
+    In the expression:
+      if v then (\ (x :: forall a. a -> a) -> x) else (\ x -> x)
+
+tcfail104.hs:22:39:
+    Couldn't match expected type `forall a. a -> a'
+                with actual type `a0 -> a0'
+    In the expression: x
+    In the expression: (\ (x :: forall a. a -> a) -> x)
+    In the expression:
+      if v then (\ x -> x) else (\ (x :: forall a. a -> a) -> x)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail105.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail105.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- Existential context should quantify over some new type variables
+--
+-- Jan07: this is now fine, because we've lifted the restrction
+-- 	  that the context on a constructor should mention 
+--	  existential type variables
+
+module ShouldFail where
+
+data S m t a = Ok a | Cont (M m t a)
+data M m t a = Monad m => M { unM::(m (S m t a))}
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail105.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail105.stderr-hugs 1
+ERROR "tcfail105.hs":8 - Syntax error in input (unexpected `=>')
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail106.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail106.hs 1
+-- This one risked building a recursive dictionary rather than
+-- failing, in GHC before 5.03.   Actually, 5.02 managed it ok,
+-- but I think more by luck than good judgement.
+
+module ShouldFail where
+
+class S a
+class S a => C a where { opc :: a -> a }
+class S b => D b where { opd :: b -> b }
+
+instance C Int where
+   opc = opd
+
+instance D Int where
+   opd = opc
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail106.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail106.stderr 1
+
+tcfail106.hs:11:10:
+    No instance for (S Int)
+      arising from the superclasses of an instance declaration
+    Possible fix: add an instance declaration for (S Int)
+    In the instance declaration for `C Int'
+
+tcfail106.hs:14:10:
+    No instance for (S Int)
+      arising from the superclasses of an instance declaration
+    Possible fix: add an instance declaration for (S Int)
+    In the instance declaration for `D Int'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail106.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail106.stderr-hugs 1
+ERROR "tcfail106.hs":11 - Cannot build superclass instance
+*** Instance            : C Int
+*** Context supplied    : ()
+*** Required superclass : S Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail107.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail107.hs 1
+-- The type sig for 'test' is illegal in H98 because of the
+-- partial application of the type sig.
+-- But with the LiberalTypeSynonyms extension enabled it
+-- should be OK because when you expand the type synonyms
+-- it's just Int->Int
+-- c.f should_compile/tc155.hs
+module ShouldFail where
+
+type Thing m = m ()
+
+type Const a b = a
+
+test :: Thing (Const Int) -> Thing (Const Int)
+test = test
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail107.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail107.stderr 1
+
+tcfail107.hs:13:1:
+    Type synonym `Const' should have 2 arguments, but has been given 1
+    In the type signature for `test':
+      test :: Thing (Const Int) -> Thing (Const Int)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail107.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail107.stderr-hugs 1
+ERROR "tcfail107.hs":13 - Not enough arguments for type synonym "Const"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail108.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail108.hs 1
+-- The instance decl is illegal without UndecidableInstances
+
+module ShouldFail where
+
+data Rec f = In (f (Rec f))
+
+instance Eq (f (Rec f)) => Eq (Rec f) where
+         (In x) == (In y) = x == y
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail108.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail108.stderr 1
+
+tcfail108.hs:7:10:
+    Non type-variable argument in the constraint: Eq (f (Rec f))
+    (Use -XFlexibleContexts to permit this)
+    In the context: (Eq (f (Rec f)))
+    While checking an instance declaration
+    In the instance declaration for `Eq (Rec f)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail108.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail108.stderr-hugs 1
+ERROR "tcfail108.hs":7 - Illegal Haskell 98 class constraint in instance declaration
+*** Constraint : Eq (a (Rec a))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail109.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail109.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
+
+-- Strangely, this program does not elicit an error message
+-- in GHC 5.03.  I don't know why. It fails correctly in
+-- 5.04
+
+
+module ShouldFail where
+
+class Eq ce => Collects e ce | ce -> e where
+    empty :: ce
+    empty = error("empty")
+
+data Stupid = Stupid -- without equality
+
+instance Collects Bool Stupid where
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail109.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail109.stderr 1
+
+tcfail109.hs:16:10:
+    No instance for (Eq Stupid)
+      arising from the superclasses of an instance declaration
+    Possible fix: add an instance declaration for (Eq Stupid)
+    In the instance declaration for `Collects Bool Stupid'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail109.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail109.stderr-hugs 1
+ERROR "tcfail109.hs":16 - Cannot build superclass instance
+*** Instance            : Collects Bool Stupid
+*** Context supplied    : ()
+*** Required superclass : Eq Stupid
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail110.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail110.hs 1
+{-# LANGUAGE Rank2Types #-}
+
+module ShouldCompile where
+
+data Foo a b = Foo { foo :: a -> b }
+
+-- kind error in here
+bar :: String -> (forall a . Foo a) -> IO ()
+bar s _ = putStrLn s
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail110.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail110.stderr 1
+
+tcfail110.hs:8:30:
+    Expecting one more argument to `Foo a'
+    In the type signature for `bar':
+      bar :: String -> (forall a. Foo a) -> IO ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail110.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail110.stderr-hugs 1
+ERROR "tcfail110.hs":8 - Illegal type in polymorphic type
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail111.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail111.stderr-hugs 1
+ERROR "tcfail111.hs":7 - Ambiguous type variable "a"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail112.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail112.hs 1
+-- Record construction should fail statically 
+-- if there are any strict fields,
+-- including in the non-record case.
+
+module ShouldFail where
+
+data S = S { x::Int, y:: ! Int }
+data T = T Int !Int
+data U = U Int  Int
+
+s1 = S {}	-- Bad
+s2 = S { x=3 }	-- Bad
+s3 = S { y=3 }	-- Ok
+t  = T {}	-- Bad
+u  = U {}	-- Ok
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail112.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail112.stderr 1
+
+tcfail112.hs:11:6:
+    Constructor `S' does not have the required strict field(s): y
+    In the expression: S {}
+    In an equation for `s1': s1 = S {}
+
+tcfail112.hs:12:6:
+    Constructor `S' does not have the required strict field(s): y
+    In the expression: S {x = 3}
+    In an equation for `s2': s2 = S {x = 3}
+
+tcfail112.hs:14:6:
+    Constructor `T' does not have the required strict field(s)
+    In the expression: T {}
+    In an equation for `t': t = T {}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail112.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail112.stderr-hugs 1
+ERROR "tcfail112.hs":11 - Construction does not define strict field
+Expression : S {}
+Field      : y
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail113.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail113.hs 1
+-- Tests kind error messages
+
+-- GHC 6.6 stops on the first kind error it encounters,
+-- so we only get one error report here.  I'll leave 
+-- the other tests in here, though, in case matters improve
+-- again
+
+module ShouldFail where
+
+data T k = T (k Int)
+
+f :: [Maybe]
+f x = x
+
+g :: T Int
+g x = x
+
+h :: Int Int
+h x = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail113.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail113.stderr 1
+
+tcfail113.hs:12:7:
+    Expecting one more argument to `Maybe'
+    In the type signature for `f': f :: [Maybe]
+
+tcfail113.hs:15:8:
+    Kind mis-match
+    The first argument of `T' should have kind `* -> *',
+    but `Int' has kind `*'
+    In the type signature for `g': g :: T Int
+
+tcfail113.hs:18:6:
+    `Int' is applied to too many type arguments
+    In the type signature for `h': h :: Int Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail113.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail113.stderr-hugs 1
+ERROR "tcfail113.hs":7 - Illegal type "[Maybe]" in constructor application
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail114.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail114.hs 1
+-- Killed GHC 5.04.2
+
+module ShouldFail where
+
+class Foo a where
+  foo :: a -> ()
+
+data Bar = Bar { bar :: () }
+
+test :: Bar
+test = undefined { foo = () }
+	-- The point is that foo is a class method,
+	-- but not a record selector
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail114.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail114.stderr 1
+
+tcfail114.hs:11:20:
+    `foo' is not a record selector
+    In the expression: undefined {foo = ()}
+    In an equation for `test': test = undefined {foo = ()}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail114.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail114.stderr-hugs 1
+ERROR "tcfail114.hs":11 - "foo" is not a selector function/field name
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail115.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail115.hs 1
+{-# LANGUAGE UnboxedTuples #-}
+
+-- Unboxed tuples; c.f. tcfail120, tc209
+
+module ShouldFail where
+
+type T a = Int -> (# Int, Int #)
+
+g t =  case t of r -> (r :: (# Int, Int #)) 
+
+f :: T a -> T a
+f t = \x -> case t x of r -> r
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail115.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail115.stderr 1
+
+tcfail115.hs:9:24:
+    Couldn't match kind `ArgKind' against `(#)'
+    Kind incompatibility when matching types:
+      t0 :: ArgKind
+      (# Int, Int #) :: (#)
+    In the expression: (r :: (# Int, Int #))
+    In a case alternative: r -> (r :: (# Int, Int #))
+
+tcfail115.hs:12:25:
+    The variable `r' cannot have an unboxed tuple type: (# Int, Int #)
+    In a case alternative: r -> r
+    In the expression: case t x of { r -> r }
+    In the expression: \ x -> case t x of { r -> r }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail116.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail116.hs 1
+module ShouldFail where
+
+-- in Haskell 98, methods must mention the class variable
+-- (SourceForge bug #756454).
+class Foo a where
+    bug :: ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail116.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail116.stderr 1
+
+tcfail116.hs:5:1:
+    The class method `bug'
+    mentions none of the type variables of the class Foo a
+    When checking the class method: bug :: ()
+    In the class declaration for `Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail116.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail116.stderr-hugs 1
+ERROR "tcfail116.hs":6 - Ambiguous type signature in class declaration
+*** ambiguous type : Foo a => ()
+*** assigned to    : bug
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail117.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail117.hs 1
+module ShouldFail where
+
+-- Without any extensions enabled both of these should fail
+
+newtype N1 = N1 Int deriving ( Enum )
+data    N2 = N2 Int deriving ( Enum )
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail117.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail117.stderr 1
+
+tcfail117.hs:5:32:
+    Can't make a derived instance of `Enum N1':
+      `N1' must be an enumeration type
+      (an enumeration consists of one or more nullary, non-GADT constructors)
+      Try -XGeneralizedNewtypeDeriving for GHC's newtype-deriving extension
+    In the newtype declaration for `N1'
+
+tcfail117.hs:6:32:
+    Can't make a derived instance of `Enum N2':
+      `N2' must be an enumeration type
+      (an enumeration consists of one or more nullary, non-GADT constructors)
+    In the data type declaration for `N2'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail117.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail117.stderr-hugs 1
+ERROR "tcfail117.hs":5 - Can only derive instances of Enum for enumeration types
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail118.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail118.hs 1
+-- Gave a bad error message in a version of 6.3, as a 
+-- result of 6.3's new duplicate-instance reporting structure
+--
+--	Foo.hs:4:5:
+--	    No instance for `Eq Foo'
+--	    When deriving the `Eq' instance for type `Bar'
+
+module ShouldFail where
+
+data Bar = Bar Foo deriving Eq
+data Foo = Foo deriving Eq
+
+instance Eq Foo where
+    Foo == Foo = True
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail118.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail118.stderr 1
+
+tcfail118.hs:10:29:
+    Overlapping instances for Eq Foo
+      arising from the 'deriving' clause of a data type declaration
+    Matching instances:
+      instance Eq Foo -- Defined at tcfail118.hs:11:25
+      instance Eq Foo -- Defined at tcfail118.hs:13:10
+    When deriving the instance for (Eq Bar)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail118.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail118.stderr-hugs 1
+ERROR "tcfail118.hs":11 - Overlapping instances for class "Eq"
+*** This instance   : Eq Foo
+*** Overlaps with   : Eq Foo
+*** Common instance : Eq Foo
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail119.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail119.hs 1
+-- Gave a nasty
+--	tcLookupGlobal: `FunnyError.$dmb' is not in scope
+-- failure in GHC 6.2, because the type-checking of
+-- the default method didn't recover.
+
+module ShouldFail where
+
+class A x where
+   a :: x -> ()
+   b :: x -> Bool -> ()
+   b x "Foo" = () -- deliberate type error
+
+instance A Int where
+   a _ = ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail119.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail119.stderr 1
+
+tcfail119.hs:11:8:
+    Couldn't match expected type `Bool' with actual type `[Char]'
+    In the pattern: "Foo"
+    In an equation for `b': b x "Foo" = ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail119.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail119.stderr-hugs 1
+ERROR "tcfail119.hs":11 - Type error in default member binding
+*** Term           : "Foo"
+*** Type           : String
+*** Does not match : Bool
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail120.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail120.hs 1
+
+{-# LANGUAGE UnboxedTuples #-}
+
+-- Could be ok, because nothing is bound to the unboxed tuple
+-- but actually rejected, because a wild card is rather like
+-- an unused variable.  Could fix this, but it's really a corner case
+
+module ShouldFail where
+
+type T a = Int -> (# Int, Int #)
+
+f2 :: T a -> T a
+f2 t = \x -> case t x of _ -> (# 3,4 #)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail120.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail120.stderr 1
+
+tcfail120.hs:13:26:
+    A wild-card pattern cannot have an unboxed tuple type:
+      (# Int, Int #)
+    In the pattern: _
+    In a case alternative: _ -> (# 3, 4 #)
+    In the expression: case t x of { _ -> (# 3, 4 #) }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail121.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail121.hs 1
+
+{-# LANGUAGE OverlappingInstances, FlexibleInstances #-}
+
+module ShouldFail where
+
+class Foo a where
+  op :: a -> a
+
+instance Foo a => Foo [a] 
+instance Foo [Int]
+
+foo :: Foo a => [a] -> [a]
+foo x = op x
+-- Correct instance depends on instantiation of 'a' 
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail121.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail121.stderr 1
+
+tcfail121.hs:13:9:
+    Overlapping instances for Foo [a]
+      arising from a use of `op'
+    Matching instances:
+      instance [overlap ok] Foo a => Foo [a]
+        -- Defined at tcfail121.hs:9:10
+      instance [overlap ok] Foo [Int] -- Defined at tcfail121.hs:10:10
+    (The choice depends on the instantiation of `a'
+     To pick the first instance above, use -XIncoherentInstances
+     when compiling the other instance declarations)
+    In the expression: op x
+    In an equation for `foo': foo x = op x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail122.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail122.hs 1
+{-# LANGUAGE Rank2Types, KindSignatures #-}
+
+module ShouldFail where
+
+-- There should be a kind error, when unifying (a b) against (c d)
+
+foo = [ undefined :: forall a b. a b,
+	undefined :: forall (c:: (* -> *) -> *) (d :: * -> *). c d ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail122.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail122.stderr 1
+
+tcfail122.hs:8:9:
+    Couldn't match kind `* -> *' against `*'
+    Kind incompatibility when matching types:
+      c0 :: (* -> *) -> *
+      a0 :: * -> *
+    In the expression:
+        undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d
+    In the expression:
+      [undefined :: forall a b. a b,
+       undefined :: forall (c :: (* -> *) -> *) (d :: * -> *). c d]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail123.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail123.hs 1
+{-# LANGUAGE MagicHash #-}
+
+module ShouldFail where
+
+-- The danger here is getting a type like
+--	f :: forall (a::??). a -> Bool
+-- and hence allowing the bogus calls that follow
+
+f x = True
+
+h v = (f 3#, f 4.3#, f True)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail123.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail123.stderr 1
+
+tcfail123.hs:11:10:
+    Couldn't match kind `*' against `#'
+    Kind incompatibility when matching types:
+      t0 :: *
+      GHC.Prim.Int# :: #
+    In the first argument of `f', namely `3#'
+    In the expression: f 3#
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail124.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail124.hs 1
+{-# LANGUAGE RankNTypes #-}
+
+module ShouldFail where
+
+-- With the new typechecker (GHC 7.1), these now all pass
+
+f1 :: (forall a. Eq a => [a]) -> Bool
+f1 xs@(x:_)  = x
+
+f2 :: (forall a. Eq a => [a]) -> Bool
+f2 [x] = x
+
+f3 :: (forall a. Eq a => [a]) -> Bool
+f3 (x:[]) = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail124.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail125.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail125.hs 1
+{-# LANGUAGE DatatypeContexts, ExistentialQuantification #-}
+
+-- Tests the "stupid theta" in pattern-matching
+-- when there's an existential as well
+
+module ShouldCompile  where
+
+data (Show a) => Obs a = forall b. LiftObs a b
+
+f :: Obs a -> String	-- Needs a (Show a) context
+f (LiftObs _ _) = "yes"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail125.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail125.stderr 1
+
+tcfail125.hs:1:14:
+    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail125.hs:11:4:
+    No instance for (Show a)
+      arising from a use of `LiftObs'
+    In the pattern: LiftObs _ _
+    In an equation for `f': f (LiftObs _ _) = "yes"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail125.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail125.stderr-hugs 1
+ERROR "tcfail125.hs":11 - Cannot justify constraints in explicitly typed binding
+*** Expression    : f
+*** Type          : Obs a -> String
+*** Given context : ()
+*** Constraints   : Show a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail126.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail126.hs 1
+{-# LANGUAGE RankNTypes, ExistentialQuantification #-}
+
+-- An interesting interaction of universals and existentials, prompted by 
+-- http://www.haskell.org/pipermail/haskell-cafe/2004-October/007160.html
+--
+-- Note the nested pattern-match in runProg; tc183 checks the
+-- non-nested version
+
+-- 3 Sept 2010: with the new typechecker, this one succeeds
+
+module Foo  where
+
+import Control.Monad.Trans
+
+data Bar m 
+  = forall t. (MonadTrans t, Monad (t m)) 
+	   => Bar (t m () -> m ()) (t m Int)
+
+data Foo = Foo (forall m. Monad m => Bar m)
+
+runProg :: Foo -> IO ()
+runProg (Foo (Bar run op)) = run (prog op)
+-- This nested match "ought" to work; because
+--    runProg (Foo b) = case b of
+--			    Bar run op -> run (prog op)
+-- does work. But the interactions with GADTs and
+-- desugaring defeated me, and I removed (in GHC 6.4) the ability
+-- to instantiate functions on the left
+
+prog :: (MonadTrans t, Monad (t IO)) => a -> t IO ()
+prog x = error "urk"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail126.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail127.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail127.hs 1
+module ShouldFail where
+
+foo :: IO (Num a => a -> a)
+foo = error "urk"
+
+-- baz :: (Num a => a -> a) -> Int
+-- baz = error "urk"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail127.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail127.stderr 1
+
+tcfail127.hs:3:1:
+    Illegal polymorphic or qualified type: Num a => a -> a
+    Perhaps you intended to use -XImpredicativeTypes
+    In the type signature for `foo': foo :: IO (Num a => a -> a)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail128.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail128.hs 1
+
+
+-- Ambiguity error reporting
+
+module Main where
+
+import Data.Array.MArray (thaw,freeze)
+import Data.Array.Unboxed as UA (UArray,listArray)
+import Data.Array.IArray as IA (Array,listArray)
+
+main :: IO ()
+main = do let sL = [1,4,6,3,2,5]
+	      dim = length sL
+	      help :: [FlatVector]
+	      help = [listFlatVector (1,s) [0|i<-[1..s]]|s<-sL]   
+	      tmp :: Vector FlatVector 
+	      tmp = listVector (1,dim) help
+	  v <- thaw tmp
+	  return ()
+
+type FlatVector  = UArray Int Double
+
+listFlatVector :: (Int,Int) -> [Double] -> FlatVector
+listFlatVector = UA.listArray
+
+type Vector a = Array Int a
+
+listVector :: (Int,Int) -> [a] -> Vector a
+listVector = IA.listArray
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail128.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail128.stderr 1
+
+tcfail128.hs:18:16:
+    No instance for (Data.Array.Base.MArray b0 FlatVector IO)
+      arising from a use of `thaw'
+    Possible fix:
+      add an instance declaration for
+      (Data.Array.Base.MArray b0 FlatVector IO)
+    In a stmt of a 'do' block: v <- thaw tmp
+    In the expression:
+      do { let sL = ...
+               dim = length sL
+               ....;
+           v <- thaw tmp;
+           return () }
+    In an equation for `main':
+        main
+          = do { let sL = ...
+                     ....;
+                 v <- thaw tmp;
+                 return () }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail128.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail128.stderr-hugs 1
+ERROR "tcfail128.hs":12 - Cannot justify constraints in explicitly typed binding
+*** Expression    : main
+*** Type          : IO ()
+*** Given context : ()
+*** Constraints   : MArray a (UArray Int Double) IO
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail129.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail129.hs 1
+-- Both blocks are illegal Haskell 98, because of the un-saturated
+-- type synonym, but (rather obscurely) at one point (GHC 6.3), we
+-- acceped 'blah', but rejected 'blah1'
+
+module ShouldFail where
+
+data T = T
+
+-- This was erroneously accepted
+type Foo a = String -> Maybe a
+type Bar m = m Int
+blah = undefined :: Bar Foo
+
+
+type Foo1 a = Maybe a
+type Bar1 m = m Int
+blah1 = undefined :: Bar1 Foo1
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail129.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail129.stderr 1
+
+tcfail129.hs:12:8:
+    Type synonym `Foo' should have 1 argument, but has been given none
+    In an expression type signature: Bar Foo
+    In the expression: undefined :: Bar Foo
+    In an equation for `blah': blah = undefined :: Bar Foo
+
+tcfail129.hs:17:9:
+    Type synonym `Foo1' should have 1 argument, but has been given none
+    In an expression type signature: Bar1 Foo1
+    In the expression: undefined :: Bar1 Foo1
+    In an equation for `blah1': blah1 = undefined :: Bar1 Foo1
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail129.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail129.stderr-hugs 1
+ERROR "tcfail129.hs":12 - Not enough arguments for type synonym "Foo"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail130.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail130.hs 1
+{-# LANGUAGE ImplicitParams #-}
+
+-- The defn of foo should be rejected; it's monomorphic, but
+-- the implicit paramter escapes
+
+module Foo where
+
+baz = let ?x = 5 in print foo
+
+foo = woggle 3
+
+woggle :: (?x :: Int) => Int -> Int
+woggle y = ?x + y
+
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail130.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail130.stderr 1
+
+tcfail130.hs:10:7:
+    Unbound implicit parameter (?x::Int)
+      arising from a use of `woggle'
+    In the expression: woggle 3
+    In an equation for `foo': foo = woggle 3
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail130.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail130.stderr-hugs 1
+ERROR "tcfail130.hs":10 - Unresolved top-level overloading
+*** Binding             : foo
+*** Outstanding context : (?x :: Int)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail131.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail131.hs 1
+-- Error message in monomorphic case
+
+module ShouldFail where
+
+  f = (*)	-- Monomorphic
+  g :: Num b => b -> b
+  g x = f x x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail131.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail131.stderr 1
+
+tcfail131.hs:7:9:
+    Could not deduce (b ~ Integer)
+    from the context (Num b)
+      bound by the type signature for g :: Num b => b -> b
+      at tcfail131.hs:7:3-13
+      `b' is a rigid type variable bound by
+          the type signature for g :: Num b => b -> b at tcfail131.hs:7:3
+    In the return type of a call of `f'
+    In the expression: f x x
+    In an equation for `g': g x = f x x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail132.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail132.hs 1
+-- Fails with a kind error.
+-- The current error message was rather horrible (trac bug #312):
+--
+--    Kind error: Expecting kind `k_a1JA -> k_a1JE -> k_a1JI -> *',
+--	          but `DUnit t' has kind `k_a1JA -> k_a1JE -> *'
+--
+-- as we couldn't tidy kinds, becuase they didn't have OccNames.
+-- This test recalls the bad error message.
+
+module ShouldFail where
+
+newtype Object f' f t o1 o2  = Object (f' t o1 -> f t o2)
+type DUnit t o1 o2       = ()
+
+type T f g t o1 o2  = Either (f t o1 o2) (g t o1 o2)
+
+type LiftObject t f' f         = T (Object f' f t) (DUnit t)
+ 
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail132.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail132.stderr 1
+
+tcfail132.hs:17:37:
+    Kind mis-match
+    The first argument of `T' should have kind `* -> * -> * -> *',
+    but `Object f' f t' has kind `* -> * -> *'
+    In the type `T (Object f' f t) (DUnit t)'
+    In the type synonym declaration for `LiftObject'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail132.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail132.stderr-hugs 1
+ERROR "tcfail132.hs":21 - Not enough arguments for type synonym "T"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail133.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail133.hs 1
+{-# LANGUAGE UndecidableInstances, FlexibleInstances, TypeOperators,
+             MultiParamTypeClasses, FunctionalDependencies, DatatypeContexts #-}
+
+-- This one crashed GHC 6.3 due to an error in TcSimplify.add_ors
+
+module Foo where
+
+data Zero   = Zero deriving Show
+data One    = One deriving Show
+infixl 9 :@
+data (Number a, Digit b) => a :@ b = a :@ b deriving Show
+
+class Digit a
+instance Digit Zero
+instance Digit One
+
+class Number a
+instance Number Zero
+instance Number One
+instance (Number a, Digit b) => Number (a :@ b)
+
+--- Pretty printing of numbers ---
+class PrettyNum a where
+    prettyNum   :: a -> String
+
+instance PrettyNum Zero where
+    prettyNum _ = "0"
+
+instance PrettyNum One where
+    prettyNum _ = "1"
+
+instance (Number a, Digit b, PrettyNum a, PrettyNum b)
+      => PrettyNum (a :@ b) where
+    prettyNum ~(a:@b)
+                = prettyNum a ++ prettyNum b
+
+--- Digit addition ---
+class (Number a, Digit b, Number c)
+   => AddDigit a b c | a b -> c where
+    addDigit    :: a -> b -> c
+    addDigit    = undefined
+
+instance Number a => AddDigit a Zero a
+instance AddDigit Zero One One
+instance AddDigit One One (One:@Zero)
+instance Number a => AddDigit (a:@Zero) One (a:@One)
+instance AddDigit a One a'
+      => AddDigit (a:@One) One (a':@Zero)
+
+--- Addition ---
+class (Number a, Number b, Number c)
+   => Add a b c | a b -> c where
+    add     :: a -> b -> c
+    add     = undefined
+
+instance Number n => Add n Zero n
+instance Add Zero One One
+instance Add One One (One:@One)
+instance Number n
+      => Add (n:@Zero) One (n:@One)
+instance AddDigit n One r'
+      => Add (n:@One) One (r':@Zero)
+instance (Number n1, Digit d1, Number n2, Digit n2
+         ,Add n1 n2 nr', AddDigit (d1:@nr') d2 r)
+      => Add (n1:@d1) (n2:@d2) r
+
+
+foo = show $ add (One:@Zero) (One:@One)
+
+
+-- Add (One:@Zero) (One:@One) c, Show c
+-- ==> Number One, Digit Zero, Number One, Digit One
+--     Add One One nr', AddDigit (Zero:@nr') One c, Show c
+--
+-- ==> Add One One nr', AddDigit (Zero:@nr') One c, Show c
+-- 
+-- ==> Add One One (One:@One), AddDigit (Zero:@(One:@One)) One c, Show c
+--
+-- ==> AddDigit (Zero:@(One:@One)) One c, Show c
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail133.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail133.stderr 1
+
+tcfail133.hs:2:61:
+    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail133.hs:68:14:
+    No instance for (AddDigit (Zero :@ (One :@ One)) One a0)
+      arising from a use of `add'
+    Possible fix:
+      add an instance declaration for
+      (AddDigit (Zero :@ (One :@ One)) One a0)
+    In the second argument of `($)', namely
+      `add (One :@ Zero) (One :@ One)'
+    In the expression: show $ add (One :@ Zero) (One :@ One)
+    In an equation for `foo':
+        foo = show $ add (One :@ Zero) (One :@ One)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.hs 1
+-- Class used as a type, recursively
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.hs 3
+module ShouldFail where
+
+class XML a where toXML :: a -> XML
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.stderr 1
+
+tcfail134.hs:5:33:
+    Expecting one more argument to `XML'
+    In the type `a -> XML'
+    In the class declaration for `XML'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail134.stderr-hugs 1
+ERROR "tcfail134.hs":5 - Undefined type constructor "XML"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail135.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail135.hs 1
+-- A missing kind check made GHC 6.4 crash on this one
+
+module ShoudlFail where
+
+class Foo f where
+	baa :: f a -> f
+
+instance Foo Maybe where
+	baa z = z
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail135.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail135.stderr 1
+
+tcfail135.hs:6:23:
+    Expecting one more argument to `f'
+    In the type `f a -> f'
+    In the class declaration for `Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail135.stderr-hugs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail135.stderr-hugs 1
+ERROR "tcfail135.hs":6 - Illegal type "a b" in constructor application
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail136.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail136.hs 1
+-- Kind error message test
+
+module ShouldFail where
+
+type IntMap a = [a]
+ 
+data SymDict a = SymDict {idcounter:: Int, itot::IntMap a}
+
+data SymTable = SymTable {  dict::SymDict   }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail136.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail136.stderr 1
+
+tcfail136.hs:9:35:
+    Expecting one more argument to `SymDict'
+    In the type `SymDict'
+    In the definition of data constructor `SymTable'
+    In the data type declaration for `SymTable'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail137.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail137.hs 1
+{-# LANGUAGE DatatypeContexts #-}
+-- Test the stupid context on newtypes
+-- (GHC 6.4 dropped it on the floor by mistake)
+module ShouldFail where
+
+newtype Floating a => Test a = Test [a] 
+
+x = Test [False, True]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail137.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail137.stderr 1
+
+tcfail137.hs:1:14:
+    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail137.hs:8:5:
+    No instance for (Floating Bool)
+      arising from a use of `Test'
+    Possible fix: add an instance declaration for (Floating Bool)
+    In the expression: Test [False, True]
+    In an equation for `x': x = Test [False, True]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail138.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail138.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+             FlexibleInstances, UndecidableInstances #-}
+-- UndecidableInstances because (L a b) is no smaller than (C a b)
+
+-- This one shows up another rather subtle functional-dependecy
+-- case.  The error is:
+--
+--    Could not deduce (C a b') from the context (C a b)
+--      arising from the superclasses of an instance declaration at Foo.hs:8:0
+--    Probable fix: add (C a b') to the instance declaration superclass context
+--    In the instance declaration for `C (Maybe a) a'
+--
+-- Since L is a superclass of the (sought) constraint (C a b'), you might
+-- think that we'd generate the superclasses (L a b') and (L a b), and now 
+-- the fundep will force b=b'.  But GHC is very cautious about generating
+-- superclasses when doing context reduction for instance declarations,
+-- becasue of the danger of superclass loops.
+--
+-- So, today, this program fails.  It's trivial to fix by adding a fundep for C
+-- 	class (G a, L a b) => C a b | a -> b
+
+-- Note: Sept 08: when fixing Trac #1470, tc138 started working! 
+-- This test is a very strange one (fundeps, undecidable instances), 
+-- so I'm just marking it as "should-succeed".  It's not very clear to
+-- me what the "right" answer should be; when we have the type equality
+-- story more worked out we might want to think about that.
+
+module ShouldFail where
+
+class G a
+class L a b | a -> b
+class (G a, L a b) => C a b
+
+instance C a b' => G (Maybe a)
+instance C a b  => C (Maybe a) a
+instance L (Maybe a) a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail138.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail139.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail139.hs 1
+-- Should be rejected by Haskell 98
+
+module Foo  where 
+
+type Foo = Double
+instance Bounded Foo
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail139.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail139.stderr 1
+
+tcfail139.hs:6:10:
+    Illegal instance declaration for `Bounded Foo'
+        (All instance types must be of the form (T t1 ... tn)
+         where T is not a synonym.
+         Use -XTypeSynonymInstances if you want to disable this.)
+    In the instance declaration for `Bounded Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail140.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail140.hs 1
+-- GHC 6.4 gave pretty horrible error messages 
+-- for some of these examples
+-- c.f. SourceForge [ ghc-Bugs-1231273 ] confusing error
+
+module ShouldFail where
+
+f :: Int -> Int
+f x = x
+
+bar = f 3 9
+
+rot xs = 3 `f` 4
+
+bot xs = map (3 `f`) xs
+
+t = ((\Just x -> x) :: Maybe a -> a) (Just 1)
+
+g :: Int -> Int
+g x y = True
+  
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail140.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail140.stderr 1
+
+tcfail140.hs:10:7:
+    The function `f' is applied to two arguments,
+    but its type `Int -> Int' has only one
+    In the expression: f 3 9
+    In an equation for `bar': bar = f 3 9
+
+tcfail140.hs:12:10:
+    The operator `f' takes two arguments,
+    but its type `Int -> Int' has only one
+    In the expression: 3 `f` 4
+    In an equation for `rot': rot xs = 3 `f` 4
+
+tcfail140.hs:14:15:
+    The operator `f' takes two arguments,
+    but its type `Int -> Int' has only one
+    In the first argument of `map', namely `(3 `f`)'
+    In the expression: map (3 `f`) xs
+    In an equation for `bot': bot xs = map (3 `f`) xs
+
+tcfail140.hs:16:8:
+    Constructor `Just' should have 1 argument, but has been given none
+    In the pattern: Just
+    In the expression: (\ Just x -> x) :: Maybe a -> a
+    In the expression: ((\ Just x -> x) :: Maybe a -> a) (Just 1)
+
+tcfail140.hs:19:1:
+    The equation(s) for `g' have two arguments,
+    but its type `Int -> Int' has only one
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail141.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail141.hs 1
+{-# LANGUAGE MagicHash, UnboxedTuples #-}
+
+-- Should fail, because f :: (# Int#, ByteArray# #)
+
+module ShouldFail where
+
+import GHC.Prim (Int#, ByteArray#)
+
+main :: IO ()
+main = let f = int2Integer# 0# in putStrLn ""
+
+
+int2Integer# :: Int# -> (# Int#, ByteArray# #)
+int2Integer# = undefined
+-- This function doesn't have to work!
+-- We just need it for its type.
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail141.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail141.stderr 1
+
+tcfail141.hs:10:12:
+    The variable `f' cannot have an unboxed tuple type:
+      (# Int#, ByteArray# #)
+    In the expression: let f = int2Integer# 0# in putStrLn ""
+    In an equation for `main':
+        main = let f = int2Integer# 0# in putStrLn ""
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail142.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail142.hs 1
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+-- Tests top-level ambiguity resolution
+-- This made a post-6.4 GHC fall over in TcSimplify
+
+module ShouldFail where 
+
+class Foo a
+instance Foo (a -> b)
+
+foo :: Foo a => a -> ()
+foo = undefined
+
+class Bar a r
+-- The same happens if we use fundeps:
+-- class Bar a r | r -> a
+
+bar :: Bar a r => r -> ()
+bar = undefined
+
+test = foo bar
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail142.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail142.stderr 1
+
+tcfail142.hs:21:12:
+    Ambiguous type variables `a0', `r0' in the constraint:
+      (Bar a0 r0) arising from a use of `bar'
+    Probable fix: add a type signature that fixes these type variable(s)
+    In the first argument of `foo', namely `bar'
+    In the expression: foo bar
+    In an equation for `test': test = foo bar
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail143.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail143.hs 1
+{-# LANGUAGE UndecidableInstances, FlexibleInstances,
+             MultiParamTypeClasses, FunctionalDependencies #-}
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail143.hs 4
+module Foo  where 
+
+data Z		= Z
+data S a	= S a
+
+class MinMax a b c d | a b -> c d, a c d -> b, b c d -> a
+instance MinMax Z Z Z Z -- (a)
+instance MinMax a Z Z a -- (b)   -- L1: wrongly flagged as error src.
+instance MinMax Z b Z b -- (c)
+instance MinMax a b c d => MinMax (S a) (S b) (S c) (S d)
+                        -- (d)
+
+class Extend a b  where extend :: a -> b ->  b
+instance Extend Z b where  Z `extend` b = b
+instance MinMax a b _c b  => Extend a b where 
+	_a `extend` b = b
+
+t	:: MinMax a b _c d => a -> b -> d
+t _ _	= (undefined :: d)
+
+n0	= Z
+n1	= S n0
+
+t1 = n1 `t` n0	    -- L2
+
+t2 = n1 `extend` n0 -- L3: uncommenting just this line produces
+		    --	   an error message pointing at L1 and L2
+		    --	   with no mention of the real culprit, L3.
+
+-- t1	:: S Z	    -- L4: uncommenting this and L3 produces an
+		    --	error message rightly pointing at L2 and L3.
+
+
+{-  n0 :: Z;  n1 :: S Z
+
+Call of extend gives wanted: Extend (S Z) Z
+Use instance =>  MinMax (S Z) Z gamma Z
+FD on (b) => gamma ~ Z, Z ~ S Z
+             =>  MinMax (S Z) Z Z Z
+FD on (a), 3rd fundep => Z ~ S Z
+      (b) again (sadly)   Z ~ S Z
+
+-}
+{-
+
+Here's what is happening.
+
+Lacking the type signature t1 :: S Z, we get
+
+  n0 :: Z
+  n1 :: S v1
+  t1 :: d1 	with constraint	([L2] MinMax (S v1) Z c1 d1)
+  t2 :: Z	with constraint ([L3] Extend (S v1) Z)
+
+     [L2] MinMax (S v1) Z c1 d1, [L3] Extend (S v1) Z
+---> 	<by instance for Extend a b>
+     [L2] MinMax (S v1) Z c1 d1, [L3] MinMax (S v1) Z c2 Z}
+--->	<combining these two constraints using (a b -> c d)
+     [L2] MinMax (S v1) Z c1 Z, [L3] MinMax (S v1) Z c1 Z}
+
+Now there are the two constraints are indistinguishable,
+and both give rise to the same error:
+
+--->	<combining first with [L1] instance MinMax a Z Z a>
+     c1=Z, Z=S v1	ERROR
+
+In either case, the error points to L1.
+
+
+A different sequence leads to a different error:
+
+     [L2] MinMax (S v1) Z c1 d1, [L3] Extend (S v1) Z
+---> 	<by instance for Extend a b>
+     [L2] MinMax (S v1) Z c1 d1, [L3] MinMax (S v1) Z c2 Z}
+--->	<combining first with [L1] instance MinMax a Z Z a>
+     [L2] MinMax (S v1) Z Z (S2 v1), [L3] MinMax (S v1) Z c2 Z}
+
+Now combining the two constraints gives rise to the error, but
+this time pointing to L2,L3.
+
+I can't explain exactly why adding the type signature for t1
+changes the order.
+
+
+Hmm.  Perhaps a good improvement strategy would be: 
+  - first do improvement against the instance declartions
+  - and only then do pairwise improvement between constraints
+
+I've implemented that, and indeed it improves the result. 
+Instead of:
+
+  Foo.hs:1:0:
+    Couldn't match `S Z' against `Z'
+      Expected type: S Z
+      Inferred type: Z
+    When using functional dependencies to combine
+      MinMax a Z Z a, arising from the instance declaration at Foo.hs:10:0
+      MinMax (S Z) Z _c d, arising from use of `t' at Foo.hs:25:8-10
+
+we get
+
+  Foo.hs:1:0:
+    Couldn't match `S Z' against `Z'
+      Expected type: S Z
+      Inferred type: Z
+    When using functional dependencies to combine
+      MinMax a Z Z a, arising from the instance declaration at Foo.hs:10:0
+      MinMax (S Z) Z _c Z, arising from use of `extend' at Foo.hs:27:8-15
+
+
+And this error in t2 is perfectly correct.  You get it even if you comment
+out the entire definition of t1.
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail143.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail143.stderr 1
+
+tcfail143.hs:29:9:
+    Couldn't match type `S Z' with `Z'
+    When using functional dependencies to combine
+      MinMax a Z Z a,
+        arising from the dependency `a b -> c d'
+        in the instance declaration at tcfail143.hs:11:10
+      MinMax (S Z) Z Z Z,
+        arising from a use of `extend' at tcfail143.hs:29:9-16
+    In the expression: n1 `extend` n0
+    In an equation for `t2': t2 = n1 `extend` n0
+
+tcfail143.hs:29:9:
+    Couldn't match type `Z' with `S Z'
+    When using functional dependencies to combine
+      MinMax Z Z Z Z,
+        arising from the dependency `b c d -> a'
+        in the instance declaration at tcfail143.hs:10:10
+      MinMax (S Z) Z Z Z,
+        arising from a use of `extend' at tcfail143.hs:29:9-16
+    In the expression: n1 `extend` n0
+    In an equation for `t2': t2 = n1 `extend` n0
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail144.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail144.hs 1
+-- Both sets should fail in Haskell98
+
+{-# LANGUAGE Haskell98 #-}
+
+module ShouldCompile where
+
+  f1 :: Eq a => a -> Bool
+  f1 x = (x == x) || g1 True || g1 "Yes"
+  
+  g1 :: Ord a => a -> Bool
+  g1 y = (y <= y) || f1 True
+
+---------
+
+  f2 :: Eq a => a -> Bool
+  f2 x = (x == x) || g2 True || g2 "Yes"
+  
+  g2 y = (y <= y) || f2 True
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail144.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail145.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail145.hs 1
+{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
+
+-- This fails, because the type in the pattern doesn't exactly match
+-- the context type.  We don't do subsumption in patterns any more.
+
+-- GHC 7.0: now we do again
+
+module Foo where
+
+foo :: (forall c. c -> c) -> [Char]
+foo (f :: forall a. [a] -> [a]) = f undefined
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail145.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail146.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail146.hs 1
+module Foo1 where
+
+-- Variant: class used as data
+class SClass a where
+ sFun :: a -> SData a
+ 
+data SData a = SCon (SClass a)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail146.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail146.stderr 1
+
+tcfail146.hs:7:22:
+    Predicate `SClass a' used as a type
+    In the type `SClass a'
+    In the definition of data constructor `SCon'
+    In the data type declaration for `SData'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail147.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail147.hs 1
+module Foo1 where
+
+-- Variant: ill-kinded. 
+class XClass a where
+ xFun :: a -> XData
+ 
+data XData = XCon XClass
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail147.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail147.stderr 1
+
+tcfail147.hs:7:19:
+    Expecting one more argument to `XClass'
+    In the type `XClass'
+    In the definition of data constructor `XCon'
+    In the data type declaration for `XData'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail148.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail148.hs 1
+-- This one caused a panic in GHC 6.4
+
+module Foo1 where
+
+data List elem = Cons elem List | Nil
+
+t1 :: List
+t1 = Cons 1 Nil
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail148.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail148.stderr 1
+
+tcfail148.hs:5:28:
+    Expecting one more argument to `List'
+    In the type `List'
+    In the definition of data constructor `Cons'
+    In the data type declaration for `List'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail149.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail149.hs 1
+module Main where
+
+class C a where
+  op :: (Show a, Show b) => a -> b -> String
+	-- This class op adds a constraint on 'a'
+
+	-- In GHC 7.0 this is fine, and it's a royal 
+	-- pain to reject it when in H98 mode, so
+	-- I'm just allowing it
+
+instance C Int where
+  op x y = show x ++ " " ++ show y
+
+main = print (op (1::Int) 2)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail149.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail149.stdout
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail149.stdout 1
+"1 2"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail150.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail150.hs 1
+module ShouldFail where
+
+-- !!! constraining the type variable in a class head is illegal
+-- Simpler version of tcfail149
+class Foo a where
+  op :: Eq a => a -> a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail150.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail151.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail151.hs 1
+{-# LANGUAGE DatatypeContexts, MultiParamTypeClasses #-}
+module ShouldFail where
+
+class (Show a, Eq a, Monad m) => Name m a where 
+    hashName :: a -> Int 
+    newName :: m a 
+ 
+data Name a => Exp a = MkExp a
+-- The kind error should be reported here
+-- GHC 6.4 reported an error with the class decl
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail151.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail151.stderr 1
+
+tcfail151.hs:1:14:
+    Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language.
+
+tcfail151.hs:8:6:
+    Expecting one more argument to `Name a'
+    In the data type declaration for `Exp'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail152.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail152.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- This test made Hugs fail (Oct 05) because the constraint
+-- from the 'toInteger' call escaped from the pattern match
+
+module ShouldFail where
+
+data T = forall a. C a
+
+test (C x) = toInteger x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail152.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail152.stderr 1
+
+tcfail152.hs:10:14:
+    No instance for (Integral a)
+      arising from a use of `toInteger'
+    In the expression: toInteger x
+    In an equation for `test': test (C x) = toInteger x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail153.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail153.hs 1
+-- Killed a test compiler, so I thought it was worth including
+
+module ShouldFail where
+
+f :: a -> [a]
+f x = g x
+    where
+      g y = if y  then [] else [y]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail153.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail153.stderr 1
+
+tcfail153.hs:6:9:
+    Couldn't match type `a' with `Bool'
+      `a' is a rigid type variable bound by
+          the type signature for f :: a -> [a] at tcfail153.hs:6:1
+    In the first argument of `g', namely `x'
+    In the expression: g x
+    In an equation for `f':
+        f x
+          = g x
+          where
+              g y = if y then [] else [...]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail154.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail154.hs 1
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module ShouldFail where
+
+data T a = MkT
+
+class C a b where
+  op :: T a -> T b -> Bool
+
+-- Repeated type variable in an instance constraint
+-- should require UndecidableInstances
+instance C a a => Eq (T a) where
+  (==) = op
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail154.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail154.stderr 1
+
+tcfail154.hs:12:10:
+    Variable occurs more often in a constraint than in the instance head
+      in the constraint: C a a
+    (Use -XUndecidableInstances to permit this)
+    In the instance declaration for `Eq (T a)'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail155.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail155.hs 1
+{-# LANGUAGE GADTs #-}
+
+-- Data type returns the wrong type
+
+module ShouldFail where
+
+data T a where
+     P :: L1 -> L2
+
+data L1 = L1
+data L2 = L2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail155.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail155.stderr 1
+
+tcfail155.hs:8:6:
+    Data constructor `P' returns type `L2'
+      instead of an instance of its parent type `T a'
+    In the definition of data constructor `P'
+    In the data type declaration for `T'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail156.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail156.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- Illegal existential context on a newtype
+
+module ShouldFail where
+
+newtype Foo = forall a . Foo a
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail156.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail156.stderr 1
+
+tcfail156.hs:7:26:
+    A newtype constructor cannot have an existential context,
+      but `Foo' does
+    In the definition of data constructor `Foo'
+    In the newtype declaration for `Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail157.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail157.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+             FlexibleInstances #-}
+-- NB: *no* UndecidableInstances
+
+-- This one (due to Oleg) made 6.4.1 go into a loop in the typechecker,
+-- despite the lack of UndecidableInstances
+--
+-- The example corresponds to a type function (realized as a class E 
+-- with functional dependencies) in the context of an instance. 
+-- The function in question is
+--
+--	class E m a b | m a -> b
+--	instance E m (() -> ()) (m ())
+--
+-- We see that the result of the function, "m ()" is smaller (in the
+-- number of constructors) that the functions' arguments, "m" and
+-- "() -> ()" together. Plus any type variable free in the result is also
+-- free in at least one of the arguments. And yet it loops.
+module ShouldFail where
+
+class Foo m a where
+    foo :: m b -> a -> Bool
+
+instance Foo m () where
+    foo _ _ = True
+
+instance (E m a b, Foo m b) => Foo m (a->()) where
+    foo m f = undefined
+
+class E m a b | m a -> b where
+    tr :: m c -> a -> b
+
+-- There is only one instance of the class with functional dependencies
+instance E m (() -> ()) (m ()) where
+    tr x = undefined
+
+-- GHC(i) loops
+
+test = foo (\f -> (f ()) :: ()) (\f -> (f ()) :: ())
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail157.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail157.stderr 1
+
+tcfail157.hs:27:10:
+    Variable occurs more often in a constraint than in the instance head
+      in the constraint: E m a b
+    (Use -XUndecidableInstances to permit this)
+    In the instance declaration for `Foo m (a -> ())'
+
+tcfail157.hs:27:10:
+    Variable occurs more often in a constraint than in the instance head
+      in the constraint: Foo m b
+    (Use -XUndecidableInstances to permit this)
+    In the instance declaration for `Foo m (a -> ())'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail158.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail158.hs 1
+{-# LANGUAGE ExplicitForAll #-}
+
+-- This one actually crashed in 6.4.1
+-- There's a kind error in the signature for bar, 
+-- and we were recovering, and then crashing when we found
+-- a scoped type variable not in scope
+
+ data Val v sm = Val
+ foo :: forall v sm. Val v sm
+ foo = undefined
+   where foo1 :: Val v sm
+         foo1 = bar
+ -- Correct type signature: bar :: forall v sm. Val v sm
+ bar :: forall v. Val v
+ bar = undefined foo
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail158.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail158.stderr 1
+
+tcfail158.hs:14:19:
+    Expecting one more argument to `Val v'
+    In the type signature for `bar': bar :: forall v. Val v
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail159.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail159.hs 1
+{-# LANGUAGE UnboxedTuples #-}
+
+module ShouldFail where
+
+h :: Int -> (# Int, Int #)
+h x = (# x,x #)
+
+foo x = case h x of 
+	  ~(# p, q #) -> p
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail159.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail159.stderr 1
+
+tcfail159.hs:9:11:
+    Couldn't match kind `*' against `(#)'
+    Kind incompatibility when matching types:
+      t0 :: *
+      (# Int, Int #) :: (#)
+    In the pattern: ~(# p, q #)
+    In a case alternative: ~(# p, q #) -> p
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail160.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail160.hs 1
+-- Kind error message
+
+module ShouldFail where
+
+data T k = T (k Int)
+
+g :: T Int
+g x = x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail160.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail160.stderr 1
+
+tcfail160.hs:7:8:
+    Kind mis-match
+    The first argument of `T' should have kind `* -> *',
+    but `Int' has kind `*'
+    In the type signature for `g':
+      g :: T Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail161.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail161.hs 1
+-- Kind error message
+
+module ShouldFail where
+
+f :: [Maybe]
+f x = x
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail161.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail161.stderr 1
+
+tcfail161.hs:5:7:
+    Expecting one more argument to `Maybe'
+    In the type signature for `f': f :: [Maybe]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail162.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail162.hs 1
+
+
+
+-- Kind error messsage should not contain bangs
+
+module ShouldFail where
+
+import Foreign.ForeignPtr
+
+data Foo = Foo {-# UNPACK #-} !(ForeignPtr)
+
+ 
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail162.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail162.stderr 1
+
+tcfail162.hs:10:33:
+    Expecting one more argument to `ForeignPtr'
+    In the type `{-# UNPACK #-} !ForeignPtr'
+    In the definition of data constructor `Foo'
+    In the data type declaration for `Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail164.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail164.hs 1
+{-# LANGUAGE MagicHash #-}
+
+-- Tests tagToEnum# hacks
+
+module ShouldFail where
+
+import GHC.Base
+
+-- Test 1: Polymorphic
+f :: a
+f = tagToEnum# 0#
+
+-- Test 2: Int value (not an Enumeration TyCon)
+class Unboxable value where
+    readUnboxable  :: Int -> value
+instance Unboxable Int where
+    readUnboxable (I# value#) =  tagToEnum# value# 
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail164.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail164.stderr 1
+
+tcfail164.hs:11:5:
+    Bad call to tagToEnum# at type a
+      Specify the type by giving a type signature
+      e.g. (tagToEnum# x) :: Bool
+    In the expression: tagToEnum# 0#
+    In an equation for `f': f = tagToEnum# 0#
+
+tcfail164.hs:17:34:
+    Bad call to tagToEnum# at type Int
+      Result type must be an enumeration type
+    In the expression: tagToEnum# value#
+    In an equation for `readUnboxable':
+        readUnboxable (I# value#) = tagToEnum# value#
+    In the instance declaration for `Unboxable Int'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail165.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail165.hs 1
+{-# OPTIONS -XImpredicativeTypes -fno-warn-deprecated-flags #-}
+
+module ShouldFail where
+
+import Control.Concurrent
+
+-- Attempt to put a polymorphic value in an MVar
+-- Fails, but the error message is worth keeping an eye on
+--
+-- Actually (Dec 06) it succeeds now
+--
+-- In GHC 7.0 it fails again! (and rightly so)
+
+foo = do var <- newEmptyMVar :: IO (MVar (forall a. Show a => a -> String))
+         putMVar var (show :: forall b. Show b => b -> String)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail165.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail165.stderr 1
+
+tcfail165.hs:15:23:
+    Couldn't match expected type `forall a. Show a => a -> String'
+                with actual type `b0 -> String'
+    In the second argument of `putMVar', namely
+      `(show :: forall b. Show b => b -> String)'
+    In a stmt of a 'do' block:
+        putMVar var (show :: forall b. Show b => b -> String)
+    In the expression:
+      do { var <- newEmptyMVar ::
+                    IO (MVar (forall a. Show a => a -> String));
+           putMVar var (show :: forall b. Show b => b -> String) }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail166.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail166.hs 1
+-- Without -XScopedTypeVariables, this should fail
+
+module ShouldFail where
+
+destroy :: (forall a. (a -> Maybe (b,a)) -> a -> c) -> [b] -> c
+destroy = error "urk"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail166.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail166.stderr 1
+
+tcfail166.hs:5:21:
+    Illegal symbol '.' in type
+    Perhaps you intended -XRankNTypes or similar flag
+    to enable explicit-forall syntax: forall <tvs>. <type>
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail167.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail167.hs 1
+{-# LANGUAGE GADTs #-}
+{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
+-- Test inspired by trac #366
+-- The C2 case is impossible due to the types
+
+module ShouldCompile where
+
+data T a where
+    C1 :: T Char
+    C2 :: T Float
+
+inaccessible :: T Char -> Char
+inaccessible C1 = ' '
+inaccessible C2 = ' '
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail167.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail167.stderr 1
+
+tcfail167.hs:14:14:
+    Couldn't match type `Char' with `Float'
+    Inaccessible code in
+      a pattern with constructor
+        C2 :: T Float,
+      in an equation for `inaccessible'
+    In the pattern: C2
+    In an equation for `inaccessible': inaccessible C2 = ' '
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail168.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail168.hs 1
+
+-- Test trac #719 (shouldn't give the entire do block in the error message)
+
+module ShouldFail where
+
+foo = do
+          putChar
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+          putChar 'a'
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail168.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail168.stderr 1
+
+tcfail168.hs:8:11:
+    Couldn't match expected type `Char -> a0' with actual type `IO ()'
+    In the return type of a call of `putChar'
+    Probable cause: `putChar' is applied to too many arguments
+    In a stmt of a 'do' block: putChar 'a'
+    In the expression:
+      do { putChar;
+           putChar 'a';
+           putChar 'a';
+           putChar 'a';
+           .... }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail169.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail169.hs 1
+
+-- Trac #958
+
+module ShoulFail where
+
+data Succ a = S a 	-- NB: deriving Show omitted
+data Seq a = Cons a (Seq (Succ a)) | Nil deriving Show
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail169.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail169.stderr 1
+
+tcfail169.hs:7:51:
+    No instance for (Show (Succ a))
+      arising from the 'deriving' clause of a data type declaration
+    Possible fix:
+      add an instance declaration for (Show (Succ a))
+      or use a standalone 'deriving instance' declaration,
+           so you can specify the instance context yourself
+    When deriving the instance for (Show (Seq a))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail170.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail170.hs 1
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
+
+module ShouldFail where
+
+class C a b | a -> b
+
+instance C [p] [q]
+	-- Coverage condition fails
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail170.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail170.stderr 1
+
+tcfail170.hs:7:10:
+    Illegal instance declaration for `C [p] [q]'
+        (the Coverage Condition fails for one of the functional dependencies;
+         Use -XUndecidableInstances to permit this)
+    In the instance declaration for `C [p] [q]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail171.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail171.hs 1
+module ShouldFail where
+
+-- This one made GHC fall over on implication constraints
+-- Silly, but one more test does no harm
+
+import Text.Printf
+
+phex :: a -> b
+phex x = printf "0x%x" x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail171.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail171.stderr 1
+
+tcfail171.hs:9:10:
+    No instances for (PrintfType b, PrintfArg a)
+      arising from a use of `printf'
+    In the expression: printf "0x%x" x
+    In an equation for `phex': phex x = printf "0x%x" x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail172.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail172.hs 1
+{-# LANGUAGE GADTs #-}
+
+-- This one made GHC 6.6 give the very unhelpful error
+-- Foo8.hs:11:10:
+--    Couldn't match kind `?' against `* -> * -> *'
+--    When matching the kinds of `t :: ?' and `t1 :: * -> * -> *'
+--      Expected type: t1
+--      Inferred type: t
+--    In the pattern: Nil
+
+module ShouldFail where
+
+data PatchSeq p a b where
+    Nil   :: PatchSeq p a a
+    U  :: p a b -> PatchSeq p a b
+    (:-)  :: PatchSeq p a b -> PatchSeq p b c -> PatchSeq p a c
+
+-- is_normal :: PatchSeq p a b -> Bool 
+is_normal Nil = True 
+is_normal (U _) = True 
+is_normal (U _ :- _) = True 
+is_normal _ = False 
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail172.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail173.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail173.hs 1
+
+
+module ShouldFail where
+
+newtype (f <.> g) a = Compose (f (g a))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail173.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail173.stderr 1
+
+tcfail173.hs:5:10:
+    Malformed head of type or class declaration: (f <.> g) a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail174.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail174.hs 1
+{-# OPTIONS -XImpredicativeTypes #-}
+
+module Foo where
+
+data Capture a = Base a
+               | Capture (Capture (forall x . x -> a))
+
+g :: Capture (forall a . a ->  a)
+g = Base id  -- Fails; need a rigid signature on 'id'
+
+-- This function should definitely be rejected, with or without type signature
+
+h1 = Capture g
+
+h2 :: Capture b
+h2 = Capture g
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail174.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail174.stderr 1
+
+tcfail174.hs:9:10:
+    Couldn't match expected type `forall a. a -> a'
+                with actual type `a0 -> a0'
+    In the first argument of `Base', namely `id'
+    In the expression: Base id
+    In an equation for `g': g = Base id
+
+tcfail174.hs:13:14:
+    Couldn't match type `a' with `a1'
+      `a' is a rigid type variable bound by
+          the inferred type of h1 :: Capture a at tcfail174.hs:13:1
+      `a1' is a rigid type variable bound by
+           the type forall a. a -> a at tcfail174.hs:13:14
+    Expected type: Capture (forall x. x -> a)
+      Actual type: Capture (forall a. a -> a)
+    In the first argument of `Capture', namely `g'
+    In the expression: Capture g
+
+tcfail174.hs:16:14:
+    Couldn't match type `a' with `b'
+      `a' is a rigid type variable bound by
+          the type forall a. a -> a at tcfail174.hs:16:14
+      `b' is a rigid type variable bound by
+          the type signature for h2 :: Capture b at tcfail174.hs:16:1
+    Expected type: Capture (forall x. x -> b)
+      Actual type: Capture (forall a. a -> a)
+    In the first argument of `Capture', namely `g'
+    In the expression: Capture g
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail175.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail175.hs 1
+
+-- Crashed GHC 6.6!
+-- Trac #1153
+ 
+module ShouldFail where
+
+eval :: Int -> String -> String ->  String
+eval 0 root actual = evalRHS 0 root actual
+
+evalRHS :: Int -> a
+evalRHS 0 root actual =  eval 0 root actual
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail175.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail175.stderr 1
+
+tcfail175.hs:11:1:
+    Couldn't match type `a' with `String -> String -> String'
+      `a' is a rigid type variable bound by
+          the type signature for evalRHS :: Int -> a at tcfail175.hs:11:1
+    The equation(s) for `evalRHS' have three arguments,
+    but its type `Int -> a' has only one
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail176.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail176.hs 1
+{-# LANGUAGE GADTs #-}
+
+-- Newtype in GADT syntax
+
+module ShouldFail where
+
+newtype Bug a where Bug :: a -> Maybe a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail176.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail176.stderr 1
+
+tcfail176.hs:7:21:
+    Data constructor `Bug' returns type `Maybe a'
+      instead of an instance of its parent type `Bug a'
+    In the definition of data constructor `Bug'
+    In the newtype declaration for `Bug'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail177.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail177.hs 1
+module ShouldFail where
+
+-- See Trac #1176
+-- This is really a pretty-printer test, not a typechecker test
+-- The more infix ops we have, the worse fsep works
+
+-- Currently the error message looks ok, however
+
+allTests :: Bool
+allTests = foo
+           [a ~?= b
+           ,"Three" ~?= "3"
+           ,"Four" ~?= "4"
+           ,"Five" ~?= "5"
+           ,"Five" ~?= "5"
+           ,"Five" ~?= "5"
+           ,"Five" ~?= "5"
+           ,"Five" ~?= "5"
+           ,"Five" ~?= "5"
+           ,"Two", "Two", "Two" 
+           ,"Two", "Two", "Two" 
+           ,"Two", "Two", "Two" 
+           ,"Two", "Two", "Two" 
+           ,"Two", "Two", "Two" 
+           ,"Two", "Two", "Two"] 
+
+a=""
+b=""
+
+(~?=) :: a -> a -> Bool
+(~?=) = error "urk" 
+
+foo :: a -> Int
+foo x = 0
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail177.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail177.stderr 1
+
+tcfail177.hs:10:12:
+    Couldn't match expected type `Bool' with actual type `Int'
+    In the return type of a call of `foo'
+    In the expression:
+      foo
+        [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", "Five" ~?= "5", ....]
+    In an equation for `allTests':
+        allTests = foo [a ~?= b, "Three" ~?= "3", "Four" ~?= "4", ....]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail178.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail178.hs 1
+-- See Trac #1221
+
+module ShouldFail where
+
+a :: Num a => (Bool -> [a]) -> [a]
+a x = x True ++ [1]
+
+y :: b -> ()
+y = const ()
+
+-- Typechecks ok
+b = a (const [2])
+
+-- This one had an uninformative error message
+c = a y
+
+-- More informative
+d = a ()
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail178.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail178.stderr 1
+
+tcfail178.hs:15:7:
+    Couldn't match expected type `[a0]' with actual type `()'
+    Expected type: Bool -> [a0]
+      Actual type: Bool -> ()
+    In the first argument of `a', namely `y'
+    In the expression: a y
+
+tcfail178.hs:18:7:
+    Couldn't match expected type `Bool -> [a0]' with actual type `()'
+    In the first argument of `a', namely `()'
+    In the expression: a ()
+    In an equation for `d': d = a ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail179.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail179.hs 1
+{-# LANGUAGE ExistentialQuantification #-}
+
+-- Exmaples from Doaitse Swierestra and Brandon Moore
+-- GHC users mailing list, April 07, title "Release plans"
+
+-- This one should fail, but Hugs passes it
+
+module ShouldFail where
+
+data T s = forall x. T (s -> (x -> s) -> (x, s, Int))
+
+run :: T s -> Int
+run ts  = case ts of
+             T g -> let (x,_, b) =  g x id
+                    in b
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail179.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail179.stderr 1
+
+tcfail179.hs:14:39:
+    Couldn't match type `x' with `s'
+      `x' is a rigid type variable bound by
+          a pattern with constructor
+            T :: forall s x. (s -> (x -> s) -> (x, s, Int)) -> T s,
+          in a case alternative
+          at tcfail179.hs:14:14
+      `s' is a rigid type variable bound by
+          the type signature for run :: T s -> Int at tcfail179.hs:13:1
+    In the first argument of `g', namely `x'
+    In the expression: g x id
+    In a pattern binding: (x, _, b) = g x id
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail180.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail180.hs 1
+
+-- Showed up a bug in bodySplitTyConApp
+
+module ShouldFail where
+
+p :: f b
+p = error "urk"
+
+g x = case p of
+        True -> ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail180.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail180.stderr 1
+
+tcfail180.hs:10:9:
+    Couldn't match expected type `f0 b0' with actual type `Bool'
+    In the pattern: True
+    In a case alternative: True -> ()
+    In the expression: case p of { True -> () }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail181.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail181.hs 1
+-- GHC 6.7 at one point said wog's type was:
+--
+--    wog :: forall t e (m :: * -> *).
+--	     (Monad GHC.Prim.Any1, Monad m) =>
+--	     t -> Something (m Bool) e
+--
+-- The stupid 'GHC.Prim.Any1' arose becuase of type ambiguity
+-- which should be reported, and wasn't.
+
+module ShouldFail where
+
+data Something d e = Something{ bar::  d, initializer::e   }
+
+foo :: (Monad m) => Something (m Bool) n
+foo = undefined
+
+wog x = foo{bar = return True}
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail181.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail181.stderr 1
+
+tcfail181.hs:17:9:
+    Ambiguous type variable `m0' in the constraint:
+      (Monad m0) 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: foo {bar = return True}
+    In an equation for `wog': wog x = foo {bar = return True}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail182.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail182.hs 1
+module Foo where
+
+import qualified Prelude
+import Prelude hiding( Maybe )
+
+data Maybe a = Foo
+
+f :: Prelude.Maybe a -> Int
+f Foo = 3
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail182.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail182.stderr 1
+
+tcfail182.hs:9:3:
+    Couldn't match expected type `Prelude.Maybe a'
+                with actual type `Maybe t0'
+    In the pattern: Foo
+    In an equation for `f': f Foo = 3
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail183.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail183.hs 1
+
+module ShouldCompile where
+
+newtype Swizzle = MkSwizzle (forall a. Ord a => [a] -> [a])
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail183.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail183.stderr 1
+
+tcfail183.hs:4:38:
+    Illegal symbol '.' in type
+    Perhaps you intended -XRankNTypes or similar flag
+    to enable explicit-forall syntax: forall <tvs>. <type>
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail184.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail184.hs 1
+
+{-# OPTIONS_GHC -XScopedTypeVariables #-}
+-- We don't actually want scoped type variables, but this flag makes the
+-- forall be recognised by the parser
+
+module ShouldCompile where
+
+newtype Swizzle = MkSwizzle (forall a. Ord a => [a] -> [a])
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail184.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail184.stderr 1
+
+tcfail184.hs:8:19:
+    Illegal polymorphic or qualified type:
+      forall a. Ord a => [a] -> [a]
+    Perhaps you intended to use -XRankNTypes or -XRank2Types
+    In the definition of data constructor `MkSwizzle'
+    In the newtype declaration for `Swizzle'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail185.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail185.hs 1
+-- See Trac #1606
+
+module ShouldFail where
+
+f :: Int -> Int -> Bool -> Bool -> Int -> Int
+f a b = \ x y -> let { y1 = y; y2 = y1; y3 = y2; y4 = y3; y5 = y4;
+		       y6 = y5; y7 = y6 } in x
+
+
+
+
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail185.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail185.stderr 1
+
+tcfail185.hs:7:46:
+    Couldn't match expected type `Int -> Int' with actual type `Bool'
+    In the expression: x
+    In the expression:
+        let
+          y1 = y
+          y2 = y1
+          y3 = y2
+          ....
+        in x
+    In the expression:
+        \ x y
+            -> let
+                 y1 = ...
+                 ....
+               in x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.hs 1
+-- Trac #1814
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.hs 3
+module ShouldFail where
+
+import Tcfail186_Help
+
+foo = f "hoo"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.stderr 1
+
+tcfail186.hs:7:9:
+    Couldn't match expected type `PhantomSyn a0'
+                with actual type `[Char]'
+    In the first argument of `f', namely `"hoo"'
+    In the expression: f "hoo"
+    In an equation for `foo': foo = f "hoo"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.stderr-ghc-7.0
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail186.stderr-ghc-7.0 1
+
+tcfail186.hs:7:9:
+    Couldn't match expected type `Int' with actual type `[Char]'
+      Expected type: PhantomSyn a0
+        Actual type: [Char]
+    In the first argument of `f', namely `"hoo"'
+    In the expression: f "hoo"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail187.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail187.hs 1
+-- Trac #1806
+
+module ShouldFail where
+
+data Foo = (:::)
+
+foo (x ::: y) = ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail187.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail187.stderr 1
+
+tcfail187.hs:7:6:
+    Constructor `:::' should have no arguments, but has been given 2
+    In the pattern: x ::: y
+    In an equation for `foo': foo (x ::: y) = ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail188.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail188.hs 1
+{-# LANGUAGE Rank2Types, KindSignatures #-}
+{-# OPTIONS_GHC -Werror #-}
+
+-- Trac #959
+
+module ShouldFail where
+
+data D (f :: (* -> *) -> * -> *) (af :: * -> *) (ax :: *) =
+  D (af (f af ax))
+
+data CList (f :: (* -> *) -> * -> *) (a :: *) =
+  RCons a (CList (D f) a)
+
+type CycleList a = forall f. CList f a
+
+chead :: CycleList a -> a
+chead ys = case ys of (RCons x xs) -> x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail188.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail189.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail189.hs 1
+-- Checks that the correct type is used checking the using clause of 
+-- the group when a by clause is present
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module ShouldFail where
+
+foo = [ length x
+      | x <- [1..10]
+      , then group by x using take 2
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail189.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail189.stderr 1
+
+tcfail189.hs:10:31:
+    Couldn't match expected type `a -> t0' with actual type `[a0]'
+    Expected type: (a -> t0) -> [a] -> [[a]]
+      Actual type: [a0] -> [a0]
+    In the return type of a call of `take'
+    Probable cause: `take' is applied to too many arguments
+    In the expression: take 2
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail190.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail190.hs 1
+
+-- Checks that the ordering constraint on the groupWith function is respected
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module ShouldFail where
+
+import GHC.Exts (groupWith)
+
+data Unorderable = Gnorf | Pinky | Brain
+
+foo = [ ()
+      | x <- [Gnorf, Brain]
+      , then group by x using groupWith
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail190.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail190.stderr 1
+
+tcfail190.hs:14:31:
+    No instance for (Ord Unorderable)
+      arising from a use of `groupWith'
+    Possible fix: add an instance declaration for (Ord Unorderable)
+    In the expression: groupWith
+    In a stmt of a list comprehension: then group by x using groupWith
+    In the expression:
+      [() | x <- [Gnorf, Brain], then group by x using groupWith]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail191.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail191.hs 1
+-- Checks that the correct type is used checking the using clause of the group
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module ShouldFail where
+
+data Unorderable = Gnorf | Pinky | Brain
+
+foo = [ ()
+      | x <- [Gnorf, Brain]
+      , then group using take 5
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail191.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail191.stderr 1
+
+tcfail191.hs:11:26:
+    Couldn't match type `a' with `[a]'
+      `a' is a rigid type variable bound by
+          a type expected by the context: [a] -> [[a]] at tcfail191.hs:11:9
+    Expected type: [a] -> [[a]]
+      Actual type: [a] -> [a]
+    In the return type of a call of `take'
+    In the expression: take 5
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail192.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail192.hs 1
-
+-- Checks that the types of the old binder and the binder 
+-- implicitly introduced by grouping are linked
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module ShouldFail where
+
+foo = [ x + 1
+      | x <- ["Hello", "World"]
+      , then group using take 5
+      ]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail192.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail192.stderr 1
+
+tcfail192.hs:8:11:
+    No instance for (Num [[Char]])
+      arising from a use of `+'
+    Possible fix: add an instance declaration for (Num [[Char]])
+    In the expression: x + 1
+    In the expression:
+      [x + 1 | x <- ["Hello", "World"], then group using take 5]
+    In an equation for `foo':
+        foo = [x + 1 | x <- ["Hello", "World"], then group using take 5]
+
+tcfail192.hs:10:26:
+    Couldn't match type `a' with `[a]'
+      `a' is a rigid type variable bound by
+          a type expected by the context: [a] -> [[a]] at tcfail192.hs:10:9
+    Expected type: [a] -> [[a]]
+      Actual type: [a] -> [a]
+    In the return type of a call of `take'
+    In the expression: take 5
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail193.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail193.hs 1
+-- Checks that the correct type is used checking the using clause of the transform
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module ShouldFail where
+
+import Data.List(inits)
+
+z :: [Int]
+z = [x | x <- [3, 2, 1], then inits]
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail193.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail193.stderr 1
+
+tcfail193.hs:10:31:
+    Couldn't match type `a' with `[a]'
+      `a' is a rigid type variable bound by
+          a type expected by the context: [a] -> [a] at tcfail193.hs:10:26
+    Expected type: [a] -> [a]
+      Actual type: [a] -> [[a]]
+    In the expression: inits
+    In a stmt of a list comprehension: then inits
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail194.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail194.hs 1
+-- Checks that using the "by" clause in a transform requires a function parameter
+
+{-# OPTIONS_GHC -XTransformListComp #-}
+
+module ShouldFail where
+
+import Data.List(take)
+
+z = [x | x <- [1..10], then take 5 by x]
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail194.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail194.stderr 1
+
+tcfail194.hs:9:29:
+    Couldn't match expected type `a -> t0' with actual type `[a0]'
+    Expected type: (a -> t0) -> [a] -> [a]
+      Actual type: [a0] -> [a0]
+    In the return type of a call of `take'
+    Probable cause: `take' is applied to too many arguments
+    In the expression: take 5
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail195.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail195.hs 1
+{-# LANGUAGE RankNTypes, GADTs #-}
+
+module ShouldFail where
+
+data Foo a where
+  Foo :: Int -> Foo (forall a. a)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail195.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail195.stderr 1
+
+tcfail195.hs:6:3:
+    Illegal polymorphic or qualified type: forall a. a
+    In the definition of data constructor `Foo'
+    In the data type declaration for `Foo'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail196.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail196.hs 1
+{-# LANGUAGE RankNTypes #-}
+
+module ShouldFail where
+
+bar :: Num (forall a. a) => Int -> Int
+bar = error "urk"
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail196.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail196.stderr 1
+
+tcfail196.hs:5:1:
+    Illegal polymorphic or qualified type: forall a. a
+    In the type signature for `bar':
+      bar :: Num (forall a. a) => Int -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail197.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail197.hs 1
+{-# LANGUAGE RankNTypes #-}
+
+module ShouldFail where
+
+foo :: [forall a. a] -> Int
+foo = error "urk"
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail197.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail197.stderr 1
+
+tcfail197.hs:5:1:
+    Illegal polymorphic or qualified type: forall a. a
+    Perhaps you intended to use -XImpredicativeTypes
+    In the type signature for `foo':
+      foo :: [forall a. a] -> Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail198.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail198.hs 1
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module ShouldFail where
+
+f3 :: forall a. [a] -> [a] 
+Just f3 = Just (\(x:xs) -> xs ++ [ x :: a ])   -- Not OK!
+	-- The type variable does not scope in a pattern binding
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail198.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail198.stderr 1
+
+tcfail198.hs:6:36:
+    Couldn't match type `a' with `a1'
+      `a' is a rigid type variable bound by
+          the inferred type of f3 :: [a] -> [a] at tcfail198.hs:6:1
+      `a1' is a rigid type variable bound by
+           an expression type signature: a1 at tcfail198.hs:6:36
+    In the expression: x :: a
+    In the second argument of `(++)', namely `[x :: a]'
+    In the expression: xs ++ [x :: a]
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail199.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail199.hs 1
+-- trac #2179
+
+module Main where
+
+main = "hi"
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail199.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail199.stderr 1
+
+tcfail199.hs:5:1:
+    Couldn't match expected type `IO t0' with actual type `[Char]'
+    In the expression: main
+    When checking the type of the function `main'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail200.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail200.hs 1
+{-# LANGUAGE MagicHash #-}
+
+module ShouldFail where
+
+f = let x = ( 1#, 'c' ) in x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail200.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail200.stderr 1
+
+tcfail200.hs:5:15:
+    Couldn't match kind `*' against `#'
+    Kind incompatibility when matching types:
+      t0 :: *
+      GHC.Prim.Int# :: #
+    In the expression: 1#
+    In the expression: (1#, 'c')
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail201.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail201.hs 1
+{-# LANGUAGE Rank2Types #-}
+
+
+-- Claus reported by email that 
+-- GHCi, version 6.9.20080217 loops on this program
+-- http://www.haskell.org/pipermail/cvs-ghc/2008-June/043173.html
+-- So I'm adding it to the test suite so that we'll see it if it happens again
+
+module Foo where
+
+data HsDoc id
+  = DocEmpty
+  | DocParagraph (HsDoc id)
+
+gfoldl' :: (forall a b . c (a -> b) -> a -> c b) -> (forall g . g -> c g) -> a -> c a
+gfoldl' k z hsDoc = case hsDoc of
+			  DocEmpty                  -> z DocEmpty
+			  (DocParagraph hsDoc)      -> z DocParagraph `k` hsDoc
+
+
+
+
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail201.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail201.stderr 1
+
+tcfail201.hs:18:28:
+    Couldn't match type `a' with `HsDoc id0'
+      `a' is a rigid type variable bound by
+          the type signature for
+            gfoldl' :: (forall a1 b. c (a1 -> b) -> a1 -> c b)
+                       -> (forall g. g -> c g) -> a -> c a
+          at tcfail201.hs:16:1
+    In the pattern: DocParagraph hsDoc
+    In a case alternative:
+        (DocParagraph hsDoc) -> z DocParagraph `k` hsDoc
+    In the expression:
+      case hsDoc of {
+        DocEmpty -> z DocEmpty
+        (DocParagraph hsDoc) -> z DocParagraph `k` hsDoc }
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail202.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail202.hs 1
+-- trac #2307
+-- This was accepted due to a bug in GHC
+
+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
+             OverlappingInstances, UndecidableInstances, IncoherentInstances,
+             FlexibleInstances #-}
+
+module Foo where
+
+class C a b c | b -> c
+instance C Bool Int Float
+instance C Char Int Double
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail202.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail202.stderr 1
+
+tcfail202.hs:11:10:
+    Functional dependencies conflict between instance declarations:
+      instance [incoherent] C Bool Int Float
+        -- Defined at tcfail202.hs:11:10
+      instance [incoherent] C Char Int Double
+        -- Defined at tcfail202.hs:12:10
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail203.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail203.hs 1
+-- trac #2806
+
+{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
+
+module Foo where
+
+import GHC.Base
+
+pass1 = 'a'
+    where !x = 5#
+
+pass2 = 'a'
+    where !(I# x) = 5
+
+pass3 = 'a'
+    where !(b, I# x) = (True, 5)
+
+pass4 = 'a'
+    where !(# b, I# x #) = (# True, 5 #)
+
+pass5 = 'a'
+    where !(# b, x #) = (# True, 5# #)
+
+fail1 = 'a'
+    where x = 5#
+
+fail2 = 'a'
+    where (I# x) = 5
+
+fail3 = 'a'
+    where (b, I# x) = (True, 5)
+
+fail4 = 'a'
+    where (# b, I# x #) = (# True, 5 #)
+
+fail5 = 'a'
+    where (# b, x #) = (# True, 5# #)
+
+fail6 = 'a'
+    where (I# !x) = 5
+
+fail7 = 'a'
+    where (b, !(I# x)) = (True, 5)
+
+fail8 = 'a'
+    where (# b, !(I# x) #) = (# True, 5 #)
+
+fail9 = 'a'
+    where (# b, !x #) = (# True, 5# #)
+{-
+-- Now in tcfail203a.hs, because it's an error
+fail10 = 'a'
+    where !(b, ~(c, (I# x))) = (True, (False, 5))
+-}
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail203.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail203.stderr 1
+
+tcfail203.hs:28:11:
+    Warning: Pattern bindings containing unlifted types should use an outermost bang pattern:
+               (I# x) = 5
+    In an equation for `fail2':
+        fail2
+          = 'a'
+          where
+              (I# x) = 5
+
+tcfail203.hs:31:11:
+    Warning: Pattern bindings containing unlifted types should use an outermost bang pattern:
+               (b, I# x) = (True, 5)
+    In an equation for `fail3':
+        fail3
+          = 'a'
+          where
+              (b, I# x) = (True, 5)
+
+tcfail203.hs:40:11:
+    Warning: Pattern bindings containing unlifted types should use an outermost bang pattern:
+               (I# !x) = 5
+    In an equation for `fail6':
+        fail6
+          = 'a'
+          where
+              (I# !x) = 5
+
+tcfail203.hs:43:11:
+    Warning: Pattern bindings containing unlifted types should use an outermost bang pattern:
+               (b, !(I# x)) = (True, 5)
+    In an equation for `fail7':
+        fail7
+          = 'a'
+          where
+              (b, !(I# x)) = (True, 5)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail203a.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail203a.hs 1
+-- trac #2806
+
+{-# LANGUAGE MagicHash, UnboxedTuples, BangPatterns #-}
+
+module Foo where
+
+import GHC.Base
+
+fail10 = 'a'
+    where !(b, ~(c, (I# x))) = (True, (False, 5))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail203a.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail203a.stderr 1
+
+tcfail203a.hs:10:16:
+    A lazy (~) pattern cannot contain unlifted types: ~(c, (I# x))
+    In the pattern: ~(c, (I# x))
+    In the pattern: (b, ~(c, (I# x)))
+    In the pattern: !(b, ~(c, (I# x)))
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail204.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail204.hs 1
+
+{-# OPTIONS_GHC -Wall #-}
+{-# OPTIONS_GHC -Werror #-}
+
+-- Trac #3261
+
+module Foo where
+
+foo :: Int
+foo = ceiling 6.3
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail204.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail204.stderr 1
+
+tcfail204.hs:10:15:
+    Warning: Defaulting the following constraint(s) to type `Double'
+               (Fractional a0) arising from the literal `6.3'
+                               at tcfail204.hs:10:15-17
+               (RealFrac a0) arising from a use of `ceiling'
+                             at tcfail204.hs:10:7-13
+    In the first argument of `ceiling', namely `6.3'
+    In the expression: ceiling 6.3
+    In an equation for `foo': foo = ceiling 6.3
+
+<no location info>: 
+Failing due to -Werror.
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail205.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail205.hs 1
+module Fail where
+
+f x = foldl (+) [1 .. x] 'a'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail205.stderr
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail206.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail206.hs 1
+{-# LANGUAGE TupleSections, UnboxedTuples #-}
+module Main where
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail206.hs 4
+a :: Bool -> (Int, Bool)
+a = ( , True)
+
+b :: Int -> Bool -> (Int, Bool)
+b = (1, )
+
+c :: a -> (a, Bool)
+c = (True || False, )
+
+d :: Bool -> (#Int, Bool#)
+d = (# , True#)
+
+e :: Int -> Bool -> (#Int, Bool#)
+e = (#1, #)
+
+f :: a -> (#a, Bool#)
+f = (#True || False, #)
+
+main = return ()
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail206.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail206.stderr 1
+
+tcfail206.hs:5:5:
+    Couldn't match expected type `Int' with actual type `Bool'
+    Expected type: Bool -> (Int, Bool)
+      Actual type: Bool -> (Bool, t0)
+    In the expression: (, True)
+    In an equation for `a': a = (, True)
+
+tcfail206.hs:8:5:
+    Couldn't match expected type `Bool -> (Int, Bool)'
+                with actual type `(t0, Int)'
+    Expected type: Int -> Bool -> (Int, Bool)
+      Actual type: Int -> (t0, Int)
+    In the expression: (1,)
+    In an equation for `b': b = (1,)
+
+tcfail206.hs:11:5:
+    Couldn't match type `a' with `Bool'
+      `a' is a rigid type variable bound by
+          the type signature for c :: a -> (a, Bool) at tcfail206.hs:11:1
+    Expected type: a -> (a, Bool)
+      Actual type: a -> (a, a)
+    In the expression: (True || False,)
+    In an equation for `c': c = (True || False,)
+
+tcfail206.hs:14:5:
+    Couldn't match expected type `Int' with actual type `Bool'
+    Expected type: Bool -> (# Int, Bool #)
+      Actual type: Bool -> (# Bool, t0 #)
+    In the expression: (# , True #)
+    In an equation for `d': d = (# , True #)
+
+tcfail206.hs:17:5:
+    Couldn't match expected type `Bool -> (# Int, Bool #)'
+                with actual type `(# t0, Int #)'
+    Expected type: Int -> Bool -> (# Int, Bool #)
+      Actual type: Int -> (# t0, Int #)
+    In the expression: (# 1, #)
+    In an equation for `e': e = (# 1, #)
+
+tcfail206.hs:20:5:
+    Couldn't match type `a' with `Bool'
+      `a' is a rigid type variable bound by
+          the type signature for f :: a -> (# a, Bool #) at tcfail206.hs:20:1
+    Expected type: a -> (# a, Bool #)
+      Actual type: a -> (# a, a #)
+    In the expression: (# True || False, #)
+    In an equation for `f': f = (# True || False, #)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail207.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail207.hs 1
+module Foo where
+
+f :: Int -> [Int] -> [Int]
+-- Want an error message that says 'take' is applied to too many args
+f x = take x []
+
+g :: [Int]
+-- Want an error message that says 'take' is applied to too few args
+g = take 3
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail207.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail207.stderr 1
+
+tcfail207.hs:5:7:
+    Couldn't match expected type `[Int] -> [Int]'
+                with actual type `[a0]'
+    In the return type of a call of `take'
+    Probable cause: `take' is applied to too many arguments
+    In the expression: take x []
+    In an equation for `f': f x = take x []
+
+tcfail207.hs:9:5:
+    Couldn't match expected type `[Int]'
+                with actual type `[a0] -> [a0]'
+    In the return type of a call of `take'
+    Probable cause: `take' is applied to too few arguments
+    In the expression: take 3
+    In an equation for `g': g = take 3
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail208.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail208.hs 1
+module Ctx where
+
+f :: (Monad m, Eq a) => a -> m a -> Bool
+f x y = (return x == y)
+
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail208.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail208.stderr 1
+
+tcfail208.hs:4:19:
+    Could not deduce (Eq (m a)) arising from a use of `=='
+    from the context (Monad m, Eq a)
+      bound by the type signature for
+                 f :: (Monad m, Eq a) => a -> m a -> Bool
+      at tcfail208.hs:4:1-23
+    Possible fix:
+      add (Eq (m a)) to the context of
+        the type signature for f :: (Monad m, Eq a) => a -> m a -> Bool
+      or add an instance declaration for (Eq (m a))
+    In the expression: (return x == y)
+    In an equation for `f': f x y = (return x == y)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail209.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail209.hs 1
+module FancyContextsWithoutExtension1 where
+
+type Showish = Show
+
+f :: (Showish a) => a -> a
+f = undefined
+
+g :: ((Show a, Num a), Eq a) => a -> a
+g = undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail209.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail209.stderr 1
+
+tcfail209.hs:5:1:
+    Illegal irreducible constraint Showish a
+    (Use -XConstraintKinds to permit this)
+    In the type signature for `f': f :: Showish a => a -> a
+
+tcfail209.hs:8:1:
+    Illegal tuple constraint (Show a, Num a)
+    (Use -XConstraintKinds to permit this)
+    In the type signature for `g':
+      g :: ((Show a, Num a), Eq a) => a -> a
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail210.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail210.hs 1
+{-# LANGUAGE TypeFamilies #-}
+module FancyContextsWithoutExtension2 where
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail210.hs 4
+type family Indexed a :: * -> Constraint
+type instance Indexed Int = Show
+type instance Indexed Bool = Num
+
+f :: (Indexed Int a) => a -> a
+f = undefined
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail210.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail210.stderr 1
+
+tcfail210.hs:4:31:
+    Not in scope: type constructor or class `Constraint'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail211.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail211.hs 1
+{-# LANGUAGE ImplicitParams, FlexibleContexts #-}
+
+module ShouldFail where
+
+class (?imp :: Int) => D t where
+    methodD :: t -> t
+
+instance (?imp :: Int) => D Int where
+    methodD x = x + ?imp
+
+test :: D Int => Int -- Requires FlexibleContexts
+test = methodD ?imp
+
+-- Should get reasonable error about unbound ?imp
+use :: IO ()
+use = print test
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail211.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail211.stderr 1
+
+tcfail211.hs:16:13:
+    Unbound implicit parameter (?imp::Int)
+      arising from a use of `test'
+    In the first argument of `print', namely `test'
+    In the expression: print test
+    In an equation for `use': use = print test
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail212.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail212.hs 1
+{-# LANGUAGE ConstraintKinds, MagicHash #-}
+module ShouldFail where
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail212.hs 4
+import GHC.Exts
+
+-- If we turn on ConstraintKinds the typing rule for
+-- tuple types is generalised. This test checks that
+-- we get a reasonable error for unreasonable tuples.
+
+f :: (Maybe, Either Int)
+f = (Just 1, Left 1)
+
+g :: (Int#, Int#)
+g = (1#, 2#)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail212.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail212.stderr 1
+
+tcfail212.hs:10:7:
+    Expecting one more argument to `Maybe'
+    In the type signature for `f': f :: (Maybe, Either Int)
+
+tcfail212.hs:13:7:
+    Expecting a lifted type, but `Int#' is unlifted
+    In the type signature for `g': g :: (Int#, Int#)
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail213.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail213.hs 1
+{-# LANGUAGE TypeFamilies, ConstraintKinds #-}
+module ShouldFail where
+
+import GHC.Prim( Constraint )
+
+type family F a :: Constraint
+
+class (F a) => C a where
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail213.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail213.stderr 1
+
+tcfail213.hs:8:1:
+    Illegal irreducible constraint F a
+    in superclass/instance head context (Use -XUndecidableInstances to permit this)
+    In the context: (F a)
+    While checking the super-classes of class `C'
+    In the class declaration for `C'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail214.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail214.hs 1
+{-# LANGUAGE TypeFamilies, ConstraintKinds #-}
+module ShouldFail where
+
+import GHC.Prim( Constraint )
+
+type family F a :: Constraint
+
+class C a where
+instance (F a) => C [a] where
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail214.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail214.stderr 1
+
+tcfail214.hs:9:10:
+    Illegal irreducible constraint F a
+    in superclass/instance head context (Use -XUndecidableInstances to permit this)
+    In the context: (F a)
+    While checking an instance declaration
+    In the instance declaration for `C [a]'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail215.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail215.hs 1
+{-# LANGUAGE ImplicitParams, MagicHash #-}
+
+module ShouldFail where
+
+import GHC.Exts
+
+-- As of GHC 7.4, we don't allow unlifted types in ImplicitParms
+foo :: (?x :: Int#) => Int
+foo = I# ?x
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail215.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail215.stderr 1
+
+tcfail215.hs:8:15:
+    Expecting a lifted type, but `Int#' is unlifted
+    In the type signature for `foo': foo :: ?x :: Int# => Int
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail216.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail216.hs 1
+-- Test we do get a cycle for superclasses escaping via a free tyvar
+{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, UndecidableInstances #-}
+module TcFail where
+
+class cls (A cls) => A cls c where
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail216.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail216.stderr 1
+
+tcfail216.hs:5:1:
+    Cycle in class declaration (via superclasses): A -> A
+    In the class declaration for `A'
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail217.hs
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail217.hs 1
+-- Test we can't hide cycles with type synonyms
+{-# LANGUAGE ConstraintKinds, MultiParamTypeClasses, UndecidableInstances #-}
+module TcFail where
+
+type Aish = A
+
+class cls (Aish cls) => A cls c where
addfile ./regress/tests/1_typecheck/4_fail/ghc/tcfail217.stderr
hunk ./regress/tests/1_typecheck/4_fail/ghc/tcfail217.stderr 1
+
+tcfail217.hs:7:1:
+    Cycle in class declaration (via superclasses): A -> Aish -> A
+    In the class declaration for `A'