Skip to content

Commit 39fa0d7

Browse files
committed
[Distributed] be more explicit about DA being Sendable
1 parent cce4442 commit 39fa0d7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

stdlib/public/Distributed/DistributedActor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public protocol AnyActor: Sendable, AnyObject {}
3535
/// distributed actor.
3636
@available(SwiftStdlib 5.5, *)
3737
public protocol DistributedActor:
38-
AnyActor, Identifiable, Hashable, Codable {
38+
AnyActor, Sendable, Identifiable, Hashable, Codable {
3939
/// Resolves the passed in `identity` against the `transport`, returning
4040
/// either a local or remote actor reference.
4141
///
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-typecheck-verify-swift -warn-concurrency -enable-experimental-distributed -disable-availability-checking
2+
// REQUIRES: concurrency
3+
// REQUIRES: distributed
4+
5+
import _Distributed
6+
7+
actor Charlie {
8+
// should not cause sendable warnings, Worker is Sendable as implied by DA
9+
func two<Worker>() -> Set<Worker> where Worker: DistributedActor {
10+
[]
11+
}
12+
}

0 commit comments

Comments
 (0)