Skip to content

Commit 2bd1825

Browse files
committed
[stdlib] Distributed: Mark all new protocol requirements as available starting from stdlib 5.11
1 parent 6789506 commit 2bd1825

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

stdlib/public/Distributed/DistributedActorSystem.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ public protocol DistributedActorSystem<SerializationRequirement>: Sendable {
382382
/// ## Errors
383383
/// This method is allowed to throw because of underlying transport or serialization errors,
384384
/// as well as by re-throwing the error received from the remote callee (if able to).
385+
@available(SwiftStdlib 5.11, *)
385386
func remoteCall<Act, Err, Res>(
386387
on actor: Act,
387388
target: RemoteCallTarget,
@@ -798,6 +799,7 @@ public protocol DistributedTargetInvocationEncoder<SerializationRequirement> {
798799

799800
/// Record an argument of `Argument` type.
800801
/// This will be invoked for every argument of the target, in declaration order.
802+
@available(SwiftStdlib 5.11, *)
801803
mutating func recordArgument<Value/*: SerializationRequirement*/>(
802804
_ argument: RemoteCallArgument<Value>
803805
) throws
@@ -810,6 +812,7 @@ public protocol DistributedTargetInvocationEncoder<SerializationRequirement> {
810812

811813
/// Record the return type of the distributed method.
812814
/// This method will not be invoked if the target is returning `Void`.
815+
@available(SwiftStdlib 5.11, *)
813816
mutating func recordReturnType<R/*: SerializationRequirement*/>(_ type: R.Type) throws
814817

815818
/// Invoked to signal to the encoder that no further `record...` calls will be made on it.
@@ -948,6 +951,7 @@ public protocol DistributedTargetInvocationDecoder<SerializationRequirement> {
948951
/// buffer for all the arguments and their expected types. The 'pointer' passed here is a pointer
949952
/// to a "slot" in that pre-allocated buffer. That buffer will then be passed to a thunk that
950953
/// performs the actual distributed (local) instance method invocation.
954+
@available(SwiftStdlib 5.11, *)
951955
mutating func decodeNextArgument<Argument/*: SerializationRequirement*/>() throws -> Argument
952956

953957
/// Decode the specific error type that the distributed invocation target has recorded.
@@ -996,6 +1000,7 @@ public protocol DistributedTargetInvocationResultHandler<SerializationRequiremen
9961000

9971001
/// Invoked when the distributed target execution returns successfully.
9981002
/// The `value` is the return value of the executed distributed invocation target.
1003+
@available(SwiftStdlib 5.11, *)
9991004
func onReturn<Success/*: SerializationRequirement*/>(value: Success) async throws
10001005

10011006
/// Invoked when the distributed target execution of a `Void` returning

test/Distributed/Runtime/distributed_actor_localSystem_generic.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s -o %t/a.out
2+
// RUN: %target-build-swift -module-name main -j2 -parse-as-library -I %t %s -o %t/a.out
33
// RUN: %target-codesign %t/a.out
44
// RUN: %target-run %t/a.out | %FileCheck %s --color
55

@@ -16,6 +16,7 @@
1616

1717
import Distributed
1818

19+
@available(SwiftStdlib 5.11, *)
1920
distributed actor Worker<ActorSystem> where ActorSystem: DistributedActorSystem<any Codable>, ActorSystem.ActorID: Codable {
2021
distributed func hi(name: String) {
2122
print("Hi, \(name)!")
@@ -27,6 +28,7 @@ distributed actor Worker<ActorSystem> where ActorSystem: DistributedActorSystem<
2728
}
2829

2930
// ==== Execute ----------------------------------------------------------------
31+
@available(SwiftStdlib 5.11, *)
3032
@main struct Main {
3133
static func main() async throws {
3234
let system = LocalTestingDistributedActorSystem()

0 commit comments

Comments
 (0)