mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Refactoring] Handle default arguments when converting call to async
Default arguments were still being visited when converting the call, adding extra commas to the converted call. Skip over them. Resolves rdar://74248990
This commit is contained in:
@@ -5155,12 +5155,17 @@ private:
|
||||
/*ToEndOfToken=*/true);
|
||||
|
||||
OS << tok::l_paren;
|
||||
size_t realArgCount = 0;
|
||||
for (size_t I = 0, E = Args.size() - 1; I < E; ++I) {
|
||||
if (I > 0)
|
||||
if (isa<DefaultArgumentExpr>(Args[I]))
|
||||
continue;
|
||||
|
||||
if (realArgCount > 0)
|
||||
OS << tok::comma << " ";
|
||||
// Can't just add the range as we need to perform replacements
|
||||
convertNode(Args[I], /*StartOverride=*/CE->getArgumentLabelLoc(I),
|
||||
/*ConvertCalls=*/false);
|
||||
realArgCount++;
|
||||
}
|
||||
OS << tok::r_paren;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user