Skip to content

[Distributed] be more explicit about DA being Sendable #39891

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 1 commit into from
Oct 23, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion stdlib/public/Distributed/DistributedActor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public protocol AnyActor: Sendable, AnyObject {}
/// distributed actor.
@available(SwiftStdlib 5.5, *)
public protocol DistributedActor:
AnyActor, Identifiable, Hashable, Codable {
AnyActor, Sendable, Identifiable, Hashable, Codable {
/// Resolves the passed in `identity` against the `transport`, returning
/// either a local or remote actor reference.
///
Expand Down
12 changes: 12 additions & 0 deletions test/Distributed/distributed_actor_concurrency_warnings.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %target-typecheck-verify-swift -warn-concurrency -enable-experimental-distributed -disable-availability-checking
// REQUIRES: concurrency
// REQUIRES: distributed

import _Distributed

actor Charlie {
// should not cause sendable warnings, Worker is Sendable as implied by DA
func two<Worker>() -> Set<Worker> where Worker: DistributedActor {
[]
}
}