[commit: testsuite] master: Add test for T5863 (48e8390)

José Pedro Magalhães jpm at cs.uu.nl
Tue May 21 17:03:40 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

https://github.com/ghc/testsuite/commit/48e8390401d17b5bbec412621ff1494550e0b5ed

>---------------------------------------------------------------

commit 48e8390401d17b5bbec412621ff1494550e0b5ed
Author: Jose Pedro Magalhaes <jpm at cs.ox.ac.uk>
Date:   Tue May 21 14:42:34 2013 +0100

    Add test for T5863
    
    As apparently there is already a test named T5863,
    I named this one T5863a.

>---------------------------------------------------------------

 tests/deriving/should_fail/T5863a.hs     |   12 ++++++++++++
 tests/deriving/should_fail/T5863a.stderr |   12 ++++++++++++
 tests/deriving/should_fail/all.T         |    1 +
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tests/deriving/should_fail/T5863a.hs b/tests/deriving/should_fail/T5863a.hs
new file mode 100644
index 0000000..3506dcc
--- /dev/null
+++ b/tests/deriving/should_fail/T5863a.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE DeriveDataTypeable, TypeFamilies #-}
+
+import Data.Typeable
+
+class C a where
+    data T a :: * 
+
+instance C Int where
+    data T Int = A1 deriving (Typeable)
+
+instance C Bool where
+    data T Bool = A2 deriving (Typeable)
diff --git a/tests/deriving/should_fail/T5863a.stderr b/tests/deriving/should_fail/T5863a.stderr
new file mode 100644
index 0000000..7b29ce0
--- /dev/null
+++ b/tests/deriving/should_fail/T5863a.stderr
@@ -0,0 +1,12 @@
+
+T5863a.hs:9:31:
+    Can't make a derived instance of ‛Typeable * (T Int)’:
+      Deriving Typeable is not allowed for family instances;
+      derive Typeable for ‛T’ alone
+    In the data instance declaration for ‛T’
+
+T5863a.hs:12:32:
+    Can't make a derived instance of ‛Typeable * (T Bool)’:
+      Deriving Typeable is not allowed for family instances;
+      derive Typeable for ‛T’ alone
+    In the data instance declaration for ‛T’
diff --git a/tests/deriving/should_fail/all.T b/tests/deriving/should_fail/all.T
index e7cb909..ad96a11 100644
--- a/tests/deriving/should_fail/all.T
+++ b/tests/deriving/should_fail/all.T
@@ -39,3 +39,4 @@ test('T1133A',
      extra_clean(['T1133A.o-boot', 'T1133A.hi-boot']),
      run_command,
      ['$MAKE --no-print-directory -s T1133A'])
+test('T5863a', normal, compile_fail, [''])





More information about the ghc-commits mailing list