summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-07-11 12:04:46 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-07-11 12:04:46 +0100
commit81d8b1792d01e0645468e35e23e758dd9c7a6349 (patch)
tree31e8708e6117134bc8c84964e2f876257db66d37 /testsuite
parent9768c946ef1e15c636c098154eac082c813c87b7 (diff)
downloadhaskell-81d8b1792d01e0645468e35e23e758dd9c7a6349.tar.gz
Add test for Trac #15352
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/indexed-types/should_compile/T15352.hs31
-rw-r--r--testsuite/tests/indexed-types/should_compile/all.T2
2 files changed, 33 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T15352.hs b/testsuite/tests/indexed-types/should_compile/T15352.hs
new file mode 100644
index 0000000000..d83512f085
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_compile/T15352.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE TypeInType #-} -- or PolyKinds
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module T15352 where
+
+import Data.Kind
+
+class C (x :: Type) (y :: k) where
+ type F y
+
+
+type Hom k = k -> k -> Type
+
+type family Ob (p :: Hom k) :: k -> Constraint
+
+class ( obP ~ Ob p
+ , opP ~ Dom p
+ , obQ ~ Ob q
+ , opQ ~ Dom q
+ , p ~ Dom f
+ , q ~ Cod f
+ ) => Functor' (obP :: i -> Constraint)
+ (opP :: Hom i)
+ (p :: Hom i)
+ (obQ :: j -> Constraint)
+ (opQ :: Hom j)
+ (q :: Hom j)
+ (f :: i -> j) where
+ type Dom f :: Hom i
+ type Cod f :: Hom j
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index 3f2759132a..035c85d179 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -288,3 +288,5 @@ test('T15318', normal, compile, [''])
test('T15322', normal, compile, [''])
test('T15322a', normal, compile_fail, [''])
test('T15142', normal, compile, [''])
+test('T15352', normal, compile, [''])
+