From cedd20d43966d4fdf2e50a71e807693e14127937 Mon Sep 17 00:00:00 2001
From: simonpj <unknown>
Date: Wed, 10 Feb 1999 15:46:06 +0000
Subject: [PATCH] [project @ 1999-02-10 15:45:52 by simonpj] Misc tests fixes,
 and activate the programs directory

---
 ghc/tests/Makefile                            |  4 +-
 ghc/tests/programs/Makefile                   | 10 +-
 .../programs/fast2haskell/Fast2haskell.hs     | 16 ++--
 ghc/tests/programs/jon_polycase/Foo.lhs       |  4 +-
 ghc/tests/reader/should_fail/expr001.stderr   |  7 +-
 ghc/tests/reader/should_fail/read001.stderr   | 93 +++++++++----------
 ghc/tests/reader/should_fail/read003.stderr   |  8 +-
 ghc/tests/reader/should_fail/read006.stderr   |  2 +-
 ghc/tests/rename/should_compile/rn017.stderr  |  4 +-
 ghc/tests/rename/should_fail/rnfail001.stderr |  6 +-
 ghc/tests/rename/should_fail/rnfail002.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail003.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail004.stderr | 12 ++-
 ghc/tests/rename/should_fail/rnfail007.stderr |  5 +-
 ghc/tests/rename/should_fail/rnfail008.stderr |  4 +-
 ghc/tests/rename/should_fail/rnfail009.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail010.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail011.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail012.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail013.stderr |  2 +-
 ghc/tests/rename/should_fail/rnfail014.stderr | 10 +-
 ghc/tests/rename/should_fail/rnfail015.stderr |  5 +-
 .../stranal/should_compile/str001.stderr      |  2 +-
 ghc/tests/typecheck/should_compile/tc097.hs   |  6 +-
 .../typecheck/should_compile/tc097.stderr     | 11 +--
 ghc/tests/typecheck/should_fail/tcfail039.hs  |  7 +-
 .../typecheck/should_fail/tcfail039.stderr    |  9 +-
 27 files changed, 121 insertions(+), 118 deletions(-)

diff --git a/ghc/tests/Makefile b/ghc/tests/Makefile
index c23b02022dcb..e3667e63719e 100644
--- a/ghc/tests/Makefile
+++ b/ghc/tests/Makefile
@@ -13,11 +13,11 @@ SUBDIRS = \
 	rename \
 	simplCore \
 	stranal \
-	typecheck 
+	typecheck \
+	programs
 
 #	printing \
 #	io \
-#	programs
 
 include $(TOP)/mk/target.mk
 
diff --git a/ghc/tests/programs/Makefile b/ghc/tests/programs/Makefile
index 2a57051c9d41..617e589493ca 100644
--- a/ghc/tests/programs/Makefile
+++ b/ghc/tests/programs/Makefile
@@ -1,7 +1,15 @@
 TOP = .
 include $(TOP)/mk/boilerplate.mk
 
-NOT_THESE = Makefile ipoole_spec_class areid_pass
+NOT_THESE = CVS mk Makefile \
+
+NOT_THESE += hill_stk_oflow
+#	Correctly fails to terminate
+
+NOT_THESE += ipoole_spec_class
+#	Dialogue style IO
+
+#	areid_pass
 
 SUBDIRS = $(filter-out $(NOT_THESE), $(wildcard *))
 
diff --git a/ghc/tests/programs/fast2haskell/Fast2haskell.hs b/ghc/tests/programs/fast2haskell/Fast2haskell.hs
index de3aa0fbb1fa..52611737f062 100644
--- a/ghc/tests/programs/fast2haskell/Fast2haskell.hs
+++ b/ghc/tests/programs/fast2haskell/Fast2haskell.hs
@@ -6,7 +6,8 @@
             land_i, lnot_i, lor_i, lshift_i, rshift_i,
             descr,
             destr_update, indassoc, lowbound, tabulate, upbound, update, valassoc) where {
-            import Word2;
+	    import Bits;
+            import Word;
 	    import Complex; -- 1.3
 	    import Array; -- 1.3
             type Complex_type   = Complex Double;
@@ -19,23 +20,22 @@
             force         x                   = x; -- error  "force not implemented";
             iff           b     x  y          = if b then x else y;
             iffrev        y  x      b         = if b then x else y;
-            seQ           x    y              = seq_const y (x{-#STRICT-});
-            seq_const     x    y              = x ;
+            seQ           x    y              = x `seq` y;
             pair          []                  = False;
             pair          x                   = True;
             strcmp        :: [Char] -> [Char] -> Bool;
             strcmp        x      y            = x == y;
             entier        x                   = fromIntegral (floor x);
             land_i        :: Int -> Int -> Int;
-            land_i        x    y              = wordToInt (bitAnd (fromInt x) (fromInt y));
+            land_i        x    y              = wordToInt (fromInt x .&. fromInt y);
             lnot_i        :: Int -> Int;
-            lnot_i        x                   = wordToInt (bitCompl (fromInt x));
+            lnot_i        x                   = wordToInt (complement (fromInt x));
             lor_i         :: Int -> Int -> Int;
-            lor_i         x    y              = wordToInt (bitOr (fromInt x) (fromInt y));
+            lor_i         x    y              = wordToInt (fromInt x .|. fromInt y);
             lshift_i      :: Int -> Int -> Int;
-            lshift_i      x    y              = wordToInt (bitLsh (fromInt x) y);
+            lshift_i      x    y              = wordToInt (fromInt x `shiftL` y);
             rshift_i      :: Int -> Int -> Int;
-            rshift_i      x    y              = wordToInt (bitRsh (fromInt x) y);
+            rshift_i      x    y              = wordToInt (fromInt x `shiftR` y);
             write         x                   = abortstr "write not implemented";
             descr         l    u              = (l,u);
             destr_update  ar  i  x            = ar // [(i,x)];
diff --git a/ghc/tests/programs/jon_polycase/Foo.lhs b/ghc/tests/programs/jon_polycase/Foo.lhs
index 3606505c37ad..daa9c3daad07 100644
--- a/ghc/tests/programs/jon_polycase/Foo.lhs
+++ b/ghc/tests/programs/jon_polycase/Foo.lhs
@@ -49,7 +49,7 @@ Likewise if you change the type of LinearCode to Int!
 > getRepInterp (RepInterp a ) = a
 
 > instance Functor Interpreter where
->  map f (RepInterp intp ) 
+>  fmap f (RepInterp intp ) 
 >   = RepInterp (\s -> case intp s of
 >			 g -> g >>= \q -> 
 >		          case q of
@@ -81,4 +81,4 @@ Likewise if you change the type of LinearCode to Int!
 > class Monad m => OutputMonad m  where   
 >   out      :: String -> m ()
 > instance OutputMonad IO where
->  out s = catch (putStr s) (\_ ->  fail $userError "Oh MY")
+>  out s = catch (putStr s) (\_ ->  ioError $ userError "Oh MY")
diff --git a/ghc/tests/reader/should_fail/expr001.stderr b/ghc/tests/reader/should_fail/expr001.stderr
index 169d24605fa5..8b8731c8c3ec 100644
--- a/ghc/tests/reader/should_fail/expr001.stderr
+++ b/ghc/tests/reader/should_fail/expr001.stderr
@@ -2,13 +2,12 @@
 ==================== Reader ====================
 module Main where
 {- rec -}
-f x = x + (if c then 1 else 2)
-f x = x + 1 :: Int
+f x = x zp (if c then 1 else 2)
+f x = x zp 1 :: Int
 
 
- 
-expr001.hs:10: Value not in scope: `c'
 
+expr001.hs:10: Variable not in scope: `c'
 
 Compilation had errors
 
diff --git a/ghc/tests/reader/should_fail/read001.stderr b/ghc/tests/reader/should_fail/read001.stderr
index 23b140cdecce..3e0d15f0cf72 100644
--- a/ghc/tests/reader/should_fail/read001.stderr
+++ b/ghc/tests/reader/should_fail/read001.stderr
@@ -1,9 +1,9 @@
 
 ==================== Reader ====================
 module OneOfEverything (
-	fixn, FooData, FooDataB(..), FooDataC(..), EqTree(EqLeaf,
-							  EqBranch), EqClass(..), OrdClass(orda,
-											   ordb), module OneC, module OneOfEverything
+	fixn, FooData, FooDataB(..), FooDataC(..),
+	EqTree(EqLeaf, EqBranch), EqClass(..), OrdClass(orda, ordb),
+	module OneC, module OneOfEverything
     ) where
 import Prelude
 import IO (putStr)
@@ -32,31 +32,32 @@ mat a b c d
       | foof b c = d
       where
 	  {- rec -}
-	  foof a b = a == b
+	  foof a b = a zeze b
 expr a b c d
-       = ((((((((a + (: a b)) + (a : b)) + (((1 - 'c') - "abc") - 1.293))
-	      + ((\ x y z -> x) 42))
-	     + ((9 *)))
-	    + ((* 8)))
-	   + (case x of
-		Prelude.[]
-		  | null x -> 99
-		  | otherwise -> 98
-		  | True -> 97
-		  where
-		      {- rec -}
-		      null x = False))
-	  + ([z | z <- c, isSpace z]))
-	 + (let
-	      {- rec -}
-	      y = foo
-	    in
-	      (((((((y + [1, 2, 3, 4]) + (4, 3, 2, 1)) + (4 :: (Num a) => a))
-		  + (if 42 == 42.0 then 1 else 4))
-		 + ([1 .. ]))
-		+ ([2, 4 .. ]))
-	       + ([3 .. 5]))
-	      + ([4, 8 .. 999]))
+       = ((((((((a zp (ZC a b)) zp (a ZC b))
+	       zp (((1 zm 'c') zm "abc") zm 1.293))
+	      zp ((\ x y zz -> x) 42))
+	     zp ((9 zt)))
+	    zp ((zt 8)))
+	   zp (case x of
+		 Prelude.ZMZN
+		   | null x -> 99
+		   | otherwise -> 98
+		   | True -> 97
+		   where
+		       {- rec -}
+		       null x = False))
+	  zp ([zz | zz <- c, isSpace zz]))
+	 zp (let
+	       {- rec -}
+	       y = foo
+	     in
+	       (((((((y zp [1, 2, 3, 4]) zp (4, 3, 2, 1)) zp (4 :: (Num a) => a))
+		   zp (if 42 zeze 42.0 then 1 else 4))
+		  zp ([1 .. ]))
+		 zp ([2, 4 .. ]))
+		zp ([3 .. 5]))
+	       zp ([4, 8 .. 999]))
 f _
   x
   1
@@ -64,13 +65,13 @@ f _
   'c'
   "dog"
   ~y
-  (z@(Foo a b))
+  (zz@(Foo a b))
   (c Bar d)
   [1, 2]
   (3, 4)
   ((n+42))
     = y
-g x y z = head y
+g x y zz = head y
 default (Integer, Rational)
 instance (Eq a) => EqClass (EqTree a) where
     []
@@ -87,36 +88,32 @@ data FooDataB = FooConB Double
 data FooData = FooCon Int
 type Pair a b = (a, b)
 infixr 8 fixr
-infixl 7 +#
+infixl 7 zpzh
 infix 6 fixn
 
 
- 
-read001.hs:20: Warning: Unused fixity declaration for `+#'
 
- 
 read001.hs:5: Type constructor or class not in scope: `FooDataC'
- 
+
 read001.hs:5: Unknown module in export list: module `OneC'
- 
+
 read001.hs:40: Type constructor or class not in scope: `EqLeaf'
- 
+
 read001.hs:40: Type constructor or class not in scope: `EqLeaf'
- 
-read001.hs:80: Value not in scope: `isSpace'
- 
-read001.hs:87: Value not in scope: `x'
- 
-read001.hs:87: Value not in scope: `x'
- 
-read001.hs:95: Value not in scope: `foo'
- 
+
+read001.hs:80: Variable not in scope: `isSpace'
+
+read001.hs:87: Variable not in scope: `x'
+
+read001.hs:87: Variable not in scope: `x'
+
+read001.hs:95: Variable not in scope: `foo'
+
 read001.hs:107: Data constructor not in scope: `Foo'
- 
+
 read001.hs:107: Data constructor not in scope: `Bar'
- 
-read001.hs:112: Type constructor or class not in scope: `Foo'
 
+read001.hs:112: Type constructor or class not in scope: `Foo'
 
 Compilation had errors
 
diff --git a/ghc/tests/reader/should_fail/read003.stderr b/ghc/tests/reader/should_fail/read003.stderr
index e4a38a3dfdba..9deee4dd303d 100644
--- a/ghc/tests/reader/should_fail/read003.stderr
+++ b/ghc/tests/reader/should_fail/read003.stderr
@@ -11,14 +11,12 @@ module Read003 where
 	nullity = null
 
 
- 
+
 read003.hs:4:
-    Occurs check: cannot construct the infinite type:
-	t = (t, [a], _116)
-	Expected type: (t, [a], _116)
+    Occurs check: cannot construct the infinite type: t = (t, [a], t1)
+	Expected type: (t, [a], t1)
 	Inferred type: t
     In the right-hand side of a pattern binding: a
 
-
 Compilation had errors
 
diff --git a/ghc/tests/reader/should_fail/read006.stderr b/ghc/tests/reader/should_fail/read006.stderr
index d7814a4eba60..230584fd5867 100644
--- a/ghc/tests/reader/should_fail/read006.stderr
+++ b/ghc/tests/reader/should_fail/read006.stderr
@@ -1 +1 @@
-read006.hs:5:7: pattern syntax used in expression on input: "_"
+read006.hs:8:12: parse error on input: "@"
diff --git a/ghc/tests/rename/should_compile/rn017.stderr b/ghc/tests/rename/should_compile/rn017.stderr
index 97e1a59809b4..d70cd06b36c3 100644
--- a/ghc/tests/rename/should_compile/rn017.stderr
+++ b/ghc/tests/rename/should_compile/rn017.stderr
@@ -1,3 +1,3 @@
 ghc: module version changed to 1; reason: no old .hi file
-__export Rn017 a b c Wibble{MkWibble} Wobble;
-__export Test f FOO{op} Foo{MkFoo};
+__export Rn017 Wibble{MkWibble} Wobble a b c;
+__export Test FOO{op} Foo{MkFoo} f;
diff --git a/ghc/tests/rename/should_fail/rnfail001.stderr b/ghc/tests/rename/should_fail/rnfail001.stderr
index aa56cac854f7..5f6ddc5fc0e6 100644
--- a/ghc/tests/rename/should_fail/rnfail001.stderr
+++ b/ghc/tests/rename/should_fail/rnfail001.stderr
@@ -1,5 +1,7 @@
- 
-rnfail001.hs:3: Conflicting definitions for `x' in pattern
+
+rnfail001.hs:3:
+    Conflicting definitions for `x'
+    in a pattern
 
 
 Compilation had errors
diff --git a/ghc/tests/rename/should_fail/rnfail002.stderr b/ghc/tests/rename/should_fail/rnfail002.stderr
index 4a0a131b5673..75ba87bf76d7 100644
--- a/ghc/tests/rename/should_fail/rnfail002.stderr
+++ b/ghc/tests/rename/should_fail/rnfail002.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail002.hs:4:
     Multiple declarations of `y'
 	defined at rnfail002.hs:5
diff --git a/ghc/tests/rename/should_fail/rnfail003.stderr b/ghc/tests/rename/should_fail/rnfail003.stderr
index cd3ec692c15a..61ffb25a6c34 100644
--- a/ghc/tests/rename/should_fail/rnfail003.stderr
+++ b/ghc/tests/rename/should_fail/rnfail003.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail003.hs:2:
     Multiple declarations of `f'
 	defined at rnfail003.hs:2
diff --git a/ghc/tests/rename/should_fail/rnfail004.stderr b/ghc/tests/rename/should_fail/rnfail004.stderr
index 1136eea73527..5a256e72acf3 100644
--- a/ghc/tests/rename/should_fail/rnfail004.stderr
+++ b/ghc/tests/rename/should_fail/rnfail004.stderr
@@ -1,7 +1,11 @@
- 
-rnfail004.hs:6: Conflicting definitions for `a' in binding group
- 
-rnfail004.hs:7: Conflicting definitions for `b' in binding group
+
+rnfail004.hs:6:
+    Conflicting definitions for `a'
+    in a binding group
+
+rnfail004.hs:7:
+    Conflicting definitions for `b'
+    in a binding group
 
 
 Compilation had errors
diff --git a/ghc/tests/rename/should_fail/rnfail007.stderr b/ghc/tests/rename/should_fail/rnfail007.stderr
index 7e8bc0e878f3..d3c6a4915414 100644
--- a/ghc/tests/rename/should_fail/rnfail007.stderr
+++ b/ghc/tests/rename/should_fail/rnfail007.stderr
@@ -1,6 +1,5 @@
- 
-rnfail007.hs:3:
-    Module `Main' must include a definition for `Main.main'
+
+rnfail007.hs:3: Module `Main' must include a definition for `main'
 
 
 Compilation had errors
diff --git a/ghc/tests/rename/should_fail/rnfail008.stderr b/ghc/tests/rename/should_fail/rnfail008.stderr
index be1cc77d8d9c..044582f5454c 100644
--- a/ghc/tests/rename/should_fail/rnfail008.stderr
+++ b/ghc/tests/rename/should_fail/rnfail008.stderr
@@ -1,5 +1,5 @@
- 
-rnfail008.hs:18: Value not in scope: `op3'
+
+rnfail008.hs:18: Variable not in scope: `op3'
 
 
 Compilation had errors
diff --git a/ghc/tests/rename/should_fail/rnfail009.stderr b/ghc/tests/rename/should_fail/rnfail009.stderr
index 774e538bd2d4..066aaef0c052 100644
--- a/ghc/tests/rename/should_fail/rnfail009.stderr
+++ b/ghc/tests/rename/should_fail/rnfail009.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail009.hs:1:
     Multiple declarations of `A'
 	defined at rnfail009.hs:3
diff --git a/ghc/tests/rename/should_fail/rnfail010.stderr b/ghc/tests/rename/should_fail/rnfail010.stderr
index d19435ba49db..2137a4479024 100644
--- a/ghc/tests/rename/should_fail/rnfail010.stderr
+++ b/ghc/tests/rename/should_fail/rnfail010.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail010.hs:2:
     Multiple declarations of `f'
 	defined at rnfail010.hs:2
diff --git a/ghc/tests/rename/should_fail/rnfail011.stderr b/ghc/tests/rename/should_fail/rnfail011.stderr
index 8a33a317625e..5bae7600f5df 100644
--- a/ghc/tests/rename/should_fail/rnfail011.stderr
+++ b/ghc/tests/rename/should_fail/rnfail011.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail011.hs:2:
     Multiple declarations of `A'
 	defined at rnfail011.hs:2
diff --git a/ghc/tests/rename/should_fail/rnfail012.stderr b/ghc/tests/rename/should_fail/rnfail012.stderr
index bee8e16698a9..0f5e86f02f49 100644
--- a/ghc/tests/rename/should_fail/rnfail012.stderr
+++ b/ghc/tests/rename/should_fail/rnfail012.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail012.hs:2:
     Multiple declarations of `A'
 	defined at rnfail012.hs:3
diff --git a/ghc/tests/rename/should_fail/rnfail013.stderr b/ghc/tests/rename/should_fail/rnfail013.stderr
index 86c73ba6912e..2e7f52a46ad0 100644
--- a/ghc/tests/rename/should_fail/rnfail013.stderr
+++ b/ghc/tests/rename/should_fail/rnfail013.stderr
@@ -1,4 +1,4 @@
- 
+
 rnfail013.hs:3:
     Multiple declarations of `MkT'
 	defined at rnfail013.hs:7
diff --git a/ghc/tests/rename/should_fail/rnfail014.stderr b/ghc/tests/rename/should_fail/rnfail014.stderr
index 460650ac3d81..ed49f1d02e03 100644
--- a/ghc/tests/rename/should_fail/rnfail014.stderr
+++ b/ghc/tests/rename/should_fail/rnfail014.stderr
@@ -1,28 +1,28 @@
- 
+
 rnfail014.hs:9:
     The constraint `Eq a' does not mention any of
 	the universally quantified type variables {}
 	of the type `Eq Bool'
     In the type signature for an instance decl
- 
+
 rnfail014.hs:9:
     The constraint `Eq a'
 	mentions type variables that do not appear in the type
 	`Eq Bool'
     In the type signature for an instance decl
- 
+
 rnfail014.hs:12:
     The constraint `Eq a' does not mention any of
 	the universally quantified type variables {}
 	of the type `Int -> Int'
     In the type signature for `f'
- 
+
 rnfail014.hs:12:
     The constraint `Eq a'
 	mentions type variables that do not appear in the type
 	`Int -> Int'
     In the type signature for `f'
- 
+
 rnfail014.hs:17:
     The constraint `Eq a' does not mention any of
 	the universally quantified type variables {}
diff --git a/ghc/tests/rename/should_fail/rnfail015.stderr b/ghc/tests/rename/should_fail/rnfail015.stderr
index 5dfde4c71a6e..184c7503938c 100644
--- a/ghc/tests/rename/should_fail/rnfail015.stderr
+++ b/ghc/tests/rename/should_fail/rnfail015.stderr
@@ -1,6 +1,7 @@
- 
+
 rnfail015.hs:9:
-    Conflicting definitions for `TokLiteral' in the data type declaration for Token
+    Conflicting definitions for `TokLiteral'
+    in the data type declaration for `Token'
 
 
 Compilation had errors
diff --git a/ghc/tests/stranal/should_compile/str001.stderr b/ghc/tests/stranal/should_compile/str001.stderr
index 6c089a3bdeaa..f9aaecebfc38 100644
--- a/ghc/tests/stranal/should_compile/str001.stderr
+++ b/ghc/tests/stranal/should_compile/str001.stderr
@@ -1,2 +1,2 @@
 ghc: module version changed to 1; reason: no old .hi file
-__export ShouldSucceed area2 Point2{Point2};
+__export ShouldSucceed Point2{Point2} area2;
diff --git a/ghc/tests/typecheck/should_compile/tc097.hs b/ghc/tests/typecheck/should_compile/tc097.hs
index 448e631a73a3..545b094b1dea 100644
--- a/ghc/tests/typecheck/should_compile/tc097.hs
+++ b/ghc/tests/typecheck/should_compile/tc097.hs
@@ -3,8 +3,8 @@ module ShouldSucceed where
 
 import PrelGHC -- to get at All
 
-data Monad2 m = MkMonad2 (All a => a -> m a)
-                         ((All a, All b) =>  m a -> (a -> m b) -> m b)
+data Monad2 m = MkMonad2 (forall a. a -> m a)
+                         (forall a b.  m a -> (a -> m b) -> m b)
 
-halfListMonad  :: ((All a, All b) => [a] -> (a -> [b]) -> [b]) -> Monad2 []
+halfListMonad  :: (forall a b. [a] -> (a -> [b]) -> [b]) -> Monad2 []
 halfListMonad b = MkMonad2 (\x -> [x]) b
diff --git a/ghc/tests/typecheck/should_compile/tc097.stderr b/ghc/tests/typecheck/should_compile/tc097.stderr
index 19704af617c2..ab820aa98ecb 100644
--- a/ghc/tests/typecheck/should_compile/tc097.stderr
+++ b/ghc/tests/typecheck/should_compile/tc097.stderr
@@ -1,9 +1,4 @@
 ghc: module version changed to 1; reason: no old .hi file
-_exports_
-ShouldSucceed halfListMonad Monad2(MkMonad2);
-_instances_
-instance _forall_ [a :: (* -> *)] => {PrelBase.Eval (Monad2 a)} = $dEvalMonad20;
-_declarations_
-1 $dEvalMonad20 _:_ _forall_ [a :: (* -> *)] => {PrelBase.Eval (Monad2 a)} ;;
-1 data Monad2 m :: (* -> *) = MkMonad2 (_forall_ [a] => a -> m a) (_forall_ [a b] => m a -> (a -> m b) -> m b) ;
-1 halfListMonad _:_ (_forall_ [a b] => [a] -> (a -> [b]) -> [b]) -> Monad2 PrelBase.[] ;;
+__export ShouldSucceed Monad2{MkMonad2} halfListMonad;
+1 data Monad2 m :: (* -> *) = MkMonad2 (__forall [a] => a -> m a) (__forall [a b] => m a -> (a -> m b) -> m b) ;
+1 halfListMonad :: (__forall [a b] => [a] -> (a -> [b]) -> [b]) -> Monad2 PrelBase.ZMZN ;
diff --git a/ghc/tests/typecheck/should_fail/tcfail039.hs b/ghc/tests/typecheck/should_fail/tcfail039.hs
index 76724361a68f..3340c3b918ca 100644
--- a/ghc/tests/typecheck/should_fail/tcfail039.hs
+++ b/ghc/tests/typecheck/should_fail/tcfail039.hs
@@ -6,7 +6,6 @@ data NUM = ONE | TWO
 class EQ a where
 	(==) :: a -> a -> Bool
 
-instance EQ NUM
---	a /= b = False
---	a == b = True
---	a /= b = False
+instance EQ NUM where
+	a /= b = False
+	a == b = True
diff --git a/ghc/tests/typecheck/should_fail/tcfail039.stderr b/ghc/tests/typecheck/should_fail/tcfail039.stderr
index 848dd21bed38..35e23def64a1 100644
--- a/ghc/tests/typecheck/should_fail/tcfail039.stderr
+++ b/ghc/tests/typecheck/should_fail/tcfail039.stderr
@@ -1,8 +1,9 @@
- 
-tcfail039.hs:7:
+
+tcfail039.hs:11:
     Ambiguous occurrence `=='
-    It could refer to: ==: defined at tcfail039.hs:7
-		       PrelBase.==: imported from Prelude at tcfail039.hs:3
+    It could refer to either `==', defined at tcfail039.hs:7
+		          or `Prelude.==', imported from Prelude at tcfail039.hs:3
+
 
 
 Compilation had errors
-- 
GitLab