summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_fail/T5287.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_fail/T5287.hs')
-rw-r--r--testsuite/tests/deriving/should_fail/T5287.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_fail/T5287.hs b/testsuite/tests/deriving/should_fail/T5287.hs
new file mode 100644
index 0000000000..6495b62be9
--- /dev/null
+++ b/testsuite/tests/deriving/should_fail/T5287.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-}
+module Bug where
+class A a oops
+data D d = D d
+
+instance A a oops => Read (D a)
+-- Actually this instance is ambiguous
+-- and is now rightly rejected
+
+data E e = E (D e) deriving Read
+
+instance A Int Bool
+
+