Test Trac #10524
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 26 Jun 2015 15:00:45 +0000 (16:00 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 26 Jun 2015 16:53:35 +0000 (17:53 +0100)
testsuite/tests/deriving/should_fail/T10524.hs [new file with mode: 0644]
testsuite/tests/deriving/should_fail/T10524.stderr [new file with mode: 0644]
testsuite/tests/deriving/should_fail/all.T

diff --git a/testsuite/tests/deriving/should_fail/T10524.hs b/testsuite/tests/deriving/should_fail/T10524.hs
new file mode 100644 (file)
index 0000000..43d93bf
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE PolyKinds #-}
+module T10524 where
+
+import Data.Data
+
+newtype WrappedFunctor f a = WrapFunctor (f a) deriving (Data, Typeable)
+
diff --git a/testsuite/tests/deriving/should_fail/T10524.stderr b/testsuite/tests/deriving/should_fail/T10524.stderr
new file mode 100644 (file)
index 0000000..1569972
--- /dev/null
@@ -0,0 +1,10 @@
+
+T10524.hs:7:58: error:
+    No instance for (Typeable WrappedFunctor)
+      arising from the 'deriving' clause of a data type declaration
+      GHC can't yet do polykinded
+        Typeable (WrappedFunctor :: (k -> *) -> k -> *)
+    Possible fix:
+      use a standalone 'deriving instance' declaration,
+        so you can specify the instance context yourself
+    When deriving the instance for (Data (WrappedFunctor f a))
index adc72fc..2e25113 100644 (file)
@@ -54,3 +54,4 @@ test('T9071_2', normal, compile_fail, [''])
 test('T9687', normal, compile_fail, [''])
 
 test('T8984', normal, compile_fail, [''])
+test('T10524', normal, compile_fail, [''])