File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2190,8 +2190,15 @@ ConstraintSystem::selectBestDisjunction(ArrayRef<Constraint *> disjunctions) {
2190
2190
unsigned firstFavored = first->countFavoredNestedConstraints ();
2191
2191
unsigned secondFavored = second->countFavoredNestedConstraints ();
2192
2192
2193
- if (!isOperatorDisjunction (first) || !isOperatorDisjunction (second))
2193
+ if (!isOperatorDisjunction (first) || !isOperatorDisjunction (second)) {
2194
+ // If one of the sides has favored overloads, let's prefer it
2195
+ // since it's a strong enough signal that there is something
2196
+ // known about the arguments associated with the call.
2197
+ if (firstFavored == 0 || secondFavored == 0 )
2198
+ return firstFavored > secondFavored;
2199
+
2194
2200
return firstActive < secondActive;
2201
+ }
2195
2202
2196
2203
if (firstFavored == secondFavored) {
2197
2204
// Look for additional choices that are "favored"
You can’t perform that action at this time.
0 commit comments