-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Sema: Relax distributed actor typechecking for swiftinterfaces #65431
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
Sema: Relax distributed actor typechecking for swiftinterfaces #65431
Conversation
@swift-ci please test |
@@ -68,7 +68,6 @@ static VarDecl* | |||
if (!var->getInterfaceType()->isEqual(expectedType)) | |||
return nullptr; | |||
|
|||
assert(var->isSynthesized() && "Expected compiler synthesized property"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok to skip 👍
@@ -643,6 +643,12 @@ bool swift::checkDistributedActorProperty(VarDecl *var, bool diagnose) { | |||
void swift::checkDistributedActorProperties(const NominalTypeDecl *decl) { | |||
auto &C = decl->getASTContext(); | |||
|
|||
auto sourceFile = decl->getDeclContext()->getParentSourceFile(); | |||
if (sourceFile && sourceFile->Kind == SourceFileKind::Interface) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, this looks good 👍
Some decls that are expected to be synthesized for distributed actors are printed explicitly in swiftinterfaces so diagnostics and assertions need to take that possibility into account. Resolves rdar://108533918
9577c3c
to
0e9b8a1
Compare
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether it matters or not but there are similar implicitness checks in SILGenDistributed.cpp
as well, should that be reworked too?
Thanks for thinking of that Pavel! I experimented with a few different approaches to seeing if that might be an issue but I wasn't able to reproduce any failures. I tried |
That sounds reasonable but @ktoso knows more about the system/id synthesis inside of initializers than I do. |
Since this change appears to succeed at unblocking module interface verification I'm going to land this. If we discover ways in which SILGen also needs to be tweaked let's do that in a separate PR. |
Hmmm, as far as I can tell these would be the only place where we're diagnosing errors on the synthesized things so this should be enough. Thank you very much for the investigation and fix @tshortli! |
Some decls that are expected to be synthesized for distributed actors are printed explicitly in swiftinterfaces so diagnostics and assertions need to take that possibility into account.
Resolves rdar://108533918