summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/drv003.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_compile/drv003.hs')
-rw-r--r--testsuite/tests/deriving/should_compile/drv003.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/drv003.hs b/testsuite/tests/deriving/should_compile/drv003.hs
new file mode 100644
index 0000000000..0b8149ce8a
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/drv003.hs
@@ -0,0 +1,17 @@
+-- !!! This is the example given in TcDeriv
+--
+module ShouldSucceed where
+
+data T a b
+ = C1 (Foo a) (Bar b)
+ | C2 Int (T b a)
+ | C3 (T a a)
+ deriving Eq
+
+data Foo a = MkFoo Double a deriving ()
+instance (Eq a) => Eq (Foo a)
+
+data Bar a = MkBar Int Int deriving ()
+instance (Ping b) => Eq (Bar b)
+
+class Ping a