summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/T14932.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/deriving/should_compile/T14932.hs')
-rw-r--r--testsuite/tests/deriving/should_compile/T14932.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T14932.hs b/testsuite/tests/deriving/should_compile/T14932.hs
new file mode 100644
index 0000000000..bb82071bc2
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T14932.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE DeriveAnyClass #-}
+{-# LANGUAGE DefaultSignatures #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeOperators #-}
+module T14932 where
+
+import Data.Kind (Constraint, Type)
+
+class Zero a where
+ zero :: a
+ default zero :: (Code a ~ '[xs], All Zero xs) => a
+ zero = undefined
+
+type family All c xs :: Constraint where
+ All c '[] = ()
+ All c (x : xs) = (c x, All c xs)
+
+type family Code (a :: Type) :: [[Type]]
+type instance Code B1 = '[ '[ ] ]
+
+data B1 = B1
+ deriving Zero