From: sof Date: Wed, 10 Mar 1999 14:10:49 +0000 (+0000) Subject: [project @ 1999-03-10 14:10:47 by sof] X-Git-Tag: Approximately_9120_patches~6402 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=090f8411690094e46bf9fe1837bf393577b18521;p=ghc-hetmet.git [project @ 1999-03-10 14:10:47 by sof] Some Haskell98-related regression tests --- diff --git a/ghc/tests/reader/should_compile/read014.stderr b/ghc/tests/reader/should_compile/read014.stderr index 950e3db..b7fb1c9 100644 --- a/ghc/tests/reader/should_compile/read014.stderr +++ b/ghc/tests/reader/should_compile/read014.stderr @@ -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 index 0000000..a2f4311 --- /dev/null +++ b/ghc/tests/reader/should_compile/read016.hs @@ -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 index 0000000..3117391 --- /dev/null +++ b/ghc/tests/reader/should_compile/read017.hs @@ -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 index 0000000..ed3f07d --- /dev/null +++ b/ghc/tests/reader/should_compile/read018.hs @@ -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 index 0000000..2ba776d --- /dev/null +++ b/ghc/tests/reader/should_compile/read019.hs @@ -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 index 0000000..ea6c04d --- /dev/null +++ b/ghc/tests/reader/should_compile/read020.hs @@ -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 + + +