Files
swift-mirror/test/SourceKit/Inputs/concurrency/gen_concurrency.swift
Ben Barham e7e9b57051 Replace @completionHandlerAsync with @available(*, renamed:)
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
2021-07-29 09:14:44 +10:00

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 }
}