mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The async refactorings ignore whether a completion handler had `@escaping` or not. In preparation of fixing this, fix up all functions to have `@escaping` for their completion handler parameter. Also some small miscellaneous fixes in order to reduce the number of warnings output on test failures and also the addition of `REQUIRES: concurrency` on all tests.
16 lines
584 B
Swift
16 lines
584 B
Swift
// REQUIRES: concurrency
|
|
|
|
// RUN: %empty-directory(%t)
|
|
|
|
// A (Void) parameter has a warning in Swift, so this function is pulled into
|
|
// its own file
|
|
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix VOID-HANDLER %s
|
|
func voidCompletion(completion: @escaping (Void) -> Void) {}
|
|
// VOID-HANDLER: {
|
|
// VOID-HANDLER-NEXT: Task {
|
|
// VOID-HANDLER-NEXT: await voidCompletion()
|
|
// VOID-HANDLER-NEXT: completion(())
|
|
// VOID-HANDLER-NEXT: }
|
|
// VOID-HANDLER-NEXT: }
|
|
// VOID-HANDLER: func voidCompletion() async {}
|