summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/scripts/T7873.stderr9
-rw-r--r--testsuite/tests/polykinds/T11821.hs31
-rw-r--r--testsuite/tests/polykinds/all.T1
3 files changed, 36 insertions, 5 deletions
diff --git a/testsuite/tests/ghci/scripts/T7873.stderr b/testsuite/tests/ghci/scripts/T7873.stderr
index 3b6f4f64c1..ad8a55b70a 100644
--- a/testsuite/tests/ghci/scripts/T7873.stderr
+++ b/testsuite/tests/ghci/scripts/T7873.stderr
@@ -1,7 +1,6 @@
<interactive>:2:1: error:
- • Kind variable ‘k’ is implicitly bound in datatype
- ‘D1’, but does not appear as the kind of any
- of its type variables. Perhaps you meant
- to bind it (with TypeInType) explicitly somewhere?
- • In the data declaration for ‘D1’
+ Kind variable ‘k’ is implicitly bound in datatype
+ ‘D1’, but does not appear as the kind of any
+ of its type variables. Perhaps you meant
+ to bind it explicitly somewhere?
diff --git a/testsuite/tests/polykinds/T11821.hs b/testsuite/tests/polykinds/T11821.hs
new file mode 100644
index 0000000000..82efeb5f98
--- /dev/null
+++ b/testsuite/tests/polykinds/T11821.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE RankNTypes, DataKinds, PolyKinds, GADTs, TypeFamilies, UndecidableInstances #-}
+module NotInScope where
+
+import Data.Proxy
+
+type KindOf (a :: k) = ('KProxy :: KProxy k)
+data TyFun :: * -> * -> *
+type family Apply (f :: TyFun k1 k2 -> *) (x :: k1) :: k2
+
+data Lgo2 l1
+ l2
+ l3
+ (l4 :: b)
+ (l5 :: TyFun [a] b)
+ = forall (arg :: [a]) . KindOf (Apply (Lgo2 l1 l2 l3 l4) arg) ~ KindOf (Lgo l1 l2 l3 l4 arg) =>
+ Lgo2KindInference
+
+data Lgo1 l1
+ l2
+ l3
+ (l4 :: TyFun b (TyFun [a] b -> *))
+ = forall (arg :: b) . KindOf (Apply (Lgo1 l1 l2 l3) arg) ~ KindOf (Lgo2 l1 l2 l3 arg) =>
+ Lgo1KindInference
+
+type family Lgo f
+ z0
+ xs0
+ (a1 :: b)
+ (a2 :: [a]) :: b where
+ Lgo f z0 xs0 z '[] = z
+ Lgo f z0 xs0 z ('(:) x xs) = Apply (Apply (Lgo1 f z0 xs0) (Apply (Apply f z) x)) xs
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 17d02119b1..f2e274b060 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -146,3 +146,4 @@ test('T11611', normal, compile_fail, [''])
test('T11648', normal, compile, [''])
test('T11648b', normal, compile_fail, [''])
test('KindVType', normal, compile_fail, [''])
+test('T11821', normal, compile, [''])