-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] Only parse distributed when experimental mode enabled #38889
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
Conversation
@swift-ci please smoke test |
// If this attribute is only permitted when distributed is enabled, reject it. | ||
if (DeclAttribute::isDistributedOnly(DK) && | ||
!shouldParseExperimentalDistributed()) { | ||
diagnose(Loc, diag::attr_requires_distributed, AttrName, | ||
DeclAttribute::isDeclModifier(DK)); | ||
DiscardAttribute = true; | ||
} | ||
|
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 feel like this is the only thing that's actually needed to solve the issue. Everything else is just for availability things.
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'll remove the availability support from this PR, thanks
@@ -24,6 +24,8 @@ constexpr static const StringLiteral STDLIB_NAME = "Swift"; | |||
constexpr static const StringLiteral SWIFT_ONONE_SUPPORT = "SwiftOnoneSupport"; | |||
/// The name of the Concurrency module, which supports that extension. | |||
constexpr static const StringLiteral SWIFT_CONCURRENCY_NAME = "_Concurrency"; | |||
/// The name of the Distributed module, which supports that extension. | |||
constexpr static const StringLiteral SWIFT_DISTRIBUTED_NAME = "_Distributed"; |
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 thought the module is called Distributed
right now, with no underscore. The underscore is for implicitly-imported modules I think.
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.
The import is _Distributed
, same as _Concurrency was and it did have to be imported explicitly for a while.
52b0163
to
5617856
Compare
@swift-ci please smoke test and merge |
We didn't completely implement the guarding of
distributed
in parsing, so it might have continued anyway, and fail when module types were needed.This now fails at compilation right away when distributed keyword is encountered but the experimental mode is not enabled.
Resolves rdar://81909966