diff --git a/tests/deriving/should_fail/T5863a.hs b/tests/deriving/should_fail/T5863a.hs new file mode 100644 index 000000000..3506dcc04 --- /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 000000000..7b29ce032 --- /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 e7cb909c2..ad96a11f1 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, [''])