diff options
Diffstat (limited to 'testsuite/tests/deriving')
9 files changed, 34 insertions, 12 deletions
diff --git a/testsuite/tests/deriving/should_fail/T2721.stderr b/testsuite/tests/deriving/should_fail/T2721.stderr index 908db94dbe..693ccd2dbd 100644 --- a/testsuite/tests/deriving/should_fail/T2721.stderr +++ b/testsuite/tests/deriving/should_fail/T2721.stderr @@ -1,6 +1,6 @@ -T2721.hs:15:28: +T2721.hs:15:28: error: Can't make a derived instance of ‘C N’ - (even with cunning newtype deriving): + (even with cunning GeneralizedNewtypeDeriving): the class has associated types In the newtype declaration for ‘N’ diff --git a/testsuite/tests/deriving/should_fail/T3833.stderr b/testsuite/tests/deriving/should_fail/T3833.stderr index 4c6bf564ea..da7da919bc 100644 --- a/testsuite/tests/deriving/should_fail/T3833.stderr +++ b/testsuite/tests/deriving/should_fail/T3833.stderr @@ -1,6 +1,6 @@ -T3833.hs:9:1: +T3833.hs:9:1: error: Can't make a derived instance of ‘Monoid (DecodeMap e)’: - ‘Monoid’ is not a derivable class + ‘Monoid’ is not a standard derivable class (Eq, Show, etc.) Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension In the stand-alone deriving instance for ‘Monoid (DecodeMap e)’ diff --git a/testsuite/tests/deriving/should_fail/T3834.stderr b/testsuite/tests/deriving/should_fail/T3834.stderr index d732124454..3eec64a6c5 100644 --- a/testsuite/tests/deriving/should_fail/T3834.stderr +++ b/testsuite/tests/deriving/should_fail/T3834.stderr @@ -1,6 +1,6 @@ -T3834.hs:8:1: +T3834.hs:8:1: error: Can't make a derived instance of ‘C T’: - ‘C’ is not a derivable class + ‘C’ is not a standard derivable class (Eq, Show, etc.) Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension In the stand-alone deriving instance for ‘C T’ diff --git a/testsuite/tests/deriving/should_fail/T9600-1.hs b/testsuite/tests/deriving/should_fail/T9600-1.hs new file mode 100644 index 0000000000..8116d08728 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9600-1.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE GeneralizedNewtypeDeriving #-} + +import Control.Applicative + +newtype Foo a = Foo (a -> a) deriving Applicative diff --git a/testsuite/tests/deriving/should_fail/T9600-1.stderr b/testsuite/tests/deriving/should_fail/T9600-1.stderr new file mode 100644 index 0000000000..88d24079a0 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9600-1.stderr @@ -0,0 +1,6 @@ + +T9600-1.hs:5:39: error: + Can't make a derived instance of ‘Applicative Foo’ + (even with cunning GeneralizedNewtypeDeriving): + cannot eta-reduce the representation type enough + In the newtype declaration for ‘Foo’ diff --git a/testsuite/tests/deriving/should_fail/T9600.hs b/testsuite/tests/deriving/should_fail/T9600.hs new file mode 100644 index 0000000000..a6663ce8c8 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9600.hs @@ -0,0 +1,3 @@ +import Control.Applicative + +newtype Foo a = Foo (a -> a) deriving Applicative diff --git a/testsuite/tests/deriving/should_fail/T9600.stderr b/testsuite/tests/deriving/should_fail/T9600.stderr new file mode 100644 index 0000000000..2e88277f54 --- /dev/null +++ b/testsuite/tests/deriving/should_fail/T9600.stderr @@ -0,0 +1,6 @@ + +T9600.hs:3:39: error: + Can't make a derived instance of ‘Applicative Foo’: + ‘Applicative’ is not a standard derivable class (Eq, Show, etc.) + Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension + In the newtype declaration for ‘Foo’ diff --git a/testsuite/tests/deriving/should_fail/all.T b/testsuite/tests/deriving/should_fail/all.T index 2e2511305e..94120d2912 100644 --- a/testsuite/tests/deriving/should_fail/all.T +++ b/testsuite/tests/deriving/should_fail/all.T @@ -51,6 +51,8 @@ test('T6147', normal, compile_fail, ['']) test('T8851', normal, compile_fail, ['']) test('T9071', normal, multimod_compile_fail, ['T9071','']) test('T9071_2', normal, compile_fail, ['']) +test('T9600', normal, compile_fail, ['']) +test('T9600-1', normal, compile_fail, ['']) test('T9687', normal, compile_fail, ['']) test('T8984', normal, compile_fail, ['']) diff --git a/testsuite/tests/deriving/should_fail/drvfail009.stderr b/testsuite/tests/deriving/should_fail/drvfail009.stderr index b9dd90c758..563bc5aa8a 100644 --- a/testsuite/tests/deriving/should_fail/drvfail009.stderr +++ b/testsuite/tests/deriving/should_fail/drvfail009.stderr @@ -1,23 +1,23 @@ -drvfail009.hs:10:31: +drvfail009.hs:10:31: error: Expecting one more argument to ‘C’ Expected kind ‘* -> Constraint’, but ‘C’ has kind ‘* -> * -> Constraint’ In the newtype declaration for ‘T1’ -drvfail009.hs:13:31: +drvfail009.hs:13:31: error: Cannot derive well-kinded instance of form ‘Monad (T2 ...)’ Class ‘Monad’ expects an argument of kind ‘* -> *’ In the newtype declaration for ‘T2’ -drvfail009.hs:16:33: +drvfail009.hs:16:33: error: Can't make a derived instance of ‘Monad T3’ - (even with cunning newtype deriving): + (even with cunning GeneralizedNewtypeDeriving): cannot eta-reduce the representation type enough In the newtype declaration for ‘T3’ -drvfail009.hs:19:42: +drvfail009.hs:19:42: error: Can't make a derived instance of ‘Monad T4’ - (even with cunning newtype deriving): + (even with cunning GeneralizedNewtypeDeriving): cannot eta-reduce the representation type enough In the newtype declaration for ‘T4’ |