Skip to content

[WIP] DistributedActors and distributed funcs in protocols must survive hop_to them #41451

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

Closed

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Feb 18, 2022

Resolves rdar://84054772

Declaring a protocol that is protocol X: DistributedActor and having a distributed func in an extension on it, causes crashes in two situations:

  • attempting to get an executor off it, triggers assertions that a non Actor type tries to get an executor -- this is fine for a distributed actor though; for now we just always treat it as Default and get the global executor; we'll align the two later
  • SIL synthesis of the distributed thunk needs to find the ActorSystem of the protocol's where clause, or some type alias along the way and use it during synthesis so we don't crash not being able to find the system field (and type).

The latter part I'm still struggling with, but getting through it.

@ktoso ktoso added the distributed Feature → concurrency: distributed actor label Feb 19, 2022
@ktoso ktoso force-pushed the wip-allow-distributed-in-protocols-hop-to branch from c58fbde to c237d04 Compare February 21, 2022 14:41
@ktoso ktoso force-pushed the wip-allow-distributed-in-protocols-hop-to branch from 235258e to 819a8f2 Compare February 22, 2022 14:10
…ibuted actor

- Classes have specialized method on their declarations
- Archetypes and existentials check their conformances for
  presence of `DistributedActor` protocol.
…extensions

`getConcreteReplacementForProtocolActorSystemType` should use `getSelfClassDecl`
otherwise it wouldn't be able to find actor if the member is declared in an extension.
@ktoso ktoso closed this Mar 4, 2022
@ktoso
Copy link
Contributor Author

ktoso commented Mar 4, 2022

replaced by #41616

@ktoso ktoso deleted the wip-allow-distributed-in-protocols-hop-to branch March 4, 2022 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed Feature → concurrency: distributed actor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants