mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CS] Add a missing null check in repairFailures
If we fail to simplify the locator, such as in the case where we have synthesized a missing call argument, bail without trying to add a missing call fix. Resolves SR-12964. Resolves rdar://64168162.
This commit is contained in:
@@ -3047,11 +3047,12 @@ bool ConstraintSystem::repairFailures(
|
||||
// default values, let's see whether error is related to missing
|
||||
// explicit call.
|
||||
if (fnType->getNumParams() > 0) {
|
||||
auto anchor = simplifyLocatorToAnchor(getConstraintLocator(locator));
|
||||
if (!anchor.is<Expr *>())
|
||||
auto *loc = getConstraintLocator(locator);
|
||||
auto *anchor = getAsExpr(simplifyLocatorToAnchor(loc));
|
||||
if (!anchor)
|
||||
return false;
|
||||
|
||||
auto overload = findSelectedOverloadFor(getAsExpr(anchor));
|
||||
auto overload = findSelectedOverloadFor(anchor);
|
||||
if (!(overload && overload->choice.isDecl()))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user