summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
-rw-r--r--testsuite/tests/typecheck/should_fail/T14048a.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T14048b.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/T14048c.stderr4
-rw-r--r--testsuite/tests/typecheck/should_fail/T16821.hs16
-rw-r--r--testsuite/tests/typecheck/should_fail/T16821.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/T16829a.hs10
-rw-r--r--testsuite/tests/typecheck/should_fail/T16829a.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T16829b.hs11
-rw-r--r--testsuite/tests/typecheck/should_fail/T16829b.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/UnliftedNewtypesConstraintFamily.stderr10
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T3
11 files changed, 68 insertions, 12 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T14048a.stderr b/testsuite/tests/typecheck/should_fail/T14048a.stderr
index 48a91c7525..d75b423df3 100644
--- a/testsuite/tests/typecheck/should_fail/T14048a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T14048a.stderr
@@ -1,5 +1,5 @@
T14048a.hs:6:1: error:
- • Kind signature on data type declaration has non-* return kind
- Constraint
+ • Kind signature on data type declaration has non-*
+ return kind ‘Constraint’
• In the data declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/T14048b.stderr b/testsuite/tests/typecheck/should_fail/T14048b.stderr
index fe78d9f7f5..4356d65ef7 100644
--- a/testsuite/tests/typecheck/should_fail/T14048b.stderr
+++ b/testsuite/tests/typecheck/should_fail/T14048b.stderr
@@ -1,6 +1,5 @@
T14048b.hs:7:1: error:
- • Kind signature on data type declaration has non-*
- and non-variable return kind
- Constraint
+ • Kind signature on data family declaration has non-TYPE
+ and non-variable return kind ‘Constraint’
• In the data family declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/T14048c.stderr b/testsuite/tests/typecheck/should_fail/T14048c.stderr
index 7e83d1924c..a0465fe4fc 100644
--- a/testsuite/tests/typecheck/should_fail/T14048c.stderr
+++ b/testsuite/tests/typecheck/should_fail/T14048c.stderr
@@ -1,5 +1,5 @@
T14048c.hs:9:1: error:
- • Kind signature on data type declaration has non-* return kind
- Constraint
+ • Kind signature on data instance declaration has non-*
+ return kind ‘Constraint’
• In the data instance declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/T16821.hs b/testsuite/tests/typecheck/should_fail/T16821.hs
new file mode 100644
index 0000000000..2b23b90a7b
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16821.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE UnliftedNewtypes #-}
+module T16821 where
+
+import Data.Kind
+
+type family Id (x :: Type) :: Type where
+ Id x = x
+
+newtype T :: Id Type where
+ MkT :: Int -> T
+
+f :: T -> T
+f (MkT x) = MkT (x + 1)
diff --git a/testsuite/tests/typecheck/should_fail/T16821.stderr b/testsuite/tests/typecheck/should_fail/T16821.stderr
new file mode 100644
index 0000000000..f5d77720c7
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16821.stderr
@@ -0,0 +1,5 @@
+
+T16821.hs:12:1: error:
+ • Kind signature on newtype declaration has non-TYPE
+ return kind ‘Id *’
+ • In the newtype declaration for ‘T’
diff --git a/testsuite/tests/typecheck/should_fail/T16829a.hs b/testsuite/tests/typecheck/should_fail/T16829a.hs
new file mode 100644
index 0000000000..20d8ace945
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16829a.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE TypeFamilies #-}
+module T16829a where
+
+import GHC.Exts
+
+newtype T :: TYPE IntRep where
+ MkT :: Int# -> T
diff --git a/testsuite/tests/typecheck/should_fail/T16829a.stderr b/testsuite/tests/typecheck/should_fail/T16829a.stderr
new file mode 100644
index 0000000000..7ea8845cc9
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16829a.stderr
@@ -0,0 +1,6 @@
+
+T16829a.hs:9:1: error:
+ • Kind signature on newtype declaration has non-*
+ return kind ‘TYPE 'IntRep’
+ Perhaps you intended to use UnliftedNewtypes
+ • In the newtype declaration for ‘T’
diff --git a/testsuite/tests/typecheck/should_fail/T16829b.hs b/testsuite/tests/typecheck/should_fail/T16829b.hs
new file mode 100644
index 0000000000..0375818d94
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16829b.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE TypeFamilies #-}
+module T16829b where
+
+import GHC.Exts
+
+data family T :: TYPE IntRep
+newtype instance T :: TYPE IntRep where
+ MkT :: Int# -> T
diff --git a/testsuite/tests/typecheck/should_fail/T16829b.stderr b/testsuite/tests/typecheck/should_fail/T16829b.stderr
new file mode 100644
index 0000000000..590a884dc8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T16829b.stderr
@@ -0,0 +1,6 @@
+
+T16829b.hs:10:1: error:
+ • Kind signature on newtype instance declaration has non-*
+ return kind ‘TYPE 'IntRep’
+ Perhaps you intended to use UnliftedNewtypes
+ • In the newtype instance declaration for ‘T’
diff --git a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesConstraintFamily.stderr b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesConstraintFamily.stderr
index 9c6816b3c1..93a48850dc 100644
--- a/testsuite/tests/typecheck/should_fail/UnliftedNewtypesConstraintFamily.stderr
+++ b/testsuite/tests/typecheck/should_fail/UnliftedNewtypesConstraintFamily.stderr
@@ -1,5 +1,5 @@
-UnliftedNewtypesConstraintFamily.hs:11:1:
- Kind signature on data type declaration has non-*
- and non-variable return kind
- Constraint
- In the data family declaration for ‘D’
+
+UnliftedNewtypesConstraintFamily.hs:11:1: error:
+ • Kind signature on data family declaration has non-TYPE
+ and non-variable return kind ‘Constraint’
+ • In the data family declaration for ‘D’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 0b0ae59391..fd6790bb46 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -524,6 +524,9 @@ test('T15883b', normal, compile_fail, [''])
test('T15883c', normal, compile_fail, [''])
test('T15883d', normal, compile_fail, [''])
test('T15883e', normal, compile_fail, [''])
+test('T16821', normal, compile_fail, [''])
+test('T16829a', normal, compile_fail, [''])
+test('T16829b', normal, compile_fail, [''])
test('UnliftedNewtypesFail', normal, compile_fail, [''])
test('UnliftedNewtypesNotEnabled', normal, compile_fail, [''])
test('UnliftedNewtypesCoerceFail', normal, compile_fail, [''])