-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[SE-0362] Piecemeal adoption of upcoming language improvements #59055
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci please build toolchain |
605cc71
to
c755369
Compare
@swift-ci please smoke test |
@swift-ci please smoke test macOS |
@swift-ci please smoke test |
swiftlang/swift-driver#1118 @swift-ci please build toolchain |
@swift-ci please smoke test |
Yay it still works, but I need to address the change from |
Introduce the `-enable-upcoming-feature X` command-line argument to allow one to opt into features that will be enabled in an upcoming language mode. Stage in several features this way (`ConciseMagicFile`, `ForwardTrailingClosures`, `BareSlashRegexLiterals`).
When we encounter a check like `#if compiler(>=6.0) && something` or `#if swift(<6.0) || something`, and the left-hand term is a versioning check that determines the result of the whole condition, then we will not attempt to validate the right-hand term. This allows us to use versioned checks along with new discovery features (say, if we add an `#if attribute(x)`) without having to next conditions.
f0c9378
to
2da2561
Compare
c75bb36
to
d693ac3
Compare
@swift-ci please smoke test |
@swift-ci please test macOS |
@swift-ci please smoke test macOS |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce a compiler flag
-enable-upcoming-feature X
, which can be used to enable a feature in an earlier language mode (e..g, Swift 5.x) that will be enabled by default in an upcoming language mode (e.g., Swift 6). Available features can be detected with#if hasFeature(X)
.