[commit: ghc] master: Add regression test for #15666 (2a9cead)

git at git.haskell.org git at git.haskell.org
Tue Sep 25 12:40:42 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2a9ceadfa07e2298ce934c6d304a3ba1f529ad93/ghc

>---------------------------------------------------------------

commit 2a9ceadfa07e2298ce934c6d304a3ba1f529ad93
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Tue Sep 25 08:33:06 2018 -0400

    Add regression test for #15666
    
    Commit 59f38587d44efd00b10a6d98f6a7a1b22e87f13a ended up
    fixing #15666. Let's add a regression test to ensure that it stays
    fixed.


>---------------------------------------------------------------

2a9ceadfa07e2298ce934c6d304a3ba1f529ad93
 testsuite/tests/dependent/should_compile/T15666.hs | 29 ++++++++++++++++++++++
 testsuite/tests/dependent/should_compile/all.T     |  1 +
 2 files changed, 30 insertions(+)

diff --git a/testsuite/tests/dependent/should_compile/T15666.hs b/testsuite/tests/dependent/should_compile/T15666.hs
new file mode 100644
index 0000000..022c3a0
--- /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 418fba2..5f6e901 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, [''])



More information about the ghc-commits mailing list