summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2021-11-04 16:14:46 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-12 21:21:27 -0500
commitca90ffa321a31842a32be1b5b6e26743cd677ec5 (patch)
tree3646cec962d499aa023140cc9a0999c0b9b61901 /testsuite
parent265ead8a7401e20d75ed4e476805508ea695f37f (diff)
downloadhaskell-ca90ffa321a31842a32be1b5b6e26743cd677ec5.tar.gz
Use local instances with least superclass depth
See new Note [Use only the best local instance] in GHC.Tc.Solver.Interact. This commit also refactors the InstSC/OtherSC mechanism slightly. Close #20582.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/typecheck/should_compile/T20582.hs6
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
2 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T20582.hs b/testsuite/tests/typecheck/should_compile/T20582.hs
new file mode 100644
index 0000000000..9b49787be6
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T20582.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE QuantifiedConstraints #-}
+
+module T20582 where
+
+f :: (forall a. Ord (m a), forall a. Semigroup a => Eq (m a)) => m Int
+f = f
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 9fbf11b641..d5faf615b4 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -573,6 +573,7 @@ test('T13490', normal, compile, [''])
test('T13474', normal, compile, [''])
test('T13524', normal, compile, [''])
test('T20602', normal, compile, [''])
+test('T20582', normal, compile, [''])
test('T13509', normal, compile, [''])
test('T13526', normal, compile, [''])
test('T13594', normal, compile_fail, [''])