# How to use pattern match for overloaded enum?

**URL:** <https://forums.swift.org/t/how-to-use-pattern-match-for-overloaded-enum/48768>\
**Category:** Using Swift\
**Created:** [May 24, 2021, 3:07am UTC](https://forums.swift.org/t/how-to-use-pattern-match-for-overloaded-enum/48768 "2021-05-24T03:07:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![xAlien95](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/xalien95/32/12558_2.png) [@xAlien95](https://forums.swift.org/u/xAlien95)\
**Post date:** [May 24, 2021, 3:56am UTC](https://forums.swift.org/t/how-to-use-pattern-match-for-overloaded-enum/48768/2 "2021-05-24T03:56:37Z")

</div>

It's a known bug. [SE-0155, Expired Proposal](https://github.com/apple/swift-evolution/blob/aecced4919ab297f343dafd7235d392d8b859839/proposals/0155-normalize-enum-case-representation.md#disambiguating-pattern-matches) contained a detailed description of what should've happened in case of same base-name cases,

> [@](#):
>
> If there are no unlabeled associated values and there are multiple labeled associated values with the same arity, then an unlabeled pattern is ambiguous. Explicit labels can be used to disambiguate:
> 
> ```swift
> enum Buffalo {
> case buffalo(bill: String)
> case buffalo(buffalo: String)
> }
> 
> switch buffalo {
> case .buffalo(_): // Error, ambiguous
> case .buffalo(bill: _): // Favors `buffalo(bill:)`
> case .buffalo(buffalo: _): // Favors `buffalo(buffalo:)`
> }
> 
> ```

but due to the new expiration policies and the fact that SE-0155 hasn't been fully implemented in an year from its acceptance, that section has been removed. You can read more in [Addressing unimplemented evolution proposals](https://forums.swift.org/t/addressing-unimplemented-evolution-proposals/40322).

> [@Addressing unimplemented evolution proposals](https://forums.swift.org/t/addressing-unimplemented-evolution-proposals/40322/1):
>
> - [SE-0155](https://github.com/apple/swift-evolution/blob/master/proposals/0155-normalize-enum-case-representation.md) is partly implemented. The portion relating to changes to pattern matching behavior will be removed. There are also some bugs in the implementation ([SR-12206](https://bugs.swift.org/browse/SR-12206) and [SR-12229](https://bugs.swift.org/browse/SR-12229)) which should be treated as existing bugs in the language.

* * *

Side note: are you able to access [bugs.swift.org](http://bugs.swift.org)? For me, the website is unavailable (it's giving me a 503 error since Saturday).

---

_[View the full topic](https://forums.swift.org/t/how-to-use-pattern-match-for-overloaded-enum/48768)._
