@@ -1834,7 +1834,7 @@ bool RefactoringActionCollapseNestedIfStmt::performChange() {
1834
1834
EditConsumer, SM,
1835
1835
Lexer::getCharSourceRangeFromSourceRange (SM, OuterIf->getSourceRange ()));
1836
1836
1837
- OS << tok::kw_if << " " ;
1837
+ OS << tok::kw_if << " " ;
1838
1838
1839
1839
// Emit conditions.
1840
1840
bool first = true ;
@@ -6406,21 +6406,7 @@ class AsyncConverter : private SourceEntityWalker {
6406
6406
// Print the function result type, making sure to omit a '-> Void' return.
6407
6407
if (!TopHandler.willAsyncReturnVoid ()) {
6408
6408
OS << " -> " ;
6409
- if (ReturnTypes.size () > 1 )
6410
- OS << " (" ;
6411
-
6412
- llvm::interleave (
6413
- ReturnTypes,
6414
- [&](LabeledReturnType TypeAndLabel) {
6415
- if (!TypeAndLabel.Label .empty ()) {
6416
- OS << TypeAndLabel.Label << tok::colon << " " ;
6417
- }
6418
- TypeAndLabel.Ty ->print (OS);
6419
- },
6420
- [&]() { OS << " , " ; });
6421
-
6422
- if (ReturnTypes.size () > 1 )
6423
- OS << " )" ;
6409
+ addAsyncFuncReturnType (TopHandler);
6424
6410
}
6425
6411
6426
6412
if (FD->hasBody ())
@@ -6461,10 +6447,13 @@ class AsyncConverter : private SourceEntityWalker {
6461
6447
// for the completion handler call, e.g 'return completion(args...)'. In
6462
6448
// that case, be sure not to add another return.
6463
6449
auto *parent = getWalker ().Parent .getAsStmt ();
6464
- AddedReturnOrThrow = !(parent && isa<ReturnStmt>(parent) &&
6465
- !cast<ReturnStmt>(parent)->isImplicit ());
6466
- if (AddedReturnOrThrow)
6450
+ if (parent && isa<ReturnStmt>(parent) &&
6451
+ !cast<ReturnStmt>(parent)->isImplicit ()) {
6452
+ // The statement already has a return keyword. Don't add another one.
6453
+ AddedReturnOrThrow = false ;
6454
+ } else {
6467
6455
OS << tok::kw_return;
6456
+ }
6468
6457
} else {
6469
6458
OS << tok::kw_throw;
6470
6459
}
0 commit comments