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

Update SE-0192 for Swift 6 language mode #2450

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update SE-0192 for Swift 6 language mode #2450

wants to merge 1 commit into from

Conversation

xwu
Copy link
Collaborator

@xwu xwu commented May 14, 2024

Synchronize this proposal with the language steering group's amendment for the Swift 6 language mode, as announced and implemented for Swift 6.0.

@xwu
Copy link
Collaborator Author

xwu commented May 14, 2024

cc @dempseyatgithub

@xwu xwu added the editorial Editorial change to an existing document label May 14, 2024
@@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Copy link
Collaborator Author

@xwu xwu May 16, 2024

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The upcoming feature flag `NonfrozenEnumExhaustivity` is implemented in Swift 6.0 to subsume the bespoke compiler flag for Swift 4/4.2 language mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial Editorial change to an existing document
Projects
None yet
2 participants