mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Type checker] Be more rigorous about extracting argument labels from calls.
Whenever we have a call, retrieve the argument labels from the
argument structurally and associate them with the callee. We were
previously doing this as a separate AST walk (which was unnecessary),
so fold that into constraint generation for a CallExpr.
This is a slightly-pared-back version of
3753d779bc that isn't so rigid in its
interpretation of ASTs. I'll tighten up the semantics over time.
This commit is contained in:
@@ -2612,8 +2612,8 @@ getArgumentLabels(ConstraintSystem &cs, ConstraintLocatorBuilder locator) {
|
||||
if (!parts.empty())
|
||||
return None;
|
||||
|
||||
auto known = cs.ArgumentLabels.find(cs.getConstraintLocator(anchor));
|
||||
if (known == cs.ArgumentLabels.end())
|
||||
auto known = cs.CalleeArgumentLabels.find(cs.getConstraintLocator(anchor));
|
||||
if (known == cs.CalleeArgumentLabels.end())
|
||||
return None;
|
||||
|
||||
return known->second;
|
||||
|
||||
Reference in New Issue
Block a user