# \[Pitch\] Enum Quality of Life Improvements

**URL:** <https://forums.swift.org/t/pitch-enum-quality-of-life-improvements/52770>\
**Category:** Pitches\
**Created:** [October 13, 2021, 2:40am UTC](https://forums.swift.org/t/pitch-enum-quality-of-life-improvements/52770 "2021-10-13T02:40:44Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![stephencelis](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/stephencelis/32/2675_2.png) [@stephencelis](https://forums.swift.org/u/stephencelis)\
**Post date:** [October 19, 2021, 2:34pm UTC](https://forums.swift.org/t/pitch-enum-quality-of-life-improvements/52770/18 "2021-10-19T14:34:25Z")

</div>

> [@anon9791410](#):
>
> [You can use reflection to reproduce that CasePath example.](https://stackoverflow.com/a/64808008/652038) I use this, but it does not make me happy, because explicit typing is required.

CasePaths used to use reflection, but using a mirror is about 1,000x slower than manually writing an `if case let`. This may not be a big deal for a casual match/extraction, but can add up quickly in a hot code path. These days CasePaths uses the Swift runtime metadata, instead, and is only about 2–5x slower than an `if case let`.

As nice as it is to have runtime metadata around to implement this functionality ourselves in a performant-enough way, this really is a feature that should be built into the language, given that key paths are built into the language and are used all over the place these days, like all of the dynamic member lookups in SwiftUI.

---

_[View the full topic](https://forums.swift.org/t/pitch-enum-quality-of-life-improvements/52770)._
