[Distributed] ID synthesis must be eager, or we run into issues in real projects #42136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Without this, in real, multi module, multi file, projects we end up with issues as follows:
From debugging it seems that the reason is that the resolve by lookup triggers early and determines that the
ID
shall be taken from theextension Identifiable { var id: ObjectIdentifier {...} }
and only then other synthesis is run.In order to avoid such mixups, we can be eager about the ID type synthesis.
This is limited to
distributed actor
decls, because in all other cases the default would be right and follow the usual rules, but because we synthesize theActorSystem
typealias andID
types later on, things got tricky here.If there is a cleaner way to do this I'd happily revisit but this seems not to terrible for now at least and unbreaks projects.
Resolves rdar://91020060