[project @ 1999-03-10 14:10:47 by sof]
authorsof <unknown>
Wed, 10 Mar 1999 14:10:49 +0000 (14:10 +0000)
committersof <unknown>
Wed, 10 Mar 1999 14:10:49 +0000 (14:10 +0000)
Some Haskell98-related regression tests

ghc/tests/reader/should_compile/read014.stderr
ghc/tests/reader/should_compile/read016.hs [new file with mode: 0644]
ghc/tests/reader/should_compile/read017.hs [new file with mode: 0644]
ghc/tests/reader/should_compile/read018.hs [new file with mode: 0644]
ghc/tests/reader/should_compile/read019.hs [new file with mode: 0644]
ghc/tests/reader/should_compile/read020.hs [new file with mode: 0644]

index 950e3db..b7fb1c9 100644 (file)
@@ -1,10 +1,10 @@
+
 read014.hs:2: Warning: definition but no type signature for `ng1'
 
 read014.hs:4: Warning: Defined but not used: x
 
 read014.hs:8: Warning: Defined but not used: x
 
-
 read014.hs:8:
     Warning: No explicit method nor default method for `fromInteger'
             in an instance declaration for `Num'
@@ -24,5 +24,3 @@ read014.hs:8:
 read014.hs:8:
     Warning: No explicit method nor default method for `+'
             in an instance declaration for `Num'
-
-
diff --git a/ghc/tests/reader/should_compile/read016.hs b/ghc/tests/reader/should_compile/read016.hs
new file mode 100644 (file)
index 0000000..a2f4311
--- /dev/null
@@ -0,0 +1,10 @@
+-- !!! Checking that both import lists and 'hiding' lists might
+-- !!! be empty.
+module ShouldSucceed where
+
+import List  ()
+import List  hiding ()
+
+x :: Int
+x = 1
+
diff --git a/ghc/tests/reader/should_compile/read017.hs b/ghc/tests/reader/should_compile/read017.hs
new file mode 100644 (file)
index 0000000..3117391
--- /dev/null
@@ -0,0 +1,12 @@
+-- !!! Checking that empty declarations are permitted.
+module ShouldSucceed where
+
+
+class Foo a where
+
+class Foz a
+
+x = 2 where 
+y = 3
+
+instance Foo Int where
diff --git a/ghc/tests/reader/should_compile/read018.hs b/ghc/tests/reader/should_compile/read018.hs
new file mode 100644 (file)
index 0000000..ed3f07d
--- /dev/null
@@ -0,0 +1,16 @@
+-- !!! Checking that empty contexts are permitted.
+module ShouldSucceed where
+
+data () => Foo a = Foo a
+
+newtype () => Bar = Bar Int
+
+f :: () => Int -> Int
+f = (+1)
+
+
+class () => Fob a where
+
+instance () => Fob Int where
+instance () => Fob Float
+
diff --git a/ghc/tests/reader/should_compile/read019.hs b/ghc/tests/reader/should_compile/read019.hs
new file mode 100644 (file)
index 0000000..2ba776d
--- /dev/null
@@ -0,0 +1,10 @@
+-- !!! Checking what's legal in the body of a class declaration.
+module ShouldSucceed where
+
+class Foo a where {
+  (--<>--) :: a -> a -> Int  ;
+  infixl 5 --<>-- ;
+  (--<>--) _ _ = 2 ; -- empty decl at the end.
+};
+
+
diff --git a/ghc/tests/reader/should_compile/read020.hs b/ghc/tests/reader/should_compile/read020.hs
new file mode 100644 (file)
index 0000000..ea6c04d
--- /dev/null
@@ -0,0 +1,13 @@
+-- !!! Checking that qualified method names are legal in instance body.
+module ShouldSucceed where
+
+import Prelude hiding (Eq, (==))
+import Prelude as P (Eq,(==))
+
+data Foo = Foo Int Integer
+
+instance P.Eq Foo where
+  (Foo a1 b1) P.== (Foo a2 b2) = a1 P.== a2 && b1 P.== b2
+
+
+