<div dir="ltr">Would you agree that it makes sense to:<div><br></div><div>1. Automatically derive CaseEnumerable (or ValueEnumerable or whatever we choose) for Swift enums without associated values;</div><div>2. Still allow &quot;extension Foo: CaseEnumerable {}&quot; to add it to enums imported from (Obj-)C headers?</div><div><br></div><div>Or is it OK as-is, or is it worth pursuing some kind of &quot;deriving&quot; syntax?</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>Jacob Bandes-Storch<br></div></div></div></div>
<br><div class="gmail_quote">On Tue, Jan 19, 2016 at 12:17 PM, Joe Groff <span dir="ltr">&lt;<a href="mailto:jgroff@apple.com" target="_blank">jgroff@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The compiler implicitly derives T: Equatable for enums without associated values, and IMO it&#39;d be reasonable to extend this to other types and/or other protocols.<span class="HOEnZb"><font color="#888888"><div><br></div><div>-Joe</div></font></span><div><br><div><blockquote type="cite"><div><div class="h5"><div>On Jan 19, 2016, at 11:37 AM, David Waite via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br></div></div><div><div><div class="h5"><div style="word-wrap:break-word">ErrorType’s magic is only for Objective-C interoperability, and only exposed by diving into compiler implementation-level protocols.<div><br></div><div>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.</div><div><br></div><div>-DW</div><div><br><div><blockquote type="cite"><div>On Jan 19, 2016, at 11:36 AM, Jacob Bandes-Storch via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div dir="ltr">Yes: ErrorType.</div></div></blockquote><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">On Tue, Jan 19, 2016 at 10:21 AM, Sune Foldager <span dir="ltr">&lt;<a href="mailto:cyano@me.com" target="_blank">cyano@me.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><span><br></span><div>Hm, I don’t think I like that. Are there other examples of magic protocols in Swift?</div></div></blockquote></div></blockquote></div></div></div></blockquote></div></div></div></div></div></div>_______________________________________________<span class=""><br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></blockquote></div><br></div></div></blockquote></div><br></div></div>