<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Feb 2017, at 00:10, Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">Because<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">someInstance["key", .string("key1"), .integer(1), .string(stringKeyInstance), .integer(intIndexInstance), .integer(intIndexInstance), …]</code><span class="Apple-converted-space">&nbsp;</span>is simply ugly and should be hidden. Such API looks horrible.</p><p style="margin: 15px 0px;" class="">Is this discussion really going to end with every statement being questioned with “why”? Why is 42 the number that rules the universe?</p></div></div></blockquote><div>Lets stay polite and keep things civil.</div><div><br class=""></div><div>The "the client should not be able to extend the set of types you can pass to that subscript.” requirement seems totally arbitrary and an anti-pattern. I’m perfectly happy with:</div><div><br class=""></div><div>enum&nbsp;Key {<br class="">&nbsp; &nbsp;&nbsp;case&nbsp;string(String)<br class="">&nbsp; &nbsp;&nbsp;case&nbsp;int(Int)<br class="">}<br class=""><br class="">protocol&nbsp;KeyConvertible {<br class="">&nbsp; &nbsp;&nbsp;var&nbsp;key:&nbsp;Key&nbsp;{&nbsp;get&nbsp;}<br class="">}<br class=""><br class="">subscript(initial:&nbsp;String, others:&nbsp;KeyConvertible...) -&gt;&nbsp;Foo</div><br class=""><blockquote type="cite" class=""><div class=""><div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><div id="bloop_sign_1487545491369880064" class="bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class="">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p class="airmail_on" style="margin: 15px 0px;">Am 20. Februar 2017 um 00:03:44, Xiaodi Wu (<a href="mailto:xiaodi.wu@gmail.com" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">xiaodi.wu@gmail.com</a>) schrieb:</p><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><span style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><div class=""></div><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Sun, Feb 19, 2017 at 4:51 PM, Adrian Zubarev<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">adrian.zubarev@devandartist.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><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="margin-top: 0px; margin-bottom: 0px; word-wrap: break-word;" class=""><div class="m_2275515528959643236bloop_markdown"><p style="margin: 15px 0px;" class="">Matthew has pretty much summed up everything with a single question in his last reply. It makes me tired of repeating myself over and over again.</p><p style="margin: 15px 0px;" class="">Here’s the challenge for you:</p><p style="margin: 15px 0px;" class="">Implement a subscript where the first parameter is a String (trivial), but the second to n are String’s and/or Int’s. There is no restriction of order for the Int’s and String’s and there could be as many as you’d like, so no overloads are allowed (a hint: variadics). You should be able to use variables in that subscript and literals. You’re not allowed to use enum constructors</p></div></div></blockquote><div class="">Why not? You want a parameter that takes either String or Int. In another language, you might express this as `String | Int`, but Chris Lattner and others have said on this list that enums are the intended way of expressing this in Swift.<br class=""></div><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="margin-top: 0px; margin-bottom: 0px; word-wrap: break-word;" class=""><div class="m_2275515528959643236bloop_markdown"><p style="margin: 15px 0px;" class="">and the client should not be able to extend the set of types you can pass to that subscript. That said it can look like this:<span class="Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">someInstance["key", "key1", 1, stringKeyInstance, intIndexInstance, intIndexInstance, …]</code></p><p style="margin: 15px 0px;" class="">Creating hacks like unreachable types with hidden inits is prohibited.</p><p style="margin: 15px 0px;" class="">Have fun!</p></div><div class="m_2275515528959643236bloop_original_html"><div id="m_2275515528959643236bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><span class=""><br class=""></span></div><span class=""><br class=""></span><div id="m_2275515528959643236bloop_sign_1487544005385085184" class="m_2275515528959643236bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class=""><span class="">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</span></div></div><span class=""><br class=""></span><div class=""><div class="h5"><p class="m_2275515528959643236airmail_on" style="margin: 15px 0px;">Am 19. Februar 2017 um 23:25:11, Xiaodi Wu (<a href="mailto:xiaodi.wu@gmail.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">xiaodi.wu@gmail.com</a>) schrieb:</p><blockquote type="cite" class="m_2275515528959643236clean_bq" style="margin: 15px 0px;"><div style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><div dir="ltr" class=""><span class="">Sorry, I have read through this thread twice and do not understand the point you are making. Can you explain your example once more?</span><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Specifically, I do not understand why it is that your code should have problems with third-party types that conform to your protocol. If your protocol has requirements that third-party types cannot fulfill, then naturally those requirements will prevent a third-party from conforming new types to your protocol. OTOH, if your protocol does not have any requirements that third-party types cannot fulfill, then your code that accepts anything that conforms to your protocol should be indifferent to whether the conforming type is defined by you or someone else. After all, a conforming type would fulfill all the semantic and syntactic requirements of the protocol! If your protocol has requirements that you are unable to state in code, causing third-party types to conform that really shouldn't, then that is a case for additional features that allow you to express those requirements more accurately, not an argument for having protocols that can't be conformed to by a third-party. What am I missing?</span></div><div class=""><span class=""><br class=""></span><div class=""><div class="gmail_extra"><span class=""><br class=""></span><div class="gmail_quote"><span class="">On Sun, Feb 19, 2017 at 11:53 AM, Adrian Zubarev via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""></span><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="margin-top: 0px; word-wrap: break-word;" class=""><div id="m_2275515528959643236m_2643987633502928267bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class="">That’s the whole point I was making. :) Thank you Matthew. That makes my example a real world example and not just some bike shedding.</div><span class=""><br class=""></span><div id="m_2275515528959643236m_2643987633502928267bloop_sign_1487526717218961920" class="m_2275515528959643236m_2643987633502928267bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class=""><span class="">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</span></div></div><span class=""><br class=""></span><div class=""><div class="m_2275515528959643236h5"><p class="m_2275515528959643236m_2643987633502928267airmail_on" style="margin: 15px 0px;">Am 19. Februar 2017 um 18:50:31, Matthew Johnson (<a href="mailto:matthew@anandabits.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">matthew@anandabits.com</a>) schrieb:</p><blockquote type="cite" class="m_2275515528959643236m_2643987633502928267clean_bq" style="margin: 15px 0px;"><div dir="auto" style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><div class=""><span class=""><br class=""><br class="">Sent from my iPad</span></div><div class=""><span class=""><br class="">On Feb 19, 2017, at 11:29 AM, David Waite via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""></span></div><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span class="">Just FYI, I solved this issue in my own library (which included a json jpointer implementation) via:</span><div class=""><span class=""><span style="font-family: Menlo; font-size: 18px; font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class=""><br class=""></span></span></div><div style="font-size: 8px;" class=""><span style="font-family: Menlo; font-size: 13px; font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">public</span><span class="Apple-converted-space">&nbsp;</span><span style="font-family: Menlo; font-size: 13px; font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">enum</span><span class="Apple-converted-space">&nbsp;</span><span style="font-family: Menlo; font-size: 13px; font-variant-ligatures: no-common-ligatures;" class="">SubscriptParameter {</span></div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">case</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">string(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">case</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">int(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; min-height: 21px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(97, 34, 174);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">extension</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(83, 154, 164);" class="">SubscriptParameter</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">ExpressibleByIntegerLiteral</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">public</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(integerLiteral value:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">self</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">= .</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">int</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(value)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; min-height: 21px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(97, 34, 174);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">extension</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(83, 154, 164);" class="">SubscriptParameter</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">ExpressibleByStringLiteral</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(33, 150, 28);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">public</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(stringLiteral value:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">self</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">= .</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">string</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(value)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">public</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(extendedGraphemeClusterLi<wbr class="">teral value:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(stringLiteral: value)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; min-height: 21px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">public</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(unicodeScalarLiteral value:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">self</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(stringLiteral: value)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; min-height: 21px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(97, 34, 174);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">extension</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(83, 154, 164);" class="">SubscriptParameter</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">CustomStringConvertible</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">public</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">var</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">description:</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(196, 34, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">switch</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">self</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">{</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">case</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">string</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(let str):</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">return</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 27, 19);" class="">"\"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">\</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 27, 19);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">str</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 27, 19);" class="">)\""</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">case</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">int</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(let i):</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp; &nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">return</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(i)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; min-height: 21px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">func</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">debug(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(196, 34, 117);" class="">_</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">path:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(83, 154, 164);" class="">SubscriptParameter</span><span style="font-variant-ligatures: no-common-ligatures;" class="">...) {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(200, 27, 19);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(62, 30, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"path is</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">\</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">path</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; min-height: 21px;" class=""><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(200, 27, 19);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(41, 76, 80);" class="">debug</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 53, 255);" class="">1</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"foo"</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(4, 53, 255);" class="">2</span><span style="font-variant-ligatures: no-common-ligatures;" class="">,</span><span class="Apple-converted-space">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"bar”</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) // path is [1, “foo”, 2, “bar”]</span></div></div></div></blockquote><div class=""><br class=""></div>Can you make this work with variables - not just literals - and still prevent users from extending the set of types and without requiring an enum case constructor to be used by clients?<div class=""><br class=""><div class=""><br class=""><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px;" class="">On Feb 19, 2017, at 1:14 AM, Adrian Zubarev &lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">adrian.zubarev@devandartist.c<wbr class="">om</a>&gt; wrote:</div><br class="m_2275515528959643236m_2643987633502928267Apple-interchange-newline"><div style="margin-bottom: 0px;" class=""><div class="m_2275515528959643236m_2643987633502928267bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px;" class="">If you haven’t followed the other thread Matthew previously opened than you have missed the example I showed there.</p><p style="margin: 15px 0px;" class="">Here it is again:</p><pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="m_2275515528959643236m_2643987633502928267swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal;">public protocol SubscriptParameterType {
         
    // This property was needed to prevent the client from breaking
    // the library by conforming to the protocol, but I'd like to      
    // keep it invisible for the client, or even better prevent the
    // client from conforming to the protocol.
    var parameter: Document.SubscriptParameter { get }
}

extension Document {
         
    public enum SubscriptParameter {
                 
        case string(String)
        case integer(Int)
    }
}

extension String : SubscriptParameterType {
         
    public var parameter: Document.SubscriptParameter {
             
        return .string(self)
    }
}

extension Int : SubscriptParameterType {
         
    public var parameter: Document.SubscriptParameter {
             
        return .integer(self)
    }
}

// Somewhere inside the `Document` type
public subscript(firstKey: String, parameters: SubscriptParameterType...) -&gt; Value? { … }
</code></pre><p style="margin: 15px 0px;" class="">The absence of closed protocols forced me to create a special requirement on that protocol to prevent the client from conforming to that protocol and passing instances of other types my API wouldn’t want to deal with. That creates unnecessary copies and I need to unpack the enum payload to find out which type the user passed. Instead I could simply close the protocol, wouldn’t need the requirement to exist and I could simply cast the type to<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">String</code><span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span>or<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">Int</code><span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span>when needed.</p><p style="margin: 15px 0px;" class="">That implementation enables more safe queries of my Document type like</p><p style="margin: 15px 0px;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">document["key1", intIndexInstance, stringKeyInstance, 10, "key"]</code></p><p style="margin: 15px 0px;" class="">rather than<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span></p><p style="margin: 15px 0px;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">document["key1/\(intIndexInsta<wbr class="">nce)/\(stringKeyInstance)/10/<wbr class="">key"]</code>.</p><hr style="height: 0.2em; border: 0px; color: rgb(204, 204, 204); background-color: rgb(204, 204, 204); display: inherit;" class=""><p style="margin: 15px 0px;" class="">Here is a list of hidden and semi-hidden protocols from the standard library that could be closed. Formatted version:<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><a href="https://gist.github.com/DevAndArtist/168c800d784829be536c407311953ab7" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://gist.github.c<wbr class="">om/DevAndArtist/168c800d784829<wbr class="">be536c407311953ab7</a></p><table style="margin: 15px 0px; border-collapse: collapse; font-family: Helvetica, arial, freesans, clean, sans-serif; color: rgb(51, 51, 51); font-size: 15px; line-height: 25px; padding: 0px;" class=""><colgroup class=""><col style="text-align: left;" class=""><col style="text-align: center;" class=""></colgroup><thead class=""><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><th style="font-weight: bold; border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">Path</th><th style="font-weight: bold; border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class="">Protocol</th></tr></thead><tbody class=""><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/AnyH<wbr class="">ashable.swift:16</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_HasCustomAnyHashableRepresent<wbr class="">ation</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Bidi<wbr class="">rectionalCollection.swift:21</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_BidirectionalIndexable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Brid<wbr class="">geObjectiveC.swift:19</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ObjectiveCBridgeable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Coll<wbr class="">ection.swift:20</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_IndexableBase</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Coll<wbr class="">ection.swift:176</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Indexable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:193</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinIntegerLi<wbr class="">teral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:240</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinFloatLite<wbr class="">ral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:283</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinBooleanLi<wbr class="">teral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:316</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinUnicodeSc<wbr class="">alarLiteral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:350</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinExtendedG<wbr class="">raphemeClusterLiteral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:398</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinStringLit<wbr class="">eral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:407</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByBuiltinUTF16Stri<wbr class="">ngLiteral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:670</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByStringInterpolat<wbr class="">ion</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:709</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByColorLiteral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:720</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByImageLiteral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:730</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ExpressibleByFileReferenceLit<wbr class="">eral</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Comp<wbr class="">ilerProtocols.swift:750</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_DestructorSafeContainer</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Fixe<wbr class="">dPoint.swift.gyb:53</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Integer</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Fixe<wbr class="">dPoint.swift.gyb:70</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_SignedInteger</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Fixe<wbr class="">dPoint.swift.gyb:108</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_DisallowMixedSignArithmetic</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Hash<wbr class="">able.swift:16</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Hashable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Inde<wbr class="">x.swift:16</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Incrementable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Inte<wbr class="">gerArithmetic.swift.gyb:33</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_IntegerArithmetic</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Mirr<wbr class="">or.swift:721</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_DefaultCustomPlaygroundQuickL<wbr class="">ookable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Muta<wbr class="">bleCollection.swift:20</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_MutableIndexable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Newt<wbr class="">ypeWrapper.swift.gyb:16</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_SwiftNewtypeWrapper</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Poin<wbr class="">ter.swift:16</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Pointer</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Rand<wbr class="">omAccessCollection.swift:20</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_RandomAccessIndexable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Rang<wbr class="">eReplaceableCollection.swift.<wbr class="">gyb:27</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_RangeReplaceableIndexable</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Refl<wbr class="">ectionLegacy.swift:41</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_Mirror</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:27</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ShadowProtocol</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:31</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSFastEnumeration</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:41</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSEnumerator</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:51</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSCopying</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:61</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSArrayCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:83</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSDictionaryCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:125</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSDictionary</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:137</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSSetCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:171</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSSet</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:177</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSNumber</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:187</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSArrayCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:188</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSDictionaryCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Shad<wbr class="">owProtocols.swift:189</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSSetCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/core/Stri<wbr class="">ngBridge.swift:194</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_NSStringCore</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/SDK/Found<wbr class="">ation/NSError.swift:353</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ObjectiveCBridgeableError</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/SDK/Found<wbr class="">ation/NSError.swift:379</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">__BridgedNSError</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/SDK/Found<wbr class="">ation/NSError.swift:446</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_BridgedNSError</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: rgb(248, 248, 248); margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/SDK/Found<wbr class="">ation/NSError.swift:456</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_BridgedStoredNSError</code></td></tr><tr style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); background-color: white; margin: 0px; padding: 0px;" class=""><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: left;" class="">/swift/stdlib/public/SDK/Found<wbr class="">ation/NSError.swift:564</td><td style="border: 1px solid rgb(204, 204, 204); margin: 0px; padding: 6px 13px; text-align: center;" class=""><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">_ErrorCodeProtocol</code></td></tr></tbody></table><div style="margin: 15px 0px;" class=""><br class="m_2275515528959643236m_2643987633502928267webkit-block-placeholder"></div></div><div class="m_2275515528959643236m_2643987633502928267bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);"><div id="m_2275515528959643236m_2643987633502928267bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div id="m_2275515528959643236m_2643987633502928267bloop_sign_1487490659060471040" class="m_2275515528959643236m_2643987633502928267bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class="">--&nbsp;<br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p class="m_2275515528959643236m_2643987633502928267airmail_on" style="margin: 15px 0px;">Am 19. Februar 2017 um 07:59:45, David Waite via swift-evolution (<a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a>) schrieb:</p><blockquote type="cite" class="m_2275515528959643236m_2643987633502928267clean_bq" style="margin: 15px 0px;"><div style="margin-top: 0px; margin-bottom: 0px;" class=""><div class=""><span style="margin-top: 0px; margin-bottom: 0px;" class="">I am unsure if this feature is a good idea. Does someone have a real-world use for this which isn’t just hiding strong implementation coupling behind a protocol?<br class=""><br class="">When I consume a protocol, it is under the assumption that the protocol is documented such that I would be able to work against *any* implementation of the protocol. With a closed protocol, I would have to assume that there are significant side effects, either undocumented or difficult for a third party to duplicate. To my experience, that sounds brittle.<br class=""><br class="">Assuming you aren’t switching on the implementing type of a protocol (which itself can be a sign that your design isn’t properly using polymorphism), one could get this design by creating a struct with the interface desired, and passing invocations through to an internal protocol reference.<br class=""><br class="">-DW<br class=""><br class="">&gt; On Feb 18, 2017, at 1:41 PM, Matthew Johnson via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a>&gt; wrote:<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Now that we’re in phase 2 I’d like to officially propose we introduce `open` protocols and require conformances to `public` protocols be inside the declaring module. Let’s use this thread for feedback on the official proposal. After a healthy round of discussion I’ll open a PR to submit it for review.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; # Feature name<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; * Proposal: [SE-NNNN](NNNN-open-public-<a href="http://protocols.md/" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">pro<wbr class="">tocols.md</a>)<br class="">&gt; * Authors: [Matthew Johnson](<a href="https://github.com/anandabits" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://github.com/an<wbr class="">andabits</a>)<br class="">&gt; * Review Manager: TBD<br class="">&gt; * Status: **Awaiting review**<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Introduction<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; This proposal introduces `open protocol` and changes the meaning of `public protocol` to match the meaning of `public class` (in this case, conformances are only allowed inside the declaring module).<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The pitch thread leading up to this proposal was: [consistent public access modifiers](<a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170206/031653.html" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift<wbr class="">.org/pipermail/swift-evolution<wbr class="">/Week-of-Mon-20170206/031653.<wbr class="">html</a>)<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Motivation<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; A general principle the Swift community has adopted for access control is that defaults should reserve maximum flexibility for a library. The ensures that any capabilities beyond mere visibility are not available unless the author of the library has explicitly declared their intent that the capabilities be made available. Finally, when it is possible to switch from one semantic to another without breaking clients (but not vice-versa) we should prefer the more forgiving (i.e. fixable) semantic as the (soft) default.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; `public` is considered a "soft default" in the sense that it is the first access modifier a user will reach for when exposing a declaration outside of the module. In the case of protocols the current meaning of `public` does not meet the principle of preserving maximum flexibility for the author of the library. It allows users of the library to conform to the protocol.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; There are good reasons a library may not wish to allow users to add conformances to a protocol. For example, it may not wish to expose the conforming concrete types. While similar behavior could be accomplished with an enum if cases could be private, that requires an implementation to use switch statements rather than polymorphism.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Even if all the conforming types are also public there are cases where polymorphism is the preferred implementation. For example, if the set of conforming types is not expected to be fixed (despite all being inside the library) the authors may not want to have to maintain switch statements every time they need to add or remove a confroming type which would be necessary if an enum were used instead. Polymorphism allows us to avoid this, giving us the ability to add and remove conforming types within the implementation of the library without the burden of maintaining switch statements.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Aligning the access modifiers for protocols and classes allows us to specify both conformable and non-conformable protocols, provides a soft default that is consistent with the principle of (soft) defaults reserving maximum flexibility for the library, and increases the overall consistency of the language by aligning the semantics of access control for protocols and classes.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The standard library currently has at least one protocol (`MirrorPath`) that is documented as disallowing client conformances. If this proposal is adopted it is likely that `MirrorPath` would be declared `public protocol` and not `open protocol`.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Jordan Rose has indicated that the Apple frameworks also include a number of protocols documented with the intent that users do not add conformances. Perhaps an importer annotation would allow the compiler to enforce these semantics in Swift code as well.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Proposed solution<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The proposed solution is to change the meaning of `public protocol` to disallow conformances outside the declaring module and introduce `open protocol` to allow conformances outside the decalring module (equivalent to the current meaning of `public protocol`).<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Detailed design<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The detailed design is relatively straightforward but there are three important wrinkles to consider.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ### User refinement of public protocols<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Consider the following example:<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ```swift<br class="">&gt; // Library module:<br class="">&gt; public protocol P {}<br class="">&gt; public class C: P {}<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; // User module:<br class="">&gt; protocol User: P {}<br class="">&gt; extension C: User {}<br class="">&gt; ```<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The user module is allowed to add a refinement to `P` because this does not have any impact on the impelementation of the library or its possible evolution. It simply allows the user to write code that is generic over a subset of the conforming types provided by the library.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ### Public protocols with open conforming classes<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Consider the following example:<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ```swift<br class="">&gt; public protocol P P{}<br class="">&gt; open class C: P {}<br class="">&gt; ```<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Users of this module will be able to add subclasses of `C` that have a conformance to `P`. This is allowed becuase the client of the module did not need to explicitly declare a conformance and the module has explicitly stated its intent to allow subclasses of `C` with the `open` access modifier.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ### Open protocols that refine public protocols<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; Consider the following example:<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ```swift<br class="">&gt; // library module:<br class="">&gt; public protocol P {}<br class="">&gt; open protocol Q: P {}<br class="">&gt; open protocol R: P {}<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; // user module:<br class="">&gt; struct S: P {} // error `P` is not `open`<br class="">&gt; struct T: Q {} // ok<br class="">&gt; struct U: R {} // ok<br class="">&gt; ```<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The user module is allowed to introudce a conformance to `P`, but only indirectly by also conforming to `Q`. The meaning we have ascribed to the keywords implies that this should be allowed and it offers libraries a very wide design space from which to choose. The library is able to have types that conform directly to `P`, while placing additional requirements on user types if necessary.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Source compatibility<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; This proposal breaks source compatibility, but in a way that allows for a simple mechanical migration. A multi-release stratgegy will be used to roll out this proposal to provide maximum possible source compatibility from one release to the next.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; 1. In Swift 4, introduce the `open` keyword and the `@nonopen` attribute (which can be applied to `public protocol` to give it the new semantics of `public`).<br class="">&gt; 2. In Swift 4 (or 4.1 if necessary) start warning for `public protocol` with no annotation.<br class="">&gt; 3. In the subsequent release `public protocol` without annotation becomes an error.<br class="">&gt; 4. In the subsequent relase `public protocol` without annotation takes on the new semantics.<br class="">&gt; 5. `@nonopen` becomes a warning, and evenutally an erro as soon as we are comfortable making those changes.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Effect on ABI stability<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; I would appreciate it if others can offer input regarding this section. I believe this proposal has ABI consequences, but it's possible that it could be an additivie ABI change where the ABI for conformable protocols remains the same and we add ABI for non-conformable protocols later. If that is possible, the primary impact would be the ABI of any standard library protocols that would prefer to be non-conformable.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Effect on API resilience<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; This proposal would may impact one or more protocols in the standard library, such as `MirrorPath`, which would likely choose to remain `public` rather than adopt `open`.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ## Alternatives considered<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; The primary alternatives are to either make no change, or to add something like `closed protocol`. The issues motivating the current proposal as a better alternative than either of these options are covered in the motivation section.<br class="">&gt;<span class="m_2275515528959643236m_2643987633502928267Apple-converted-space">&nbsp;</span><br class="">&gt; ______________________________<wbr class="">_________________<br class="">&gt; swift-evolution mailing list<br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a><br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-evolution</a><br class=""><br class="">______________________________<wbr class="">_________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-evolution</a><br class=""></span></div></div></blockquote></div><div class="m_2275515528959643236m_2643987633502928267bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(254, 254, 254);"></div></div></blockquote></div><br class=""></div></div></div></blockquote><blockquote type="cite" style="margin: 15px 0px;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span class="">______________________________<wbr class="">_________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></div></div></div></blockquote></div></div></div><br class="">______________________________<wbr class="">_________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-evolution</a><br class=""><br style="margin-bottom: 0px;" class=""></blockquote></div><br class=""></div></div></div></div></div></div></blockquote></div></div></div><div class="m_2275515528959643236bloop_markdown"></div></div></blockquote></div><br class=""></div></div></div></div></span></blockquote></div><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><div style="margin: 15px 0px; -webkit-margin-before: 0px;" class=""><br class="webkit-block-placeholder"></div></div><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254); float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><a href="mailto:swift-evolution@swift.org" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="color: rgb(65, 131, 196); background-color: rgb(254, 254, 254); text-decoration: none; font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);" class=""></div></blockquote></div><br class=""></body></html>