-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Update SE-0192 for Swift 6 language mode #2450
base: main
Are you sure you want to change the base?
Conversation
@@ -4,6 +4,7 @@ | |||
* Author: [Jordan Rose](https://github.com/jrose-apple) | |||
* Review Manager: [Ted Kremenek](https://github.com/tkremenek) | |||
* Status: **Implemented (Swift 5.0)** | |||
* Upcoming Feature Flag: `NonfrozenEnumExhaustivity` (implemented in Swift 6.0 to subsume bespoke compiler flag for Swift 4/4.2 language mode) |
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.
* Upcoming Feature Flag: `NonfrozenEnumExhaustivity` (implemented in Swift 6.0 to subsume bespoke compiler flag for Swift 4/4.2 language mode) | |
* Upcoming Feature Flag: `NonfrozenEnumExhaustivity` (implemented in Swift 6.0) (enabled in Swift 6 language mode) |
This should also include the (enabled in Swift 6 language mode)
annotation to indicate when the flag is always enabled.
The details of what an upcoming feature flag does is not included as part of the header field. The details should be generally be included in the "Source Compatibility" section or elsewhere in the proposal. In this case, in the introduction.
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.
This is tricky to explain. It is enabled in Swift 5 language mode too; the flag has no effect except in Swift 4/4.2 mode.
@@ -21,6 +22,8 @@ A key note: in this version of the proposal, *nothing changes for user-defined S | |||
|
|||
- Since the proposal was accepted months after it was written, the rollout plan turned out to be a little too aggressive. Therefore, in Swift 5 the diagnostic for omitting `@unknown default:` or `@unknown case _:` will only be a warning, and in Swift 4 mode there will be no diagnostic at all. (The previous version of the proposal used an error and a warning, respectively.) Developers are still free to use `@unknown` in Swift 4 mode, in which case the compiler will still produce a warning if all known cases are not handled. | |||
|
|||
- To complete the rollout of this feature, the warning is [upgraded to an error for the Swift 6 language mode](https://forums.swift.org/t/amendment-se-0192-handling-future-enum-cases/68321) | |||
|
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.
The upcoming feature flag `NonfrozenEnumExhaustivity` is implemented in Swift 6.0 to subsume the bespoke compiler flag for Swift 4/4.2 language mode. |
Synchronize this proposal with the language steering group's amendment for the Swift 6 language mode, as announced and implemented for Swift 6.0.