Test case for #9305
authorJoachim Breitner <mail@joachim-breitner.de>
Sat, 12 Jul 2014 22:27:54 +0000 (00:27 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Sat, 12 Jul 2014 22:27:54 +0000 (00:27 +0200)
testsuite/tests/typecheck/should_fail/T9305.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T9305.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T9305.hs b/testsuite/tests/typecheck/should_fail/T9305.hs
new file mode 100644 (file)
index 0000000..b6ad3b7
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE DeriveFunctor#-}
+module Main where
+
+data Event a b = Event a deriving (Functor)
+
+newtype F f = F (f (F f))
+
+data EventF a = EventF (F (Event a)) deriving (Functor)
diff --git a/testsuite/tests/typecheck/should_fail/T9305.stderr b/testsuite/tests/typecheck/should_fail/T9305.stderr
new file mode 100644 (file)
index 0000000..1610423
--- /dev/null
@@ -0,0 +1,8 @@
+
+T9305.hs:8:48:
+    No instance for (Functor Event)
+      arising from the first field of ‘EventF’ (type ‘F (Event a)’)
+    Possible fix:
+      use a standalone 'deriving instance' declaration,
+        so you can specify the instance context yourself
+    When deriving the instance for (Functor EventF)
index a1dab9d..c1dbd58 100644 (file)
@@ -334,4 +334,4 @@ test('T8912', normal, compile_fail, [''])
 test('T9033', normal, compile_fail, [''])
 test('T8883', normal, compile_fail, [''])
 test('T9196', normal, compile_fail, [''])
-
+test('T9305', normal, compile_fail, [''])