File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -623,7 +623,8 @@ bool DisjunctionStep::shouldSkip(const DisjunctionChoice &choice) const {
623
623
// If the solver already found a solution with a better overload choice that
624
624
// can be unconditionally substituted by the current choice, skip the current
625
625
// choice.
626
- if (LastSolvedChoice && isGenericDisjunctionChoice (choice)) {
626
+ if (LastSolvedChoice && LastSolvedChoice->second == getCurrentScore () &&
627
+ isGenericDisjunctionChoice (choice)) {
627
628
auto *declA = LastSolvedChoice->first ->getOverloadChoice ().getDecl ();
628
629
auto *declB = static_cast <Constraint *>(choice)->getOverloadChoice ().getDecl ();
629
630
@@ -639,7 +640,7 @@ bool DisjunctionStep::shouldSkip(const DisjunctionChoice &choice) const {
639
640
// requirements that are not satisfied by any known argument types.
640
641
auto bestScore = getBestScore (Solutions);
641
642
auto bestChoiceNeedsConversions = bestScore && (bestScore > getCurrentScore ());
642
- if (!bestChoiceNeedsConversions && choice.isGenericOperator () && argFnType) {
643
+ if (bestScore && !bestChoiceNeedsConversions && choice.isGenericOperator () && argFnType) {
643
644
Constraint *constraint = choice;
644
645
auto *decl = constraint->getOverloadChoice ().getDecl ();
645
646
auto *useDC = constraint->getOverloadUseDC ();
You can’t perform that action at this time.
0 commit comments