mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
This commit is contained in:
@@ -19,7 +19,7 @@ typealias NestedAliasCallback = SomeCallback
|
||||
// RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):13 | %FileCheck -check-prefix=ASYNC-SIMPLE %s
|
||||
func simple(completion: (String) -> Void) { }
|
||||
// ASYNC-SIMPLE: basic.swift [[# @LINE-1]]:1 -> [[# @LINE-1]]:1
|
||||
// ASYNC-SIMPLE-NEXT: @available(*, deprecated, message: "Prefer async alternative instead")
|
||||
// ASYNC-SIMPLE-NEXT: @available(*, renamed: "simple()")
|
||||
// ASYNC-SIMPLE-EMPTY:
|
||||
// ASYNC-SIMPLE-NEXT: basic.swift [[# @LINE-4]]:43 -> [[# @LINE-4]]:46
|
||||
// ASYNC-SIMPLE-NEXT: {
|
||||
|
||||
Reference in New Issue
Block a user