[project @ 1997-11-10 17:06:45 by simonm]
authorsimonm <unknown>
Mon, 10 Nov 1997 17:06:47 +0000 (17:06 +0000)
committersimonm <unknown>
Mon, 10 Nov 1997 17:06:47 +0000 (17:06 +0000)
add test for declarations of non-existent methods

ghc/tests/typecheck/should_fail/tcfail077.hs [new file with mode: 0644]
ghc/tests/typecheck/should_fail/tcfail077.stderr [new file with mode: 0644]

diff --git a/ghc/tests/typecheck/should_fail/tcfail077.hs b/ghc/tests/typecheck/should_fail/tcfail077.hs
new file mode 100644 (file)
index 0000000..6070a5b
--- /dev/null
@@ -0,0 +1,8 @@
+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
diff --git a/ghc/tests/typecheck/should_fail/tcfail077.stderr b/ghc/tests/typecheck/should_fail/tcfail077.stderr
new file mode 100644 (file)
index 0000000..4988e5c
--- /dev/null
@@ -0,0 +1,4 @@
+tcfail077.hs:8: Class `Foo' does not have a method `op2'
+
+Compilation had errors