mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Handle ParamDecls and VarDecls in Argument Matching Diagnostics
These don't produce meaningful ParameterLists for this analysis to consider. Bail instead of crashing. rdar://93922410
This commit is contained in:
@@ -4896,9 +4896,13 @@ bool ConstraintSystem::repairFailures(
|
||||
if (!(overload && overload->choice.isDecl()))
|
||||
return true;
|
||||
|
||||
if (!getParameterList(overload->choice.getDecl())
|
||||
->get(applyLoc->getParamIdx())
|
||||
->getTypeOfDefaultExpr())
|
||||
// Ignore decls that don't have meaningful parameter lists - this
|
||||
// matches variables and parameters with function types.
|
||||
auto *paramList = getParameterList(overload->choice.getDecl());
|
||||
if (!paramList)
|
||||
return true;
|
||||
|
||||
if (!paramList->get(applyLoc->getParamIdx())->getTypeOfDefaultExpr())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user