Skip to content
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

Add the swift.enable_v6 feature to support migration to the Swift 6 language mode #1411

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

brentleyjones
Copy link
Collaborator

This flag is designed with ease of migration in mind. On toolchains that directly support the Swift 6 language mode (none have been released yet), enabling this feature on a target will simply pass -swift-version 6 to the compiler. On older compilers however, it will instead pass the equivalent set of -enable-upcoming-feature flags as defined inside the compiler. This allows code to begin migrating to Swift 6 mode even before they switch to a Swift 6 toolchain.

PiperOrigin-RevId: 629396220
(cherry picked from commit 86f356c , f1765e6, 8065c86, and 3cb393f)

brentleyjones referenced this pull request Oct 15, 2024
… language mode.

This flag is designed with ease of migration in mind. On toolchains that directly support the Swift 6 language mode (none have been released yet), enabling this feature on a target will simply pass `-swift-version 6` to the compiler. On older compilers however, it will instead pass the equivalent set of `-enable-upcoming-feature` flags as defined inside the compiler. This allows code to begin migrating to Swift 6 mode even before they switch to a Swift 6 toolchain.

PiperOrigin-RevId: 629396220
brentleyjones referenced this pull request Oct 15, 2024
…ompilers when using `swift.enable_v6`.

Even in Swift 5.10, `StrictConcurrency` is only an experimental feature: https://github.com/apple/swift/blob/swift-5.10-RELEASE/include/swift/Basic/Features.def#L221

PiperOrigin-RevId: 631028867
brentleyjones referenced this pull request Oct 15, 2024
… language mode

This flag is designed with ease of migration in mind. On toolchains that directly support the Swift 6 language mode (none have been released yet), enabling this feature on a target will simply pass `-swift-version 6` to the compiler. On older compilers however, it will instead pass the equivalent set of `-enable-upcoming-feature` flags as defined inside the compiler. This allows code to begin migrating to Swift 6 mode even before they switch to a Swift 6 toolchain.

PiperOrigin-RevId: 629396220
(cherry picked from commit 86f356c , f1765e6, 8065c86, and 3cb393f)
Signed-off-by: Brentley Jones <github@brentleyjones.com>
@brentleyjones brentleyjones merged commit c523f48 into master Oct 15, 2024
11 of 14 checks passed
@brentleyjones brentleyjones deleted the bj/swift.enable_v6 branch October 15, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants