summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/T15831.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_compile/T15831.hs')
-rw-r--r--testsuite/tests/deriving/should_compile/T15831.hs33
1 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T15831.hs b/testsuite/tests/deriving/should_compile/T15831.hs
new file mode 100644
index 0000000000..309c8a8e3a
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T15831.hs
@@ -0,0 +1,33 @@
+{-# LANGUAGE DerivingVia #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneDeriving #-}
+module T15831 where
+
+import Data.Functor.Const (Const(..))
+import GHC.Exts (Any)
+
+newtype Age = MkAge Int
+ deriving Eq
+ via Const Int Any
+ deriving Ord
+ via Const Int (Any :: k)
+ deriving Read
+ via (forall k. Const Int (Any :: k))
+ deriving Show
+ via Const Int a
+ deriving Enum
+ via Const Int (a :: k)
+ deriving Bounded
+ via (forall a. Const Int a)
+ deriving Num
+ via (forall k (a :: k). Const Int a)
+
+newtype Age2 = MkAge2 Int
+deriving via Const Int Any instance Eq Age2
+deriving via Const Int (Any :: k) instance Ord Age2
+deriving via (forall k. Const Int (Any :: k)) instance Read Age2
+deriving via Const Int a instance Show Age2
+deriving via Const Int (a :: k) instance Enum Age2
+deriving via (forall a. Const Int a) instance Bounded Age2
+deriving via (forall k (a :: k). Const Int a) instance Num Age2