[Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)

The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
This commit is contained in:
Karoy Lorentey
2021-10-28 14:25:35 -07:00
parent fb090fde5e
commit 47956908b7
157 changed files with 727 additions and 729 deletions

View File

@@ -7,7 +7,7 @@ import _Distributed
// ==== -----------------------------------------------------------------------
// MARK: Good cases
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
protocol DistProtocol: DistributedActor {
// FIXME(distributed): avoid issuing these warnings, these originate from the call on the DistProtocol where we marked this func as dist isolated,
func local() -> String
@@ -24,7 +24,7 @@ protocol DistProtocol: DistributedActor {
distributed func distAsyncThrows() async throws -> String
}
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
distributed actor SpecificDist: DistProtocol {
nonisolated func local() -> String { "hi" }
@@ -47,7 +47,7 @@ distributed actor SpecificDist: DistProtocol {
}
}
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
func outside_good(dp: SpecificDist) async throws {
_ = dp.local()
@@ -58,7 +58,7 @@ func outside_good(dp: SpecificDist) async throws {
_ = try await dp.distAsyncThrows() // ok
}
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
func outside_good_generic<DP: DistProtocol>(dp: DP) async throws {
_ = dp.local() // expected-error{{only 'distributed' functions can be called from outside the distributed actor}}
_ = await dp.local() // expected-error{{only 'distributed' functions can be called from outside the distributed actor}}
@@ -76,7 +76,7 @@ func outside_good_generic<DP: DistProtocol>(dp: DP) async throws {
_ = try await dp.distAsyncThrows() // ok
}
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
func outside_good_ext<DP: DistProtocol>(dp: DP) async throws {
_ = try await dp.dist() // implicit async throws
_ = try await dp.dist(string: "") // implicit async throws
@@ -88,13 +88,13 @@ func outside_good_ext<DP: DistProtocol>(dp: DP) async throws {
// ==== -----------------------------------------------------------------------
// MARK: Error cases
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
protocol ErrorCases: DistributedActor {
distributed func unexpectedAsyncThrows() -> String
// expected-note@-1{{protocol requires function 'unexpectedAsyncThrows()' with type '() -> String'; do you want to add a stub?}}
}
@available(SwiftStdlib 5.5, *)
@available(SwiftStdlib 5.1, *)
distributed actor BadGreeter: ErrorCases {
// expected-error@-1{{type 'BadGreeter' does not conform to protocol 'ErrorCases'}}