Skip to content

[Distributed] Diagnose missing import also for funcs in extensions #72923

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
Apr 9, 2024

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented Apr 9, 2024

Description: When a distributed func was declared in an extension in a file that did not import the Distributed module, though the extension was made properly on a distributed actor, we would crash in synthesis in SILGen because synthesis refers to types in the distributed module and the import is necessary.

This patch properly diagnoses missing imports whenever a distributed func is used somewhere.

Risk: Low, only improved diagnostics rather than crashing the compiler for distributed func declarations.
Radar: rdar://125813581

@ktoso ktoso force-pushed the wip-diagnose-missing-import branch from 1bc2f93 to 09d41bb Compare April 9, 2024 07:16
@ktoso ktoso force-pushed the wip-diagnose-missing-import branch from 09d41bb to 7cd9063 Compare April 9, 2024 08:08
@ktoso
Copy link
Contributor Author

ktoso commented Apr 9, 2024

@swift-ci please smoke test

@@ -231,6 +231,7 @@ deriveBodyDistributed_thunk(AbstractFunctionDecl *thunk, void *context) {

// === Type:
StructDecl *RCT = C.getRemoteCallTargetDecl();
assert(RCT && "Missing RemoteCalLTarget declaration");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, thanks I'll fix :)

@ktoso ktoso deleted the wip-diagnose-missing-import branch April 11, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants