# \[Accepted\] SE-0194: Derived Collection of Enum Cases

**URL:** <https://forums.swift.org/t/accepted-se-0194-derived-collection-of-enum-cases/10723>\
**Category:** Announcements\
**Created:** [March 8, 2018, 10:20pm UTC](https://forums.swift.org/t/accepted-se-0194-derived-collection-of-enum-cases/10723 "2018-03-08T22:20:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_Gregor](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/douglas_gregor/32/1362_2.png) [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Post date:** [March 8, 2018, 10:20pm UTC](https://forums.swift.org/t/accepted-se-0194-derived-collection-of-enum-cases/10723/1 "2018-03-08T22:20:58Z")

</div>

The review of [SE-0194](https://github.com/apple/swift-evolution/blob/master/proposals/0194-derived-collection-of-enum-cases.md) has ended. The proposal is **accepted with revisions**. The specific changes to the proposal as reviewed are:

- `@objc` enums defined in Swift will receive automatic synthesis of the list of all cases. There is no technical basis for limiting synthesis to non-`@objc` enums. Note that this change does not affect enums defined in (Objective-)C: Swift will (still) not synthesize the list of all cases for imported enums.

- Unavailable cases will not be listed, because values of an unavailable case cannot exist in a well-typed Swift program (in breaks the availability model).

- Automatic synthesis is only provided when the conformance is stated on the `enum` definition (not an extension), following the precedent set by `Codable` ([SE-0167](https://github.com/apple/swift-evolution/blob/master/proposals/0167-swift-encoders.md)) and `Equatable`/`Hashable` synthesis ([SE-0185](https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md)).

- The protocol, associated type, and property are named `CaseIterable`, `AllCases`, and `allCases`, respectively. The core team felt that these names reflect the primary use case of this protocol, promoting better clarity for most code that iterates over all of the cases. We chose `Iterable` over `Enumerable` because `Enumerable` has some incorrect connotations (e.g., the `enumerated()` method).

Thank you to the proposal authors and implementer, and everyone who participated in the review!

Doug

---

<div class="post-metadata">

**Author:** ![saagarjha](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@saagarjha](https://forums.swift.org/u/saagarjha)\
**Post date:** [March 8, 2018, 10:29pm UTC](https://forums.swift.org/t/accepted-se-0194-derived-collection-of-enum-cases/10723/2 "2018-03-08T22:29:24Z")

</div>

Quick question: what is the type of the synthesized `AllCases`? In particular, will it be a `RandomAccessCollection`?
