summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/T18055.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_compile/T18055.hs')
-rw-r--r--testsuite/tests/deriving/should_compile/T18055.hs41
1 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T18055.hs b/testsuite/tests/deriving/should_compile/T18055.hs
new file mode 100644
index 0000000000..35f3750840
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T18055.hs
@@ -0,0 +1,41 @@
+{-# LANGUAGE DeriveAnyClass #-}
+{-# LANGUAGE DerivingVia #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeFamilies #-}
+module Bug where
+
+import Data.Kind
+
+-----
+
+data Block m = Block
+
+class NoThunks m where
+
+newtype AllowThunk a = AllowThunk a
+
+class GetHeader blk where
+ data family Header blk :: Type
+
+instance GetHeader (Block m) where
+ newtype Header (Block m) = BlockHeader { main :: Header m }
+ deriving NoThunks via AllowThunk (Header (Block m))
+
+-----
+
+class C a where
+ data D a
+
+class X a b
+
+instance C (Maybe a) where
+ data D (Maybe a) deriving (X a)
+
+instance C [a] where
+ newtype D [a] = MkDList Bool
+
+newtype MyList a = MkMyList [a]
+
+instance C (MyList a) where
+ newtype D (MyList a) = MkDMyList Bool
+ deriving (X a) via D [a]