[swift-evolution] Pre-proposal: CaseEnumerable protocol (derived collection of enum cases)

Sune Foldager cyano at me.com
Tue Jan 19 12:21:30 CST 2016


> On 18 Jan 2016, at 00:44, Jacob Bandes-Storch via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Introduce a CaseEnumerable protocol. Conforming to CaseEnumerable will automagically derive a static var cases, whose type is a CollectionType of all the enum's values.

Hm, I don’t think I like that. Are there other examples of magic protocols in Swift?

-Sune

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160119/c265b8ac/attachment.html>


More information about the swift-evolution mailing list