# \[Amendment\] SE-0192: Handling Future Enum Cases

**URL:** <https://forums.swift.org/t/amendment-se-0192-handling-future-enum-cases/68321>\
**Category:** Announcements\
**Created:** [November 7, 2023, 8:53pm UTC](https://forums.swift.org/t/amendment-se-0192-handling-future-enum-cases/68321 "2023-11-07T20:53:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xwu](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@xwu](https://forums.swift.org/u/xwu)\
**Post date:** [November 7, 2023, 8:53pm UTC](https://forums.swift.org/t/amendment-se-0192-handling-future-enum-cases/68321/1 "2023-11-07T20:53:35Z")

</div>

Over five years have elapsed since the core team [announced modifications](https://forums.swift.org/t/se-0192-non-exhaustive-enums-what-happened-in-swift-4-2/14345) to the implementation of [SE-0192: Handling Future Enum Cases (aka Non-Exhaustive Enums)](https://github.com/apple/swift-evolution/blob/main/proposals/0192-non-exhaustive-enums.md).

Namely, the requirement to add an `@unknown default` case to handle future enum cases _specifically for non-exhaustive enums_ was downgraded from "warning in Swift 4/error in Swift 5" to "trap-at-runtime in Swift 4/warning in Swift 5" in order to mitigate source compatibility impact.

To this day, it has remained the case that lack of an `@unknown default` case is a warning rather than an error; ignoring that warning means that a runtime trap occurs if a future enum case is encountered.

The language steering group discussed the current state of SE-0192 in light of our plans for the Swift 6 language mode, and we're announcing that we'll **amend the proposal** to:

- upgrade the warning to an error for Swift 6; and
- add an [upcoming feature](https://github.com/apple/swift-evolution/blob/main/proposals/0362-piecemeal-future-features.md) flag for Swift 5.x so that users can migrate their code incrementally.

As announced in our recent post on [progress towards Swift 6](https://forums.swift.org/t/progress-toward-the-swift-6-language-mode/68315), we have incorporated a number of source-incompatible changes using upcoming feature flags with the plan that these flags will be enabled by default in Swift 6. This approach to staging in source-incompatible changes was not available when SE-0192 was reviewed, but today we feel it is the most appropriate path—indeed, the only sensible way open to us—to complete this feature. We reached this decision considering several factors; among them:

- It has been many years since the Swift 5 migration, and the warning has always been unsilenceable except by actually writing an `@unknown default` case.

- Ignoring the warning means leaving behind an implicit runtime trap if a future enum case is encountered—in the worst case, this behavior will remain trivially expressible in Swift 6 by writing something like `@unknown default: fatalError()`, but when explicitly handled, users can opt for other default behaviors that make sense in context and don't require execution to be halted (for example, returning `nil`).

This limited amendment is independent of any orthogonal, additive work to enable non-extensible enums for non-resilient libraries.

— Xiaodi Wu, on behalf of the language steering group
