diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-05-07 16:46:02 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-05-07 16:46:02 +0100 |
commit | c3e6b3ac50e7cc061825d49d06fb4fc81e6d5bc1 (patch) | |
tree | 982fd64f8e520100d6f72ce4346568ea6d7d7af5 | |
parent | 931d014d4276d4213d8de4b1f5e51f0219b724dd (diff) | |
download | haskell-c3e6b3ac50e7cc061825d49d06fb4fc81e6d5bc1.tar.gz |
Regression test for Trac #10390
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T10390.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
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 72fe255680..562acba378 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -453,3 +453,4 @@ test('TcCustomSolverSuper', normal, compile, ['']) test('T10335', normal, compile, ['']) test('Improvement', normal, compile, ['']) test('T10009', normal, compile, ['']) +test('T10390', normal, compile, ['']) |