@@ -9252,7 +9252,7 @@ ConstraintSystem::simplifyKeyPathApplicationConstraint(
9252
9252
9253
9253
bool ConstraintSystem::simplifyAppliedOverloadsImpl (
9254
9254
Constraint *disjunction, TypeVariableType *fnTypeVar,
9255
- const FunctionType *argFnType, unsigned numOptionalUnwraps,
9255
+ FunctionType *argFnType, unsigned numOptionalUnwraps,
9256
9256
ConstraintLocatorBuilder locator) {
9257
9257
// Don't attempt to filter overloads when solving for code completion
9258
9258
// because presence of code completion token means that any call
@@ -9352,6 +9352,10 @@ bool ConstraintSystem::simplifyAppliedOverloadsImpl(
9352
9352
return true ;
9353
9353
}
9354
9354
9355
+ // If types lined up exactly, let's favor this overload choice.
9356
+ if (Type (argFnType)->isEqual (choiceType))
9357
+ constraint->setFavored ();
9358
+
9355
9359
// Account for any optional unwrapping/binding
9356
9360
for (unsigned i : range (numOptionalUnwraps)) {
9357
9361
(void )i;
@@ -9439,8 +9443,7 @@ bool ConstraintSystem::simplifyAppliedOverloads(
9439
9443
}
9440
9444
9441
9445
bool ConstraintSystem::simplifyAppliedOverloads (
9442
- Type fnType, const FunctionType *argFnType,
9443
- ConstraintLocatorBuilder locator) {
9446
+ Type fnType, FunctionType *argFnType, ConstraintLocatorBuilder locator) {
9444
9447
// If we've already bound the function type, bail.
9445
9448
auto *fnTypeVar = fnType->getAs <TypeVariableType>();
9446
9449
if (!fnTypeVar || getFixedType (fnTypeVar))
0 commit comments