diff options
Diffstat (limited to 'testsuite/tests/deriving')
52 files changed, 134 insertions, 105 deletions
diff --git a/testsuite/tests/deriving/should_compile/T12144_2.hs b/testsuite/tests/deriving/should_compile/T12144_2.hs index dc9f64e90e..d3e5f771db 100644 --- a/testsuite/tests/deriving/should_compile/T12144_2.hs +++ b/testsuite/tests/deriving/should_compile/T12144_2.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveAnyClass #-} module T12144_2 where diff --git a/testsuite/tests/deriving/should_compile/T14578.hs b/testsuite/tests/deriving/should_compile/T14578.hs index d0700ea9b0..231796cda9 100644 --- a/testsuite/tests/deriving/should_compile/T14578.hs +++ b/testsuite/tests/deriving/should_compile/T14578.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module T14578 where diff --git a/testsuite/tests/deriving/should_compile/T14579.hs b/testsuite/tests/deriving/should_compile/T14579.hs index 518dffe214..9addb5bc53 100644 --- a/testsuite/tests/deriving/should_compile/T14579.hs +++ b/testsuite/tests/deriving/should_compile/T14579.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} diff --git a/testsuite/tests/deriving/should_compile/T14933.hs b/testsuite/tests/deriving/should_compile/T14933.hs index de8562d189..5ab808365f 100644 --- a/testsuite/tests/deriving/should_compile/T14933.hs +++ b/testsuite/tests/deriving/should_compile/T14933.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE TypeFamilies #-} diff --git a/testsuite/tests/deriving/should_compile/T17339.hs b/testsuite/tests/deriving/should_compile/T17339.hs index 4312d2ffc4..a46e4c793d 100644 --- a/testsuite/tests/deriving/should_compile/T17339.hs +++ b/testsuite/tests/deriving/should_compile/T17339.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE MultiParamTypeClasses #-} diff --git a/testsuite/tests/deriving/should_compile/deriving-1935.hs b/testsuite/tests/deriving/should_compile/deriving-1935.hs index d33b21af13..af62a747d4 100644 --- a/testsuite/tests/deriving/should_compile/deriving-1935.hs +++ b/testsuite/tests/deriving/should_compile/deriving-1935.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# OPTIONS_GHC -XDeriveDataTypeable #-} -- #1935 diff --git a/testsuite/tests/deriving/should_compile/deriving-1935.stderr b/testsuite/tests/deriving/should_compile/deriving-1935.stderr index 091990bcd9..3864e8e2f0 100644 --- a/testsuite/tests/deriving/should_compile/deriving-1935.stderr +++ b/testsuite/tests/deriving/should_compile/deriving-1935.stderr @@ -1,15 +1,15 @@ -deriving-1935.hs:17:11: warning: [-Wmissing-methods (in -Wdefault)] +deriving-1935.hs:18:11: warning: [-Wmissing-methods (in -Wdefault)] • No explicit implementation for either ‘==’ or ‘/=’ • In the instance declaration for ‘Eq (T a)’ -deriving-1935.hs:20:11: warning: [-Wmissing-methods (in -Wdefault)] +deriving-1935.hs:21:11: warning: [-Wmissing-methods (in -Wdefault)] • No explicit implementation for either ‘==’ or ‘/=’ • In the instance declaration for ‘Eq (S a)’ -deriving-1935.hs:21:11: warning: [-Wmissing-methods (in -Wdefault)] +deriving-1935.hs:22:11: warning: [-Wmissing-methods (in -Wdefault)] • No explicit implementation for either ‘compare’ or ‘<=’ • In the instance declaration for ‘Ord (S a)’ diff --git a/testsuite/tests/deriving/should_compile/drv-empty-data.hs b/testsuite/tests/deriving/should_compile/drv-empty-data.hs index 383ce8f9f7..0383b29dbb 100644 --- a/testsuite/tests/deriving/should_compile/drv-empty-data.hs +++ b/testsuite/tests/deriving/should_compile/drv-empty-data.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE RoleAnnotations #-} {-# LANGUAGE DeriveTraversable, DeriveGeneric, EmptyCase, DeriveDataTypeable, StandaloneDeriving, DeriveLift #-} diff --git a/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.hs b/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.hs index 712f14a3b5..52e845798a 100644 --- a/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.hs +++ b/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleContexts, DatatypeContexts #-} diff --git a/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.stderr b/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.stderr index ceae10cabd..e8dc7162c2 100644 --- a/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.stderr +++ b/testsuite/tests/deriving/should_compile/drv-foldable-traversable1.stderr @@ -1,3 +1,3 @@ -drv-foldable-traversable1.hs:3:32: - Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. +drv-foldable-traversable1.hs:4:32: warning: + -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. diff --git a/testsuite/tests/deriving/should_compile/drv-functor1.hs b/testsuite/tests/deriving/should_compile/drv-functor1.hs index 040d531341..2a09ab0b0e 100644 --- a/testsuite/tests/deriving/should_compile/drv-functor1.hs +++ b/testsuite/tests/deriving/should_compile/drv-functor1.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE RankNTypes #-} diff --git a/testsuite/tests/deriving/should_compile/drv-functor1.stderr b/testsuite/tests/deriving/should_compile/drv-functor1.stderr index a531dc56ef..5592b7d141 100644 --- a/testsuite/tests/deriving/should_compile/drv-functor1.stderr +++ b/testsuite/tests/deriving/should_compile/drv-functor1.stderr @@ -1,3 +1,3 @@ -drv-functor1.hs:5:14: - Warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. +drv-functor1.hs:6:14: warning: + -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. diff --git a/testsuite/tests/deriving/should_fail/T10598_fail2.hs b/testsuite/tests/deriving/should_fail/T10598_fail2.hs index ba77fe0fbf..7bffcf0c64 100644 --- a/testsuite/tests/deriving/should_fail/T10598_fail2.hs +++ b/testsuite/tests/deriving/should_fail/T10598_fail2.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DerivingStrategies #-} module T10598_fail2 where diff --git a/testsuite/tests/deriving/should_fail/T10598_fail2.stderr b/testsuite/tests/deriving/should_fail/T10598_fail2.stderr index 5ddd81dd1e..227be95c02 100644 --- a/testsuite/tests/deriving/should_fail/T10598_fail2.stderr +++ b/testsuite/tests/deriving/should_fail/T10598_fail2.stderr @@ -1,11 +1,11 @@ -T10598_fail2.hs:4:37: error: +T10598_fail2.hs:5:37: error: • Can't make a derived instance of ‘Eq A’ with the anyclass strategy: Try enabling DeriveAnyClass • In the data declaration for ‘A’ -T10598_fail2.hs:5:37: error: +T10598_fail2.hs:6:37: error: • Can't make a derived instance of ‘Eq B’ with the newtype strategy: Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension diff --git a/testsuite/tests/deriving/should_fail/T10598_fail3.hs b/testsuite/tests/deriving/should_fail/T10598_fail3.hs index 23f9ad987f..11e3e67e76 100644 --- a/testsuite/tests/deriving/should_fail/T10598_fail3.hs +++ b/testsuite/tests/deriving/should_fail/T10598_fail3.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE Safe #-} diff --git a/testsuite/tests/deriving/should_fail/T10598_fail3.stderr b/testsuite/tests/deriving/should_fail/T10598_fail3.stderr index c3f4e123b7..1ebc9c9c93 100644 --- a/testsuite/tests/deriving/should_fail/T10598_fail3.stderr +++ b/testsuite/tests/deriving/should_fail/T10598_fail3.stderr @@ -1,4 +1,4 @@ -T10598_fail3.hs:8:36: error: +T10598_fail3.hs:9:36: error: • Generic instances can only be derived in Safe Haskell using the stock strategy. • In the instance declaration for ‘Generic T’ diff --git a/testsuite/tests/deriving/should_fail/T10598_fail6.hs b/testsuite/tests/deriving/should_fail/T10598_fail6.hs index 673bfcc971..8ed5cdd262 100644 --- a/testsuite/tests/deriving/should_fail/T10598_fail6.hs +++ b/testsuite/tests/deriving/should_fail/T10598_fail6.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} module T10598_fail6 where diff --git a/testsuite/tests/deriving/should_fail/T10598_fail6.stderr b/testsuite/tests/deriving/should_fail/T10598_fail6.stderr index a80e5bab56..0de1fe50bf 100644 --- a/testsuite/tests/deriving/should_fail/T10598_fail6.stderr +++ b/testsuite/tests/deriving/should_fail/T10598_fail6.stderr @@ -1,5 +1,5 @@ -T10598_fail6.hs:5:41: error: +T10598_fail6.hs:6:41: error: • Can't make a derived instance of ‘Functor F’ (even with cunning GeneralizedNewtypeDeriving): You need DeriveFunctor to derive an instance for this class diff --git a/testsuite/tests/deriving/should_fail/T10684.hs b/testsuite/tests/deriving/should_fail/T10684.hs index fdda0c7e46..ae532a15bf 100644 --- a/testsuite/tests/deriving/should_fail/T10684.hs +++ b/testsuite/tests/deriving/should_fail/T10684.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} module A where import GHC.Generics data A = A deriving (Show, Generic) diff --git a/testsuite/tests/deriving/should_fail/T10684.stderr b/testsuite/tests/deriving/should_fail/T10684.stderr index 6cdbac2301..0724f8ec84 100644 --- a/testsuite/tests/deriving/should_fail/T10684.stderr +++ b/testsuite/tests/deriving/should_fail/T10684.stderr @@ -1,5 +1,5 @@ -T10684.hs:3:28: error: +T10684.hs:4:28: error: • Can't make a derived instance of ‘Generic A’: You need DeriveGeneric to derive an instance for this class • In the data declaration for ‘A’ diff --git a/testsuite/tests/deriving/should_fail/T1133A.hs b/testsuite/tests/deriving/should_fail/T1133A.hs index 2c8421aaf1..743772dd14 100644 --- a/testsuite/tests/deriving/should_fail/T1133A.hs +++ b/testsuite/tests/deriving/should_fail/T1133A.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} module T1133A where diff --git a/testsuite/tests/deriving/should_fail/T1133A.stderr b/testsuite/tests/deriving/should_fail/T1133A.stderr index 23b93409da..1c8f686f2a 100644 --- a/testsuite/tests/deriving/should_fail/T1133A.stderr +++ b/testsuite/tests/deriving/should_fail/T1133A.stderr @@ -1,7 +1,7 @@ -T1133A.hs:6:28: - Can't make a derived instance of ‘Enum X’: - ‘X’ must be an enumeration type - (an enumeration consists of one or more nullary, non-GADT constructors) - Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension - In the newtype declaration for ‘X’ +T1133A.hs:7:28: error: + • Can't make a derived instance of ‘Enum X’: + ‘X’ must be an enumeration type + (an enumeration consists of one or more nullary, non-GADT constructors) + Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension + • In the newtype declaration for ‘X’ diff --git a/testsuite/tests/deriving/should_fail/T12801.hs b/testsuite/tests/deriving/should_fail/T12801.hs index 22bbdf0aae..6bb773a22d 100644 --- a/testsuite/tests/deriving/should_fail/T12801.hs +++ b/testsuite/tests/deriving/should_fail/T12801.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} data Container = Container [Wibble Int] deriving (Eq, Show) diff --git a/testsuite/tests/deriving/should_fail/T12801.stderr b/testsuite/tests/deriving/should_fail/T12801.stderr index 7bc63df715..cd3193aabe 100644 --- a/testsuite/tests/deriving/should_fail/T12801.stderr +++ b/testsuite/tests/deriving/should_fail/T12801.stderr @@ -1,5 +1,5 @@ -T12801.hs:8:17: error: +T12801.hs:9:17: error: • Can't make a derived instance of ‘Functor Wibble’: You need DeriveFunctor to derive an instance for this class • In the data declaration for ‘Wibble’ diff --git a/testsuite/tests/deriving/should_fail/T16181.hs b/testsuite/tests/deriving/should_fail/T16181.hs index 29692dd1a1..b54991c153 100644 --- a/testsuite/tests/deriving/should_fail/T16181.hs +++ b/testsuite/tests/deriving/should_fail/T16181.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE KindSignatures #-} module T16181 where diff --git a/testsuite/tests/deriving/should_fail/T16181.stderr b/testsuite/tests/deriving/should_fail/T16181.stderr index cbac319a2c..ed08f53bb2 100644 --- a/testsuite/tests/deriving/should_fail/T16181.stderr +++ b/testsuite/tests/deriving/should_fail/T16181.stderr @@ -1,19 +1,19 @@ -T16181.hs:13:13: error: +T16181.hs:14:13: error: • Cannot eta-reduce to an instance of form instance (...) => Show1 (FlipConst a) • In the newtype declaration for ‘FlipConst’ -T16181.hs:13:20: error: +T16181.hs:14:20: error: • Cannot eta-reduce to an instance of form instance (...) => Eq1 (FlipConst a) • In the newtype declaration for ‘FlipConst’ -T16181.hs:18:14: error: +T16181.hs:19:14: error: • Cannot eta-reduce to an instance of form instance (...) => MonadTrans (Q x) • In the newtype declaration for ‘Q’ -T16181.hs:25:12: error: +T16181.hs:26:12: error: • Cannot eta-reduce to an instance of form instance (...) => C T • In the data declaration for ‘T’ diff --git a/testsuite/tests/deriving/should_fail/T1830_1.hs b/testsuite/tests/deriving/should_fail/T1830_1.hs index e3c2889c1c..a3ddece390 100644 --- a/testsuite/tests/deriving/should_fail/T1830_1.hs +++ b/testsuite/tests/deriving/should_fail/T1830_1.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} module T1830_1 where import Language.Haskell.TH.Syntax (Lift) diff --git a/testsuite/tests/deriving/should_fail/T1830_1.stderr b/testsuite/tests/deriving/should_fail/T1830_1.stderr index c869b0cd16..f4e5417710 100644 --- a/testsuite/tests/deriving/should_fail/T1830_1.stderr +++ b/testsuite/tests/deriving/should_fail/T1830_1.stderr @@ -1,5 +1,5 @@ -T1830_1.hs:5:29: error: - Can't make a derived instance of ‘Lift (Foo a)’: - You need DeriveLift to derive an instance for this class - In the data declaration for ‘Foo’ +T1830_1.hs:6:29: error: + • Can't make a derived instance of ‘Lift (Foo a)’: + You need DeriveLift to derive an instance for this class + • In the data declaration for ‘Foo’ diff --git a/testsuite/tests/deriving/should_fail/T3833.hs b/testsuite/tests/deriving/should_fail/T3833.hs index d1196c4112..eecb9e789e 100644 --- a/testsuite/tests/deriving/should_fail/T3833.hs +++ b/testsuite/tests/deriving/should_fail/T3833.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE StandaloneDeriving #-} -- {-# LANGUAGE GeneralizedNewtypeDeriving #-} diff --git a/testsuite/tests/deriving/should_fail/T3833.stderr b/testsuite/tests/deriving/should_fail/T3833.stderr index bf9a59cb8a..001fdc4c64 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: error: - Can't make a derived instance of ‘Monoid (DecodeMap e)’: - ‘Monoid’ is not a stock derivable class (Eq, Show, etc.) - Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension - In the stand-alone deriving instance for ‘Monoid (DecodeMap e)’ +T3833.hs:10:1: error: + • Can't make a derived instance of ‘Monoid (DecodeMap e)’: + ‘Monoid’ is not a stock 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.hs b/testsuite/tests/deriving/should_fail/T3834.hs index 614170198e..fa6df580e8 100644 --- a/testsuite/tests/deriving/should_fail/T3834.hs +++ b/testsuite/tests/deriving/should_fail/T3834.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE StandaloneDeriving #-} diff --git a/testsuite/tests/deriving/should_fail/T3834.stderr b/testsuite/tests/deriving/should_fail/T3834.stderr index 9d2223e1f8..23a605f614 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: error: - Can't make a derived instance of ‘C T’: - ‘C’ is not a stock derivable class (Eq, Show, etc.) - Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension - In the stand-alone deriving instance for ‘C T’ +T3834.hs:9:1: error: + • Can't make a derived instance of ‘C T’: + ‘C’ is not a stock 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/T5287.hs b/testsuite/tests/deriving/should_fail/T5287.hs index 6495b62be9..3af467c2cf 100644 --- a/testsuite/tests/deriving/should_fail/T5287.hs +++ b/testsuite/tests/deriving/should_fail/T5287.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE MultiParamTypeClasses, UndecidableInstances #-} module Bug where class A a oops diff --git a/testsuite/tests/deriving/should_fail/T5287.stderr b/testsuite/tests/deriving/should_fail/T5287.stderr index 20ad31dec3..479f1f84b5 100644 --- a/testsuite/tests/deriving/should_fail/T5287.stderr +++ b/testsuite/tests/deriving/should_fail/T5287.stderr @@ -1,10 +1,10 @@ -T5287.hs:6:10: error: +T5287.hs:7:10: error: • Could not deduce (A a oops0) from the context: A a oops bound by an instance declaration: forall a oops. A a oops => Read (D a) - at T5287.hs:6:10-31 + at T5287.hs:7:10-31 The type variable ‘oops0’ is ambiguous • In the ambiguity check for an instance declaration To defer the ambiguity check to use sites, enable AllowAmbiguousTypes diff --git a/testsuite/tests/deriving/should_fail/T7401_fail.hs b/testsuite/tests/deriving/should_fail/T7401_fail.hs index 730223f179..29ae0ae6db 100644 --- a/testsuite/tests/deriving/should_fail/T7401_fail.hs +++ b/testsuite/tests/deriving/should_fail/T7401_fail.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} module T7401_fail where data D deriving Eq diff --git a/testsuite/tests/deriving/should_fail/T7401_fail.stderr b/testsuite/tests/deriving/should_fail/T7401_fail.stderr index feb841f962..7f26d3b9e4 100644 --- a/testsuite/tests/deriving/should_fail/T7401_fail.stderr +++ b/testsuite/tests/deriving/should_fail/T7401_fail.stderr @@ -1,5 +1,5 @@ -T7401_fail.hs:3:17: error: +T7401_fail.hs:4:17: error: • Can't make a derived instance of ‘Eq D’: ‘D’ must have at least one data constructor Use EmptyDataDeriving to enable deriving for empty data types diff --git a/testsuite/tests/deriving/should_fail/T8851.hs b/testsuite/tests/deriving/should_fail/T8851.hs index 8b5c0e579d..9015d2be35 100644 --- a/testsuite/tests/deriving/should_fail/T8851.hs +++ b/testsuite/tests/deriving/should_fail/T8851.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE GeneralizedNewtypeDeriving, ConstrainedClassMethods #-} module T8851 where diff --git a/testsuite/tests/deriving/should_fail/T8851.stderr b/testsuite/tests/deriving/should_fail/T8851.stderr index dd4a614785..c4bfff3559 100644 --- a/testsuite/tests/deriving/should_fail/T8851.stderr +++ b/testsuite/tests/deriving/should_fail/T8851.stderr @@ -1,11 +1,11 @@ -T8851.hs:24:12: error: - Couldn't match type ‘Parser’ with ‘MyParser’ - arising from the coercion of the method ‘notFollowedBy’ - from type ‘forall a. - (Monad Parser, Show a) => - Parser a -> Parser ()’ - to type ‘forall a. - (Monad MyParser, Show a) => - MyParser a -> MyParser ()’ - When deriving the instance for (Parsing MyParser) +T8851.hs:25:12: error: + • Couldn't match type ‘Parser’ with ‘MyParser’ + arising from the coercion of the method ‘notFollowedBy’ + from type ‘forall a. + (Monad Parser, Show a) => + Parser a -> Parser ()’ + to type ‘forall a. + (Monad MyParser, Show a) => + MyParser a -> MyParser ()’ + • When deriving the instance for (Parsing MyParser) diff --git a/testsuite/tests/deriving/should_fail/T9600.hs b/testsuite/tests/deriving/should_fail/T9600.hs index a6663ce8c8..0547e9dbee 100644 --- a/testsuite/tests/deriving/should_fail/T9600.hs +++ b/testsuite/tests/deriving/should_fail/T9600.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} 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 index 5c03f2efc2..734e3af997 100644 --- a/testsuite/tests/deriving/should_fail/T9600.stderr +++ b/testsuite/tests/deriving/should_fail/T9600.stderr @@ -1,6 +1,6 @@ -T9600.hs:3:39: error: - Can't make a derived instance of ‘Applicative Foo’: - ‘Applicative’ is not a stock derivable class (Eq, Show, etc.) - Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension - In the newtype declaration for ‘Foo’ +T9600.hs:4:39: error: + • Can't make a derived instance of ‘Applicative Foo’: + ‘Applicative’ is not a stock 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/deriving-via-fail.hs b/testsuite/tests/deriving/should_fail/deriving-via-fail.hs index 0cb521de78..95c462a6ea 100644 --- a/testsuite/tests/deriving/should_fail/deriving-via-fail.hs +++ b/testsuite/tests/deriving/should_fail/deriving-via-fail.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} diff --git a/testsuite/tests/deriving/should_fail/deriving-via-fail.stderr b/testsuite/tests/deriving/should_fail/deriving-via-fail.stderr index 5179f53c03..ea07442a82 100644 --- a/testsuite/tests/deriving/should_fail/deriving-via-fail.stderr +++ b/testsuite/tests/deriving/should_fail/deriving-via-fail.stderr @@ -1,28 +1,28 @@ -deriving-via-fail.hs:9:34: error: +deriving-via-fail.hs:10:34: error: • Couldn't match representation of type ‘a’ with that of ‘b’ arising from the coercion of the method ‘showsPrec’ from type ‘Int -> Identity b -> ShowS’ to type ‘Int -> Foo1 a -> ShowS’ ‘a’ is a rigid type variable bound by the deriving clause for ‘Show (Foo1 a)’ - at deriving-via-fail.hs:9:34-37 + at deriving-via-fail.hs:10:34-37 ‘b’ is a rigid type variable bound by the deriving clause for ‘Show (Foo1 a)’ - at deriving-via-fail.hs:9:34-37 + at deriving-via-fail.hs:10:34-37 • When deriving the instance for (Show (Foo1 a)) -deriving-via-fail.hs:12:12: error: +deriving-via-fail.hs:13:12: error: • Cannot derive instance via ‘fooo’ Class ‘Category’ expects an argument of kind ‘* -> * -> *’, but ‘fooo’ has kind ‘*’ • In the newtype declaration for ‘Foo2’ -deriving-via-fail.hs:15:20: error: +deriving-via-fail.hs:16:20: error: • Couldn't match representation of type ‘a’ with that of ‘Foo3’ arising from the coercion of the method ‘==’ from type ‘a -> a -> Bool’ to type ‘Foo3 -> Foo3 -> Bool’ ‘a’ is a rigid type variable bound by the deriving clause for ‘Eq Foo3’ - at deriving-via-fail.hs:15:20-21 + at deriving-via-fail.hs:16:20-21 • When deriving the instance for (Eq Foo3) diff --git a/testsuite/tests/deriving/should_fail/deriving-via-fail4.hs b/testsuite/tests/deriving/should_fail/deriving-via-fail4.hs index 2e16abfa20..e58ffca658 100644 --- a/testsuite/tests/deriving/should_fail/deriving-via-fail4.hs +++ b/testsuite/tests/deriving/should_fail/deriving-via-fail4.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} diff --git a/testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr b/testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr index 9c4ee15209..9c1b305fbf 100644 --- a/testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr +++ b/testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr @@ -1,18 +1,18 @@ -deriving-via-fail4.hs:14:12: error: +deriving-via-fail4.hs:15:12: error: • Couldn't match representation of type ‘Int’ with that of ‘Char’ arising from the coercion of the method ‘==’ from type ‘Char -> Char -> Bool’ to type ‘F1 -> F1 -> Bool’ • When deriving the instance for (Eq F1) -deriving-via-fail4.hs:17:13: error: +deriving-via-fail4.hs:18:13: error: • Couldn't match representation of type ‘a’ with that of ‘a1’ arising from the coercion of the method ‘c’ from type ‘a -> a -> Bool’ to type ‘a -> F2 a1 -> Bool’ ‘a’ is a rigid type variable bound by the deriving clause for ‘C a (F2 a1)’ - at deriving-via-fail4.hs:17:13-15 + at deriving-via-fail4.hs:18:13-15 ‘a1’ is a rigid type variable bound by the deriving clause for ‘C a (F2 a1)’ - at deriving-via-fail4.hs:17:13-15 + at deriving-via-fail4.hs:18:13-15 • When deriving the instance for (C a (F2 a1)) diff --git a/testsuite/tests/deriving/should_fail/drvfail-functor1.hs b/testsuite/tests/deriving/should_fail/drvfail-functor1.hs index 94ebd925b8..aef52421e0 100644 --- a/testsuite/tests/deriving/should_fail/drvfail-functor1.hs +++ b/testsuite/tests/deriving/should_fail/drvfail-functor1.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} module ShouldFail where -- Derive Functor without a DeriveFunctor language pragma diff --git a/testsuite/tests/deriving/should_fail/drvfail-functor1.stderr b/testsuite/tests/deriving/should_fail/drvfail-functor1.stderr index bff4d27a49..07ce81f4ab 100644 --- a/testsuite/tests/deriving/should_fail/drvfail-functor1.stderr +++ b/testsuite/tests/deriving/should_fail/drvfail-functor1.stderr @@ -1,5 +1,5 @@ -drvfail-functor1.hs:6:14: - Can't make a derived instance of ‘Functor List’: - You need DeriveFunctor to derive an instance for this class - In the data declaration for ‘List’ +drvfail-functor1.hs:7:14: error: + • Can't make a derived instance of ‘Functor List’: + You need DeriveFunctor to derive an instance for this class + • In the data declaration for ‘List’ diff --git a/testsuite/tests/deriving/should_fail/drvfail-functor2.hs b/testsuite/tests/deriving/should_fail/drvfail-functor2.hs index 77e17cf381..be5413f773 100644 --- a/testsuite/tests/deriving/should_fail/drvfail-functor2.hs +++ b/testsuite/tests/deriving/should_fail/drvfail-functor2.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# LANGUAGE DeriveFunctor, DatatypeContexts #-} module ShouldFail where diff --git a/testsuite/tests/deriving/should_fail/drvfail-functor2.stderr b/testsuite/tests/deriving/should_fail/drvfail-functor2.stderr index e0aa34656c..1c3a0238a4 100644 --- a/testsuite/tests/deriving/should_fail/drvfail-functor2.stderr +++ b/testsuite/tests/deriving/should_fail/drvfail-functor2.stderr @@ -1,31 +1,31 @@ -drvfail-functor2.hs:1:29: Warning: +drvfail-functor2.hs:2:29: warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. -drvfail-functor2.hs:7:14: - Can't make a derived instance of ‘Functor InFunctionArgument’: - Constructor ‘InFunctionArgument’ must not use the type variable in a function argument - In the newtype declaration for ‘InFunctionArgument’ +drvfail-functor2.hs:8:14: error: + • Can't make a derived instance of ‘Functor InFunctionArgument’: + Constructor ‘InFunctionArgument’ must not use the type variable in a function argument + • In the newtype declaration for ‘InFunctionArgument’ -drvfail-functor2.hs:10:14: - Can't make a derived instance of ‘Functor OnSecondArg’: - Constructor ‘OnSecondArg’ must use the type variable only as the last argument of a data type - In the newtype declaration for ‘OnSecondArg’ +drvfail-functor2.hs:11:14: error: + • Can't make a derived instance of ‘Functor OnSecondArg’: + Constructor ‘OnSecondArg’ must use the type variable only as the last argument of a data type + • In the newtype declaration for ‘OnSecondArg’ -drvfail-functor2.hs:15:14: - Cannot derive well-kinded instance of form ‘Functor (NoArguments ...)’ - Class ‘Functor’ expects an argument of kind ‘* -> *’ - In the newtype declaration for ‘NoArguments’ +drvfail-functor2.hs:16:14: error: + • Cannot derive well-kinded instance of form ‘Functor (NoArguments ...)’ + Class ‘Functor’ expects an argument of kind ‘* -> *’ + • In the newtype declaration for ‘NoArguments’ -drvfail-functor2.hs:20:14: - Can't make a derived instance of ‘Functor StupidConstraint’: - Data type ‘StupidConstraint’ must not have a class context: Eq a - In the data declaration for ‘StupidConstraint’ +drvfail-functor2.hs:21:14: error: + • Can't make a derived instance of ‘Functor StupidConstraint’: + Data type ‘StupidConstraint’ must not have a class context: Eq a + • In the data declaration for ‘StupidConstraint’ -drvfail-functor2.hs:26:14: - No instance for (Functor NoFunctor) - arising from the first field of ‘UseNoFunctor’ (type ‘NoFunctor a’) - Possible fix: - use a standalone 'deriving instance' declaration, - so you can specify the instance context yourself - When deriving the instance for (Functor UseNoFunctor) +drvfail-functor2.hs:27:14: error: + • No instance for (Functor NoFunctor) + arising from the first field of ‘UseNoFunctor’ (type ‘NoFunctor a’) + Possible fix: + use a standalone 'deriving instance' declaration, + so you can specify the instance context yourself + • When deriving the instance for (Functor UseNoFunctor) diff --git a/testsuite/tests/deriving/should_fail/drvfail008.hs b/testsuite/tests/deriving/should_fail/drvfail008.hs index af8628b4d5..1636bd1353 100644 --- a/testsuite/tests/deriving/should_fail/drvfail008.hs +++ b/testsuite/tests/deriving/should_fail/drvfail008.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} -- Should fail without GeneralizedNewtypeDeriving -- Succeeds with GeneralizedNewtypeDeriving diff --git a/testsuite/tests/deriving/should_fail/drvfail008.stderr b/testsuite/tests/deriving/should_fail/drvfail008.stderr index dcd43eca62..e942f087e7 100644 --- a/testsuite/tests/deriving/should_fail/drvfail008.stderr +++ b/testsuite/tests/deriving/should_fail/drvfail008.stderr @@ -1,5 +1,5 @@ -drvfail008.hs:10:43: error: +drvfail008.hs:11:43: error: • Can't make a derived instance of ‘Monad M’: ‘Monad’ is not a stock derivable class (Eq, Show, etc.) Try GeneralizedNewtypeDeriving for GHC's newtype-deriving extension diff --git a/testsuite/tests/deriving/should_fail/drvfail015.hs b/testsuite/tests/deriving/should_fail/drvfail015.hs index 32d6134d34..8f1235c0b8 100644 --- a/testsuite/tests/deriving/should_fail/drvfail015.hs +++ b/testsuite/tests/deriving/should_fail/drvfail015.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE Haskell2010 #-} {-# OPTIONS_GHC -XStandaloneDeriving #-} module ShouldFail where diff --git a/testsuite/tests/deriving/should_fail/drvfail015.stderr b/testsuite/tests/deriving/should_fail/drvfail015.stderr index c38ff00456..b731032fc3 100644 --- a/testsuite/tests/deriving/should_fail/drvfail015.stderr +++ b/testsuite/tests/deriving/should_fail/drvfail015.stderr @@ -1,13 +1,13 @@ -drvfail015.hs:10:19: - Illegal instance declaration for ‘Eq T’ - (All instance types must be of the form (T t1 ... tn) - where T is not a synonym. - Use TypeSynonymInstances if you want to disable this.) - In the stand-alone deriving instance for ‘Eq T’ +drvfail015.hs:11:19: error: + • Illegal instance declaration for ‘Eq T’ + (All instance types must be of the form (T t1 ... tn) + where T is not a synonym. + Use TypeSynonymInstances if you want to disable this.) + • In the stand-alone deriving instance for ‘Eq T’ -drvfail015.hs:13:1: - Can't make a derived instance of ‘Eq Handle’: - The data constructors of ‘Handle’ are not all in scope - so you cannot derive an instance for it - In the stand-alone deriving instance for ‘Eq Handle’ +drvfail015.hs:14:1: error: + • Can't make a derived instance of ‘Eq Handle’: + The data constructors of ‘Handle’ are not all in scope + so you cannot derive an instance for it + • In the stand-alone deriving instance for ‘Eq Handle’ |