Adding missing test files for #9071
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 6 May 2014 08:46:14 +0000 (09:46 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 6 May 2014 08:46:14 +0000 (09:46 +0100)
testsuite/tests/deriving/should_fail/T9071-2.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9071.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9071.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9071_2.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9071_2.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T9071a.hs [new file with mode: 0644]

diff --git a/testsuite/tests/deriving/should_fail/T9071-2.hs b/testsuite/tests/deriving/should_fail/T9071-2.hs
new file mode 100644 (file)
index 0000000..7a2f474
--- /dev/null
@@ -0,0 +1,7 @@
+{-# LANGUAGE DeriveFunctor #-}
+module T9071_2 where
+
+newtype Mu f = Mu (f (Mu f))
+
+newtype K1 a b = K1 a
+newtype F1 a = F1 (Mu (K1 a)) deriving Functor
diff --git a/testsuite/tests/deriving/should_fail/T9071.hs b/testsuite/tests/deriving/should_fail/T9071.hs
new file mode 100644 (file)
index 0000000..dc64f42
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE DeriveFunctor #-}
+module T9071 where
+
+import T9071a
+
+newtype K a b = K a
+newtype F a = F (Mu (K a)) deriving Functor
+
diff --git a/testsuite/tests/deriving/should_fail/T9071.stderr b/testsuite/tests/deriving/should_fail/T9071.stderr
new file mode 100644 (file)
index 0000000..259adba
--- /dev/null
@@ -0,0 +1,10 @@
+[1 of 2] Compiling T9071a           ( T9071a.hs, T9071a.o )
+[2 of 2] Compiling T9071            ( T9071.hs, T9071.o )
+
+T9071.hs:7:37:
+    No instance for (Functor K)
+      arising from the first field of ‘F’ (type ‘Mu (K a)’)
+    Possible fix:
+      use a standalone 'deriving instance' declaration,
+        so you can specify the instance context yourself
+    When deriving the instance for (Functor F)
diff --git a/testsuite/tests/deriving/should_fail/T9071_2.hs b/testsuite/tests/deriving/should_fail/T9071_2.hs
new file mode 100644 (file)
index 0000000..7a2f474
--- /dev/null
@@ -0,0 +1,7 @@
+{-# LANGUAGE DeriveFunctor #-}
+module T9071_2 where
+
+newtype Mu f = Mu (f (Mu f))
+
+newtype K1 a b = K1 a
+newtype F1 a = F1 (Mu (K1 a)) deriving Functor
diff --git a/testsuite/tests/deriving/should_fail/T9071_2.stderr b/testsuite/tests/deriving/should_fail/T9071_2.stderr
new file mode 100644 (file)
index 0000000..ae0fcdb
--- /dev/null
@@ -0,0 +1,8 @@
+
+T9071_2.hs:7:40:
+    No instance for (Functor Mu)
+      arising from the first field of ‘F1’ (type ‘Mu (K1 a)’)
+    Possible fix:
+      use a standalone 'deriving instance' declaration,
+        so you can specify the instance context yourself
+    When deriving the instance for (Functor F1)
diff --git a/testsuite/tests/deriving/should_fail/T9071a.hs b/testsuite/tests/deriving/should_fail/T9071a.hs
new file mode 100644 (file)
index 0000000..bf3a126
--- /dev/null
@@ -0,0 +1,4 @@
+module T9071a where
+
+newtype Mu f = Mu (f (Mu f))
+