# Comparing enums without their associated values

**URL:** <https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944>\
**Category:** Pitches\
**Created:** [December 19, 2018, 6:02pm UTC](https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944 "2018-12-19T18:02:39Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![suyashsrijan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/suyashsrijan/32/5292_2.png) [@suyashsrijan](https://forums.swift.org/u/suyashsrijan)\
**Post date:** [February 11, 2019, 10:17pm UTC](https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944/9 "2019-02-11T22:17:50Z")

</div>

How about a synthesised property - `caseValue` (similar to `rawValue`). For example:

```swift
enum Foo {
  case one
  case two(Int)
}

let test1 = Foo.one
let test2 = Foo.two(3)

let value1 = test1.caseValue // Foo.one
let value2 = test2.caseValue // Foo.two

```

Could call it `case` or `caseValue` - I'm fine either way.

---

_[View the full topic](https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944)._
