diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/dependent/should_compile/T15666.hs | 29 | ||||
-rw-r--r-- | testsuite/tests/dependent/should_compile/all.T | 1 |
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, ['']) |