-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Suggest @preconcurrency
on conformances it could help
#73741
Suggest @preconcurrency
on conformances it could help
#73741
Conversation
@swift-ci please smoke test |
ffebd09
to
523e254
Compare
@swift-ci please smoke test |
523e254
to
42d819b
Compare
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@@ -2655,6 +2655,8 @@ WARNING(add_predates_concurrency_import,none, | |||
"%select{| as warnings}0", (bool, Identifier)) | |||
WARNING(remove_predates_concurrency_import,none, | |||
"'@preconcurrency' attribute on module %0 has no effect", (Identifier)) | |||
NOTE(add_preconcurrency_to_conformance,none, | |||
"add '@preconcurrency' to the %0 conformance to suppress isolation-related diagnostics", (DeclName)) |
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.
Instead of just saying this will suppress diagnostics, should we say that applying @preconcurrency
will switch from static isolation diagnostics to dynamic ones? I think this should somehow mention that you're opting into dynamic assertions by doing this.
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.
That is a great point! Thank you!
@swift-ci please smoke test Linux |
@swift-ci please clean smoke test Linux |
aa63d7a
to
9e26152
Compare
@swift-ci please smoke test |
9e26152
to
8a94990
Compare
@swift-ci please smoke test |
When diagnosing a case where an actor-isolated witness cannot satisfy a non-isolated requirement, also suggest that the conformance could be annotated with `@preconcurrency`.
8a94990
to
5a0e70a
Compare
@swift-ci please clean smoke test |
@swift-ci please clean test Linux |
@swift-ci please clean smoke test Linux |
@swift-ci please test Linux |
@@ -573,6 +573,8 @@ class NormalProtocolConformance : public RootProtocolConformance, | |||
Context(dc) { | |||
assert(!conformingType->hasArchetype() && | |||
"ProtocolConformances should store interface types"); | |||
assert((preconcurrencyLoc.isInvalid() || isPreconcurrency) && | |||
"Cannot have a @preconcurrency location without isPreconcurrency"); |
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.
Thank you!
We moved some diagnostics around, which ended up breaking some downstream tests that we don't want to break. Restore the location.
@swift-ci please smoke test |
When diagnosing a case where an actor-isolated witness cannot satisfy a non-isolated requirement, also suggest that the conformance could be annotated with
@preconcurrency
.