summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail106.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail106.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail106.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail106.hs b/testsuite/tests/typecheck/should_fail/tcfail106.hs
new file mode 100644
index 0000000000..22c732e4ce
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail106.hs
@@ -0,0 +1,15 @@
+-- This one risked building a recursive dictionary rather than
+-- failing, in GHC before 5.03. Actually, 5.02 managed it ok,
+-- but I think more by luck than good judgement.
+
+module ShouldFail where
+
+class S a
+class S a => C a where { opc :: a -> a }
+class S b => D b where { opd :: b -> b }
+
+instance C Int where
+ opc = opd
+
+instance D Int where
+ opd = opc