Skip to content

Use SwiftStdlib availability #41979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/attr/attr_availability_noasync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ func messageNoAsync() { }
@available(*, noasync, renamed: "asyncReplacement()")
func renamedNoAsync(_ completion: @escaping (Int) -> Void) -> Void { }

@available(macOS 11, iOS 13, watchOS 6, *)
@available(SwiftStdlib 5.5, *)
func asyncReplacement() async -> Int { }

@available(*, noasync, renamed: "IOActor.readString()")
func readStringFromIO() -> String {}

@available(macOS 11, iOS 13, watchOS 6, *)
@available(SwiftStdlib 5.5, *)
actor IOActor {
func readString() -> String {
return readStringFromIO()
}
}

@available(macOS 11, iOS 13, watchOS 6, *)
@available(SwiftStdlib 5.5, *)
func asyncFunc() async {
// expected-error@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts}}
basicNoAsync()
Expand All @@ -41,12 +41,12 @@ func asyncFunc() async {
}

// expected-error@+3{{asynchronous global function 'unavailableAsyncFunc()' must be available from asynchronous contexts}}
@available(macOS 11, iOS 13, watchOS 6, *)
@available(SwiftStdlib 5.5, *)
@available(*, noasync)
func unavailableAsyncFunc() async {
}

@available(macOS 11, iOS 13, watchOS 6, *)
@available(SwiftStdlib 5.5, *)
protocol BadSyncable {
// expected-error@+2{{asynchronous property 'isSyncd' must be available from asynchronous contexts}}
@available(*, noasync)
Expand Down