[swift-evolution] [Idea] `enum` case count feature

Yuya Hirayama y at yura.me
Wed May 10 03:04:04 CDT 2017

Hi, Nick.
I have no idea about it and am interested in why you want to count the cases.

Yuya Hirayama

On 2017年5月10日 at 16:58:41, Nicholas Maccharoli via swift-evolution (swift-evolution at swift.org) wrote:


I'm sorry if this has been brought up before but is there a reason why there is no built-in way of getting the number of cases an enum defines?

Given something like: enum MyEnum { case foo, bar, baz }

It would be nice to get the number of cases this enum defines, something like:


Looking forward to hearing back about this!

- Nick 

swift-evolution mailing list
swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170510/069d0ec2/attachment.html>

More information about the swift-evolution mailing list