# Enum Case KeyPaths

**URL:** <https://forums.swift.org/t/enum-case-keypaths/60899>\
**Category:** Pitches\
**Tags:** keypaths, enums\
**Created:** [October 17, 2022, 6:53pm UTC](https://forums.swift.org/t/enum-case-keypaths/60899 "2022-10-17T18:53:23Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![allevato](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/allevato/32/385_2.png) [@allevato](https://forums.swift.org/u/allevato)\
**Post date:** [October 17, 2022, 10:02pm UTC](https://forums.swift.org/t/enum-case-keypaths/60899/8 "2022-10-17T22:02:40Z")

</div>

> [@Joe\_Groff](#):
>
> I don't hate this. `foo.case blue` isn't so bad as an expression for accessing the optionally-present payload of `blue` in an expression either.

I really like this, especially compared to discussion that's been had in the past about synthesizing properties directly on the enum type itself to surface the payloads. Using `case` (or some other token) as a sigil nicely distinguishes the structural value of the cases from the public API vended by the type, which may not want to represent the actual value in precisely that way (nor be forced to by compiler synthesis).

---

_[View the full topic](https://forums.swift.org/t/enum-case-keypaths/60899)._
