Skip to content

Commit 9003837

Browse files
committed
Fix remaining test issues
Needed to add availability information for macOS, iOS, and watchOS to avoid emitting unintended errors on the `async` keyword.
1 parent 249c2a1 commit 9003837

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/attr/attr_availability_noasync.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ func messageNoAsync() { }
1212
@available(*, noasync, renamed: "asyncReplacement()")
1313
func renamedNoAsync(_ completion: @escaping (Int) -> Void) -> Void { }
1414

15-
@available(macOS 11, *)
15+
@available(macOS 11, iOS 13, watchOS 6, *)
1616
func asyncReplacement() async -> Int { }
1717

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

21-
@available(macOS 11, *)
21+
@available(macOS 11, iOS 13, watchOS 6, *)
2222
actor IOActor {
2323
func readString() -> String {
2424
return readStringFromIO()
2525
}
2626
}
2727

28-
@available(macOS 11, *)
28+
@available(macOS 11, iOS 13, watchOS 6, *)
2929
func asyncFunc() async {
3030
// expected-error@+1{{global function 'basicNoAsync' is unavailable from asynchronous contexts}}
3131
basicNoAsync()
@@ -40,11 +40,13 @@ func asyncFunc() async {
4040
let _ = readStringFromIO()
4141
}
4242

43-
// expected-error@+2{{asynchronous global function 'unavailableAsyncFunc()' must be available from asynchronous contexts}}
43+
// expected-error@+3{{asynchronous global function 'unavailableAsyncFunc()' must be available from asynchronous contexts}}
44+
@available(macOS 11, iOS 13, watchOS 6, *)
4445
@available(*, noasync)
4546
func unavailableAsyncFunc() async {
4647
}
4748

49+
@available(macOS 11, iOS 13, watchOS 6, *)
4850
protocol BadSyncable {
4951
// expected-error@+2{{asynchronous property 'isSyncd' must be available from asynchronous contexts}}
5052
@available(*, noasync)

0 commit comments

Comments
 (0)