-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Frontend: Allow -enable-experimental-feature
to specify upcoming features
#75962
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
Frontend: Allow -enable-experimental-feature
to specify upcoming features
#75962
Conversation
5e7e2d1
to
c015c95
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.
Makes sense to me! We had a few Issues were people used InferSendableFromCaptures
as experimental feature and once we promoted it, that stopped working.
Have you considered adding a warning for this case to nudge people towards use of upcoming
instead of keeping it on experimental
?
I considered but rejected that idea because I don't want to create a situation where a project owner has an un-addressable warning if they need to support older toolchains that only support the feature as experimental. |
I see, sounds good! |
…mportsByDefault`. Both the `StrictConcurrency` and `InternalImportsByDefault` features became "upcoming" features instead of "experimental" features in the Swift 6 compiler. This means that specifying those features with `.enableExperimentalFeature()` no longer works, and therefore these settings in SwiftPM's Package.swift have become inactive. I'm making the compiler more lenient, so that `-enable-experimental-feature` will enable the corresponding upcoming feature if relevant (swiftlang/swift#75962) but in the meantime it appears that some of the code in SwiftPM needs some fixes to continue to be accepted by the compiler with these features on. Additionally, I've removed explicit enablement of `AccessLevelOnImports` since that feature became standard in the Swift 5.10 compiler.
Blocked by swiftlang/swift-package-manager#7895. |
Both the `StrictConcurrency` and `InternalImportsByDefault` features became "upcoming" features instead of "experimental" features in the Swift 6 compiler. This means that specifying those features with `.enableExperimentalFeature()` no longer works with newer toolchains, and therefore these settings in SwiftPM's Package.swift have become inactive. I'm making the compiler more lenient, so that `-enable-experimental-feature` will enable the corresponding upcoming feature if relevant (swiftlang/swift#75962) but in the meantime it appears that some of the code in SwiftPM needs some fixes to continue to be accepted by the compiler with these features on.
Address some `InternalImportsByDefault` diagnostics in the `_AsyncFileSystem` which have crept in because the Swift 6 toolchain isn't enforcing `.enableExperimentalFeature("InternalImportsByDefault")`. ### Motivation: Both the `StrictConcurrency` and `InternalImportsByDefault` features became "upcoming" features instead of "experimental" features in the Swift 6 compiler. This means that specifying those features with `.enableExperimentalFeature()` no longer works with newer toolchains, and therefore these settings in SwiftPM's `Package.swift` have become inactive. I'm making the compiler more lenient, so that `-enable-experimental-feature` will enable the corresponding upcoming feature if relevant (swiftlang/swift#75962) but in the meantime it appears that some of the code in SwiftPM needs some fixes to continue to be accepted by the compiler with these features on. ### Modifications: Adjusted access level on a number of import statements in files belonging to the `_AsyncFileSystem` target. ### Result: `_AsyncFileSystem` builds successfully when `InternalImportsByDefault` is actually enabled with the Swift 6 toolchain.
…ures. During the lifecycle of a feature, it may start as an experimental feature and then graduate to become an upcoming feature. To preserve compatibility with projects that adopted the feature when it was experimental, `-enable-experimental-feature` ought to be able to enable upcoming features, too. Since projects may use `-enable-experimental-feature` for compatibility with an older toolchain that does not have the feature as an upcoming feature, there is no warning when the flag is used to enable an upcoming feature. Note that if the semantics of a feature change when it graduates from experimental to upcoming, then the feature must be renamed so that projects using the experimental feature have an opportunity opt-in to the new semantics of the upcoming feature. Resolves rdar://134276783.
c015c95
to
ad1acd7
Compare
@swift-ci please smoke test |
swiftlang/swift-package-manager#7905 @swift-ci please smoke test |
During the lifecycle of a feature, it may start as an experimental feature and then graduate to become an upcoming feature. To preserve compatibility with projects that adopted the feature when it was experimental,
-enable-experimental-feature
ought to be able to enable upcoming features, too.Since projects may use
-enable-experimental-feature
for compatibility with an older toolchain that does not have the feature as an upcoming feature, there is no warning when the flag is used to enable an upcoming feature.Note that if the semantics of a feature change when it graduates from experimental to upcoming, then the feature must be renamed so that projects using the experimental feature have an opportunity opt-in to the new semantics of the upcoming feature.
Resolves rdar://134276783.