summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2018-09-25 08:33:06 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2018-09-25 08:33:15 -0400
commit2a9ceadfa07e2298ce934c6d304a3ba1f529ad93 (patch)
treed25a0b689159ce4873df63b0dd691ad74f1eac75 /testsuite
parent9bfbc4e16d511678cffa9f7f76b369c8cfca7a66 (diff)
downloadhaskell-2a9ceadfa07e2298ce934c6d304a3ba1f529ad93.tar.gz
Add regression test for #15666
Commit 59f38587d44efd00b10a6d98f6a7a1b22e87f13a ended up fixing #15666. Let's add a regression test to ensure that it stays fixed.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/dependent/should_compile/T15666.hs29
-rw-r--r--testsuite/tests/dependent/should_compile/all.T1
2 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/tests/dependent/should_compile/T15666.hs b/testsuite/tests/dependent/should_compile/T15666.hs
new file mode 100644
index 0000000000..022c3a0aee
--- /dev/null
+++ b/testsuite/tests/dependent/should_compile/T15666.hs
@@ -0,0 +1,29 @@
+{-# LANGUAGE
+ NoImplicitPrelude,
+ TypeInType, PolyKinds, DataKinds,
+ ScopedTypeVariables,
+ TypeFamilies,
+ UndecidableInstances
+#-}
+
+module T15666 where
+
+import Data.Kind(Type)
+
+data PolyType k (t :: k)
+
+type Wrap (t :: k) = PolyType k t
+type Unwrap pt = (GetType pt :: GetKind pt)
+
+type family GetKind (pt :: Type) :: Type where
+ GetKind (PolyType k t) = k
+
+type family GetType (pt :: Type) :: k where
+ GetType (PolyType k t) = t
+
+data Composite :: a -> b -> Type
+
+type family RecursiveWrap expr where
+ RecursiveWrap (Composite a b) =
+ Wrap (Composite (Unwrap (RecursiveWrap a)) (Unwrap (RecursiveWrap b)))
+ RecursiveWrap x = Wrap x
diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T
index 418fba2d85..5f6e901dcf 100644
--- a/testsuite/tests/dependent/should_compile/all.T
+++ b/testsuite/tests/dependent/should_compile/all.T
@@ -54,3 +54,4 @@ test('DkNameRes', normal, compile, [''])
test('T15346', normal, compile, [''])
test('T15419', normal, compile, [''])
test('T14066h', normal, compile, [''])
+test('T15666', normal, compile, [''])