summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/ghci/scripts/T15872.hs12
-rw-r--r--testsuite/tests/ghci/scripts/T15872.script10
-rw-r--r--testsuite/tests/ghci/scripts/T15872.stdout16
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/T12102b.hs21
-rw-r--r--testsuite/tests/typecheck/should_fail/T12102b.stderr7
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
7 files changed, 68 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T15872.hs b/testsuite/tests/ghci/scripts/T15872.hs
new file mode 100644
index 0000000000..0f53a327b6
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T15872.hs
@@ -0,0 +1,12 @@
+{-# Language RankNTypes #-}
+{-# Language DataKinds #-}
+{-# Language PolyKinds #-}
+{-# Language GADTs #-}
+module T15872 where
+
+import Data.Kind
+
+data WHICH = OP | OPOP
+
+data Fun :: forall (a :: WHICH). a ~ OP => Type -> Type -> Type where
+ MkFun :: (a -> b) -> Fun a b
diff --git a/testsuite/tests/ghci/scripts/T15872.script b/testsuite/tests/ghci/scripts/T15872.script
new file mode 100644
index 0000000000..9a60bbd5f8
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T15872.script
@@ -0,0 +1,10 @@
+:l T15872
+
+:t MkFun
+:k Fun
+:i Fun
+
+:set -fprint-explicit-kinds
+:t MkFun
+:k Fun
+:i Fun
diff --git a/testsuite/tests/ghci/scripts/T15872.stdout b/testsuite/tests/ghci/scripts/T15872.stdout
new file mode 100644
index 0000000000..623631162a
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T15872.stdout
@@ -0,0 +1,16 @@
+MkFun :: (a -> b) -> Fun a b
+Fun :: (a ~ 'OP) => * -> * -> *
+data Fun b c where
+ MkFun :: (b -> c) -> Fun b c
+ -- Defined at T15872.hs:11:1
+MkFun
+ :: (a -> b) -> Fun @'OP @{'GHC.Types.Eq# @WHICH @'OP @'OP <>} a b
+Fun :: ((a :: WHICH) ~ ('OP :: WHICH)) => * -> * -> *
+type role Fun nominal nominal representational representational
+data Fun @(a :: WHICH)
+ @{a1 :: (a :: WHICH) ~ ('OP :: WHICH)}
+ b
+ c where
+ MkFun :: (b -> c)
+ -> Fun @'OP @{'GHC.Types.Eq# @WHICH @'OP @'OP <>} b c
+ -- Defined at T15872.hs:11:1
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index c2d9d9fc6e..53b4f26cb6 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -287,6 +287,7 @@ test('T15325', normal, ghci_script, ['T15325.script'])
test('T15591', normal, ghci_script, ['T15591.script'])
test('T15743b', normal, ghci_script, ['T15743b.script'])
test('T15827', normal, ghci_script, ['T15827.script'])
+test('T15872', normal, ghci_script, ['T15872.script'])
test('T15898', normal, ghci_script, ['T15898.script'])
test('T15941', normal, ghci_script, ['T15941.script'])
test('T16030', normal, ghci_script, ['T16030.script'])
diff --git a/testsuite/tests/typecheck/should_fail/T12102b.hs b/testsuite/tests/typecheck/should_fail/T12102b.hs
new file mode 100644
index 0000000000..8478059c8f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12102b.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TypeFamilies #-}
+module T12102b where
+
+import Data.Kind
+import GHC.TypeLits
+
+type family IsTypeLit a where
+ IsTypeLit Nat = 'True
+ IsTypeLit Symbol = 'True
+ IsTypeLit a = 'False
+
+data T :: forall a. (IsTypeLit a ~ 'True) => a -> Type where
+ MkNat :: T 42
+ MkSymbol :: T "Don't panic!"
+
+deriving instance Show (T a)
diff --git a/testsuite/tests/typecheck/should_fail/T12102b.stderr b/testsuite/tests/typecheck/should_fail/T12102b.stderr
new file mode 100644
index 0000000000..d93b7fda9c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12102b.stderr
@@ -0,0 +1,7 @@
+
+T12102b.hs:21:25: error:
+ • Couldn't match expected kind ‘'True’
+ with actual kind ‘IsTypeLit a0’
+ The type variable ‘a0’ is ambiguous
+ • In the first argument of ‘Show’, namely ‘(T a)’
+ In the stand-alone deriving instance for ‘Show (T a)’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index d155ca0e8c..fec3a3ae67 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -411,6 +411,7 @@ test('T12083a', normal, compile_fail, [''])
test('T12083b', normal, compile_fail, [''])
test('T11974b', normal, compile_fail, [''])
test('T12102', normal, compile, [''])
+test('T12102b', normal, compile_fail, [''])
test('T12151', normal, compile_fail, [''])
test('T7437', normal, compile_fail, [''])
test('T12177', normal, compile_fail, [''])