mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Instead of a new attribute `@completionHandlerAsync`, allow the use of the existing `renamed` parameter of `@available` to specify the asynchronous alternative of a synchronous function. No errors will be output from invalid names as `@completionHandlerAsync` had, but if a function is correctly matched then it will be used to output warnings when using the synchronous function in an asynchronous context (as before). Resolves rdar://80612731
6 lines
209 B
Swift
6 lines
209 B
Swift
class ClassWithAsyncAndHandler {
|
|
@available(*, renamed: "foo(_:)")
|
|
func foo(_ operation: String, completionHandler handler: @escaping (Int) -> Void) {}
|
|
func foo(_ operation: String) async -> Int { 0 }
|
|
}
|