summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-05-07 16:46:02 +0100
committerBen Gamari <ben@smart-cactus.org>2015-10-22 14:26:46 +0200
commit9b0d901bc996ee21979e86c71a90f404a5225e86 (patch)
tree5646d4df209ed9d772f14b1403cd3461c561095d
parent3f3ac1cb6661f7b1780ea17abcce21f4a36dcea5 (diff)
downloadhaskell-9b0d901bc996ee21979e86c71a90f404a5225e86.tar.gz
Regression test for Trac #10390
-rw-r--r--testsuite/tests/typecheck/should_compile/T10390.hs16
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T10390.hs b/testsuite/tests/typecheck/should_compile/T10390.hs
new file mode 100644
index 0000000000..e0648c9554
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10390.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE RankNTypes #-}
+
+module T10390 where
+
+class ApPair r where
+ apPair :: (forall a . (ApPair a, Num a) => Maybe a) -> Maybe r
+
+instance (ApPair a, ApPair b) => ApPair (a,b) where
+ apPair = apPair'
+
+apPair' :: (ApPair b, ApPair c)
+ => (forall a . (Num a, ApPair a) => Maybe a) -> Maybe (b,c)
+ -- NB constraints in a different order to apPair
+apPair' f = let (Just a) = apPair f
+ (Just b) = apPair f
+ in Just $ (a, b)
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index bf0e0a0eca..33fff944a5 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -446,3 +446,4 @@ test('T10109', normal, compile, [''])
test('T10335', normal, compile, [''])
test('T10489', normal, compile, [''])
test('T10564', normal, compile, [''])
+test('T10390', normal, compile, [''])