@@ -4193,28 +4193,30 @@ bool MissingArgumentsFailure::isPropertyWrapperInitialization() const {
4193
4193
4194
4194
bool MissingArgumentsFailure::isMisplacedMissingArgument (
4195
4195
const Solution &solution, ConstraintLocator *locator) {
4196
- auto *calleeLocator = cs .getCalleeLocator (locator);
4197
- auto overloadChoice = cs. findSelectedOverloadFor (calleeLocator);
4196
+ auto *calleeLocator = solution .getCalleeLocator (locator);
4197
+ auto overloadChoice = solution. getOverloadChoiceIfAvailable (calleeLocator);
4198
4198
if (!overloadChoice)
4199
4199
return false ;
4200
4200
4201
- auto *fnType = resolveType (overloadChoice->openedType )->getAs <FunctionType>();
4201
+ auto *fnType =
4202
+ solution.simplifyType (overloadChoice->openedType )->getAs <FunctionType>();
4202
4203
if (!(fnType && fnType->getNumParams () == 2 ))
4203
4204
return false ;
4204
4205
4205
4206
auto *anchor = locator->getAnchor ();
4206
4207
4207
4208
auto hasFixFor = [&](FixKind kind, ConstraintLocator *locator) -> bool {
4208
- auto fix = llvm::find_if (cs. getFixes () , [&](const ConstraintFix *fix) {
4209
+ auto fix = llvm::find_if (solution. Fixes , [&](const ConstraintFix *fix) {
4209
4210
return fix->getLocator () == locator;
4210
4211
});
4211
4212
4212
- if (fix == cs. getFixes () .end ())
4213
+ if (fix == solution. Fixes .end ())
4213
4214
return false ;
4214
4215
4215
4216
return (*fix)->getKind () == kind;
4216
4217
};
4217
4218
4219
+ auto &cs = solution.getConstraintSystem ();
4218
4220
auto *callLocator =
4219
4221
cs.getConstraintLocator (anchor, ConstraintLocator::ApplyArgument);
4220
4222
@@ -4245,7 +4247,7 @@ bool MissingArgumentsFailure::isMisplacedMissingArgument(
4245
4247
argument = tuple->getElement (0 );
4246
4248
}
4247
4249
4248
- auto argType = cs .simplifyType (cs .getType (argument));
4250
+ auto argType = solution .simplifyType (solution .getType (argument));
4249
4251
auto paramType = fnType->getParams ()[1 ].getPlainType ();
4250
4252
4251
4253
return TypeChecker::isConvertibleTo (argType, paramType, cs.DC );
@@ -5602,7 +5604,8 @@ bool ArgumentMismatchFailure::diagnoseMisplacedMissingArgument() const {
5602
5604
auto &cs = getConstraintSystem ();
5603
5605
auto *locator = getLocator ();
5604
5606
5605
- if (!MissingArgumentsFailure::isMisplacedMissingArgument (cs, locator))
5607
+ if (!MissingArgumentsFailure::isMisplacedMissingArgument (getSolution (),
5608
+ locator))
5606
5609
return false ;
5607
5610
5608
5611
auto *argType = cs.createTypeVariable (
0 commit comments