[swift-evolution] Pre-proposal: CaseEnumerable protocol (derived collection of enum cases)
jgroff at apple.com
Tue Jan 19 14:17:44 CST 2016
The compiler implicitly derives T: Equatable for enums without associated values, and IMO it'd be reasonable to extend this to other types and/or other protocols.
> On Jan 19, 2016, at 11:37 AM, David Waite via swift-evolution <swift-evolution at swift.org> wrote:
> ErrorType’s magic is only for Objective-C interoperability, and only exposed by diving into compiler implementation-level protocols.
> This seems like a case where some syntax consistency is needed between ‘code generation’ proposals (such as member wise initializers). If there was guidance on what an eventual macro system syntax could look like, this could be taken into account as well.
>> On Jan 19, 2016, at 11:36 AM, Jacob Bandes-Storch via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> Yes: ErrorType.
>> On Tue, Jan 19, 2016 at 10:21 AM, Sune Foldager <cyano at me.com <mailto:cyano at me.com>> wrote:
>> Hm, I don’t think I like that. Are there other examples of magic protocols in Swift?
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution