<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 22, 2016 at 11:34 PM, John McCall <span dir="ltr">&lt;<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@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"><div><span class=""><blockquote type="cite"><div>On Apr 22, 2016, at 11:11 PM, Jacob Bandes-Storch &lt;<a href="mailto:jtbandes@gmail.com" target="_blank">jtbandes@gmail.com</a>&gt; wrote:</div><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 22, 2016 at 10:50 PM, John McCall <span dir="ltr">&lt;<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div><div><div><br></div></div></div></div>I have not been following this discussion, but I would be extremely antsy about guaranteeing any particular representation for the set of values.  Guaranteeing a contiguous array implementation seems like a really bad idea, especially if that&#39;s taken to mean that we&#39;re going to actually provide a static global array.  But there&#39;s no way to avoid providing a public API, because a public conformance itself implies a public API with some level of corresponding overhead.</div></blockquote><div><br></div><div>A &quot;compiler magic&quot; version of the feature, like #allValues(MyEnum), could generate a static array *internal* to the caller&#39;s module, but I&#39;m sure there are implications or details of this which I&#39;m not aware of.</div></div></div></div></div></blockquote><div><br></div></span>That cannot be reconciled with resilience.  The caller cannot reliably know the set of stored cases; only the defining module can.</div><div><br></div><div>For similar reasons, only the defining module can be allowed to magically derive a conformance to your protocol, if indeed it&#39;s done with a protocol.</div></div></blockquote><div><br></div><div>What should/can this mean for enums imported from Obj-C, via other modules, or bridging headers / custom module maps? In these cases, the defining module has no Swift code. Is there a way to do it with pre-existing metadata in the module?</div></div></div></div>