summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs
new file mode 100644
index 0000000000..81a2041d2b
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesMultiFieldGadt.hs
@@ -0,0 +1,19 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE UnliftedNewtypes #-}
+
+-- In tcConDecl, there is a place where a panic can happen if
+-- a newtype has multiple fields. This test is here to make
+-- sure that the appropriate validity checks happen before
+-- we get to the panic. See Note [Kind-checking the field type].
+
+module UnliftedNewtypesMultiFieldGadt where
+
+import GHC.Exts
+import Data.Kind
+
+newtype Foo :: TYPE 'IntRep where
+ FooC :: Bool -> Char -> Foo