-
Notifications
You must be signed in to change notification settings - Fork 440
Use access levels on imports when compiler(>=6)
#2917
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
We should also consider enabling the upcoming |
681cdcc
to
1464815
Compare
@swift-ci please 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.
Thanks, Allan.
@swift-ci Please test Windows |
1464815
to
5d70fe6
Compare
I forgot to update code generation - fixed. |
@swift-ci please test |
Alright, as it turns out access level on import still requires a feature flag on 5.10. So I will update the |
Access levels on `import` declarations are a language feature that was introduced with the Swift 6 compiler but they don't depend on the Swift 6 language mode. `@_implementationOnly import` is now deprecated and `internal import` should be used instead, so SwiftSyntax's use of access levels on imports should depend on the compiler version, not the language version to ensure it no longer uses the `@_implementationOnly` unnecessarily. As a notable exception, `_SwiftSyntaxCShims` must continue to be imported `@_implementationOnly` since it's a local module that cannot be loaded by clients, and `internal import` does not hide modules from dependents when SwiftSyntax is built without library evolution.
5d70fe6
to
1d1aded
Compare
compiler(>=5.10)
compiler(>=6)
@swift-ci please test |
Access levels on
import
declarations are a language feature that was introduced with the Swift 6 compiler but they don't depend on the Swift 6 language mode.@_implementationOnly import
is now deprecated andinternal import
should be used instead, so SwiftSyntax's use of access levels on imports should depend on the compiler version, not the language version, to ensure it no longer uses@_implementationOnly
unnecessarily.As a notable exception,
_SwiftSyntaxCShims
must continue to be imported@_implementationOnly
since it's a local module that cannot be loaded by clients, andinternal import
does not hide modules from dependents when SwiftSyntax is built without library evolution.