[project @ 1998-04-07 07:49:39 by simonpj]
authorsimonpj <unknown>
Tue, 7 Apr 1998 07:49:43 +0000 (07:49 +0000)
committersimonpj <unknown>
Tue, 7 Apr 1998 07:49:43 +0000 (07:49 +0000)
Adding tcfail080

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

index b169c84..37b8b8e 100644 (file)
@@ -6,5 +6,6 @@ HC_OPTS += -noC
 
 tcfail045_HC_OPTS = -fglasgow-exts
 tcfail068_HC_OPTS = -fglasgow-exts
+tcfail080_HC_OPTS = -fglasgow-exts
 
 include $(TOP)/mk/target.mk
diff --git a/ghc/tests/typecheck/should_fail/tcfail080.hs b/ghc/tests/typecheck/should_fail/tcfail080.hs
new file mode 100644 (file)
index 0000000..f64fe1c
--- /dev/null
@@ -0,0 +1,13 @@
+--!!! Multi-param type classes test: ambiguity bug
+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)
+
+
diff --git a/ghc/tests/typecheck/should_fail/tcfail080.stderr b/ghc/tests/typecheck/should_fail/tcfail080.stderr
new file mode 100644 (file)
index 0000000..2c95b9c
--- /dev/null
@@ -0,0 +1,7 @@
+tcfail080.hs:7:
+    Too many parameters for class `Collection'
+    In the class declaration for `Collection'
+
+
+Compilation had errors