Skip to content

Commit 87703a0

Browse files
committed
[test] Add test for async completion handler call in parens
We don't currently handle this, but arguably we should be able to.
1 parent 7ab5915 commit 87703a0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/refactoring/ConvertAsync/convert_function.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,12 @@ func testReturnHandling2(completion: @escaping (String) -> ()) {
280280
// RETURN-HANDLING2-NEXT: {{^}}<#return#> a{{$}}
281281
// RETURN-HANDLING2-NEXT: }
282282
// RETURN-HANDLING2-NEXT: }
283+
284+
// FIXME: We should arguably be able to handle transforming this completion handler call (rdar://78011350).
285+
// RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=RETURN-HANDLING3 %s
286+
func testReturnHandling3(_ completion: (String?, Error?) -> Void) {
287+
return (completion("", nil))
288+
}
289+
// RETURN-HANDLING3: func testReturnHandling3() async throws -> String {
290+
// RETURN-HANDLING3-NEXT: {{^}} return (<#completion#>("", nil)){{$}}
291+
// RETURN-HANDLING3-NEXT: }

0 commit comments

Comments
 (0)