Commit f7c7599
committed
[Async Refactoring] Add
Previously, in the following case we were failing to add a `return` keyword inside `withImplicitReturn`.
```
func withImplicitReturn(completionHandler: (String) -> Void) {
simple {
completionHandler($0)
}
}
```
This is because the call of `completionHandler($0)` is wrapped by an implicit `ReturnStmt` and thus we assumed that there was already a `return` keyword present.
Fix this issue by checking if the wrapping `ReturnStmt` is implicit and if it is, add the `return` keyword.
Fixes rdar://80009760return keyword if wrapping ReturnStmt is implicit1 parent 4e4752a commit f7c7599
File tree
2 files changed
+13
-1
lines changed- lib/IDE
- test/refactoring/ConvertAsync
2 files changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6460 | 6460 | | |
6461 | 6461 | | |
6462 | 6462 | | |
6463 | | - | |
| 6463 | + | |
| 6464 | + | |
6464 | 6465 | | |
6465 | 6466 | | |
6466 | 6467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
0 commit comments