Add regression test for #13651
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 6 May 2017 16:37:00 +0000 (12:37 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Sat, 6 May 2017 16:37:04 +0000 (12:37 -0400)
Commit eb55ec2941239dee05afc6be818b129efe51660e ended up fixing #13651, so
let's add a regression test for it.

testsuite/tests/typecheck/should_compile/T13651.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

diff --git a/testsuite/tests/typecheck/should_compile/T13651.hs b/testsuite/tests/typecheck/should_compile/T13651.hs
new file mode 100644 (file)
index 0000000..43ae633
--- /dev/null
@@ -0,0 +1,14 @@
+{-# LANGUAGE TypeFamilies, TypeFamilyDependencies #-}
+module T13651 where
+
+type family F r s = f | f -> r s
+
+type instance F (Bar h (Foo r)) (Bar h (Foo s)) = Bar h (Bar r s)
+
+data Bar s b
+data Foo a
+
+foo :: (F cr cu ~ Bar h (Bar r u),
+        F cu cs ~ Bar (Foo h) (Bar u s))
+    => Bar h (Bar r u) -> Bar (Foo h) (Bar u s) -> Foo (cr -> cs)
+foo = undefined
index 34b8184..6db86a8 100644 (file)
@@ -558,3 +558,4 @@ test('T13526', normal, compile, [''])
 test('T13603', normal, compile, [''])
 test('T13333', normal, compile, [''])
 test('T13585', [extra_files(['T13585.hs', 'T13585a.hs', 'T13585b.hs'])], run_command, ['$MAKE -s --no-print-directory T13585'])
+test('T13651', normal, compile, [''])