Skip to content

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Jun 22, 2022

rdar://91857262

This is actually pretty tricky so leaving it for now but will get back to it.

The issue is about:

protocol GamePlayer: Sendable, Identifiable where ID == FakeActorSystem.ActorID {
...
}
extension GamePlayer where Self: DistributedActor, ActorSystem == FakeActorSystem {
  distributed func startGame(with opponent: String) -> String { ... }
}

distributed actor FishPlayer: GamePlayer {
  typealias ActorSystem = FakeActorSystem
}

so we should be able to call startGame on the FishPlayer -- it is guaranteed to be right; but in order to synthesize the thunk for the startGame in the extension (!) we need to call to the protocol's actorSystem property, which we don't handle well today.

Assertion failed: (systemProperty && "Unable to find 'actorSystem' property"), function deriveBodyDistributed_thunk, file CodeSynthesisDistributedActor.cpp, line 300.

Some attempts in PR but this is incomplete, only showing the issue.

@ktoso ktoso added the distributed Feature → concurrency: distributed actor label Jun 22, 2022
@ktoso ktoso marked this pull request as draft June 22, 2022 03:48
@ktoso ktoso requested a review from xedin June 22, 2022 03:49
@ktoso ktoso changed the title [Distributed] allow extensions where Self: DA, but the extended protocol is not DA explicitly [Later][Distributed] allow extensions where Self: DA, but the extended protocol is not DA explicitly Jun 25, 2022
@ktoso
Copy link
Contributor Author

ktoso commented Sep 12, 2023

This works now, and test here confirms it: #68451

@ktoso ktoso closed this Sep 12, 2023
@ktoso ktoso deleted the wip-dist-extensions branch September 12, 2023 08:16
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.

1 participant