File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -642,9 +642,23 @@ bool DisjunctionStep::shouldSkip(const DisjunctionChoice &choice) const {
642
642
// current score), we can skip any generic operators with conformance
643
643
// requirements that are not satisfied by any known argument types.
644
644
auto argFnType = CS.getAppliedDisjunctionArgumentFunction (Disjunction);
645
- auto bestScore = getBestScore (Solutions);
646
- auto bestChoiceNeedsConversions = bestScore && (bestScore > getCurrentScore ());
647
- if (bestScore && !bestChoiceNeedsConversions && choice.isGenericOperator () && argFnType) {
645
+ auto checkRequirementsEarly = [&]() -> bool {
646
+ auto bestScore = getBestScore (Solutions);
647
+ if (!(bestScore && choice.isGenericOperator () && argFnType))
648
+ return false ;
649
+
650
+ auto currentScore = getCurrentScore ();
651
+ for (unsigned i = 0 ; i < NumScoreKinds; ++i) {
652
+ if (i == SK_NonDefaultLiteral)
653
+ continue ;
654
+
655
+ if (bestScore->Data [i] > currentScore.Data [i])
656
+ return false ;
657
+ }
658
+
659
+ return true ;
660
+ };
661
+ if (checkRequirementsEarly ()) {
648
662
Constraint *constraint = choice;
649
663
auto *decl = constraint->getOverloadChoice ().getDecl ();
650
664
auto *useDC = constraint->getOverloadUseDC ();
You can’t perform that action at this time.
0 commit comments