From 36bc0530e62eae1de7c5fbb99ed292f5cc28cece Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 7 Apr 1998 07:49:43 +0000 Subject: [PATCH] [project @ 1998-04-07 07:49:39 by simonpj] Adding tcfail080 --- ghc/tests/typecheck/should_fail/Makefile | 1 + ghc/tests/typecheck/should_fail/tcfail080.hs | 13 +++++++++++++ ghc/tests/typecheck/should_fail/tcfail080.stderr | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 ghc/tests/typecheck/should_fail/tcfail080.hs create mode 100644 ghc/tests/typecheck/should_fail/tcfail080.stderr diff --git a/ghc/tests/typecheck/should_fail/Makefile b/ghc/tests/typecheck/should_fail/Makefile index b169c84..37b8b8e 100644 --- a/ghc/tests/typecheck/should_fail/Makefile +++ b/ghc/tests/typecheck/should_fail/Makefile @@ -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 index 0000000..f64fe1c --- /dev/null +++ b/ghc/tests/typecheck/should_fail/tcfail080.hs @@ -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 index 0000000..2c95b9c --- /dev/null +++ b/ghc/tests/typecheck/should_fail/tcfail080.stderr @@ -0,0 +1,7 @@ + +tcfail080.hs:7: + Too many parameters for class `Collection' + In the class declaration for `Collection' + + +Compilation had errors -- 1.7.10.4