<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=""><blockquote type="cite" class=""><br class="">protocol A {<br class=""> func f()<br class=""> func x()<br class="">}<br class=""><br class="">extension A {<br class=""> func x() {print("a-x")}<br class="">}<br class=""><br class="">class B: A { // already strange. B depends on A extension. did not implement all required methods from A<br class=""> func f() {}<br class="">}<br class=""></blockquote><br class="">In order to understand the various perspectives on what constitutes expected versus strange, it might be useful to have a sense of which programing language the viewpoint would be expressed from. <br class=""><br class="">For eg in this case, coming from objc it might indeed be surprising that one of the methods of Protocol A does not have to be implemented (this was well explained in last year's wwdc, or was it even 2 years ago). Coming from a java viewpoint however, this would present no surprise, except for having to write the default implementation in an extension rather than directly in the protocol itself. Scala, c#... and more? again different kinds of surprises, but overall the pleasant feeling that swift is actually a modern language.<br class=""><br class=""><div class=""><br class=""></div><div class="">I took the liberty to rewrite the examples with different variable name to avoid mixing expectations with behavior:</div><div class=""><br class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal; min-height: 14px;" class=""><span style="font-family: Helvetica;" class="">// ———————</span><span style="font-family: Helvetica;" class="">——————— </span></div>protocol</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> P {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x()</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x() {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"ext-x"</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures;" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> helper() {</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"ext-helper"</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> A:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x() {<span class="Apple-tab-span" style="white-space: pre;">                </span>// Note that ‘override’ is not required, even though in effect </span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);" class="">"a-x”</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)<span class="Apple-tab-span" style="white-space: pre;">        </span>// the local x() implementation is an override of the default</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }<span class="Apple-tab-span" style="white-space: pre;">                        </span>// supplied by the protocol extension. However at the same time,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}<span class="Apple-tab-span" style="white-space: pre;">                        </span>// by virtue of being defined inside an extension of the protocol</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">                        </span>// it is reasonable to consider that the default implementation</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">                        </span>// is NOT intrinsically a part of the protocol, defining an</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">                        </span>// implementation of x() inside a conforming class is NOT </span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">                        </span>// considered overriding the definition existing in the extension</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> B:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> {<span class="Apple-tab-span" style="white-space: pre;">                </span>// B is made to reliant on the extension for its A conformance</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> helper() {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"b-helper"</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> C:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">B</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x() {<span class="Apple-tab-span" style="white-space: pre;">                </span>// Note that ‘override’ is not required because B does not provide</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> (</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);" class="">"c-x”</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)<span class="Apple-tab-span" style="white-space: pre;">        </span>// its own implementation of x() (wasn’t there a proposal from </span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }<span class="Apple-tab-span" style="white-space: pre;">                        </span>// </span>E.Sadun regarding ‘override’ at this location?!)</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> helper() { <span class="Apple-tab-span" style="white-space: pre;">        </span>// Here ‘override’ is mandated by the presence of a similar</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"c-helper”</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)<span class="Apple-tab-span" style="white-space: pre;">                </span>// helper inside B</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; margin: 0px; line-height: normal; min-height: 14px;" class=""><span style="font-family: Helvetica;" class="">// ———————</span><span style="font-family: Helvetica;" class="">——————— </span></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; margin: 0px; line-height: normal; min-height: 14px;" class=""><font color="#008400" face="Menlo" class="">// invocation via the object type</font></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; margin: 0px; line-height: normal; min-height: 14px;" class=""><font color="#008400" face="Menlo" class=""><br class=""></font></div><div style="color: rgb(0, 0, 0); font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x1 = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">A</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="color: rgb(0, 132, 0); font-family: Menlo; margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x1</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// a-x<span class="Apple-tab-span" style="white-space: pre;">                        </span>no surprise</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x1</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper<span class="Apple-tab-span" style="white-space: pre;">                </span>no surprise</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></div><div style="color: rgb(0, 0, 0); font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x2 = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">B</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="color: rgb(0, 132, 0); font-family: Menlo; margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x2</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper + ext-x<span class="Apple-tab-span" style="white-space: pre;">        </span>!!! no surprise even if 'b-helper + ext-x’ might seem more ‘intuitive'</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x2</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// b-helper<span class="Apple-tab-span" style="white-space: pre;">                </span>no surprise</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></div><div style="color: rgb(0, 0, 0); font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x3 = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">C</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="color: rgb(0, 132, 0); font-family: Menlo; margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x3</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// c-x<span class="Apple-tab-span" style="white-space: pre;">                        </span>no surprise</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">x3</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// c-helper<span class="Apple-tab-span" style="white-space: pre;">                </span>no surprise</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></div><div class=""><font face="Menlo" class="">The direct invocation case is mostly without surprises, and in all cases, logically explainable. The only contentious point might be why the definition of helper() present in B is not used when helper() is invoked from the default method implementation supplied in the protocol extension.</font></div><div style="color: rgb(0, 0, 0); font-family: Helvetica;" class=""><span style="font-family: Menlo;" class=""><br class=""></span></div><div style="color: rgb(0, 0, 0); font-family: Helvetica;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Menlo; margin: 0px; line-height: normal; min-height: 14px;" class=""><span style="font-family: Helvetica;" class="">// ———————</span><span style="font-family: Helvetica;" class="">——————— </span></div><font color="#008400" face="Menlo" class="">// invocation via the protocol type</font></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> v1:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">A</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v1</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// a-x<span class="Apple-tab-span" style="white-space: pre;">                        </span>no surprise (</span><span style="color: rgb(0, 132, 0);" class="">type has precedence over default when directly equivalent)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v1</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper<span class="Apple-tab-span" style="white-space: pre;">                </span>no surprise</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> v2:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">B</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v2</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper + ext-x<span class="Apple-tab-span" style="white-space: pre;">        </span>coherent with x2.yyy() calls</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v2</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper<span class="Apple-tab-span" style="white-space: pre;">                </span>entirely coherent, even if possibly surprising</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> v3:</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">C</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper + ext-x<span class="Apple-tab-span" style="white-space: pre;">        </span>!!! again </span><span style="font-variant-ligatures: no-common-ligatures;" class="">this is surprising on the surface, but it stems</span> from the lack</div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper</span><span class="Apple-tab-span" style="white-space: pre;">                </span>of direct link to P. So when it comes to dealing with C as a</div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span class="Apple-tab-span" style="white-space: pre;">                                        </span>reference to a P, there is no alternative but to refer to B to </div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span class="Apple-tab-span" style="white-space: pre;">                                        </span>find out what to do</div></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">So we have identified some cases where depending on which programming language we might come from, there might be a mismatch between expectations and current Swift behavior, leading to possible bugs and or frustrations. Considering that nothing says that one line of intuition is more right than any other or even than the existing behavior, it may still be useful to manage expectations differently than they are today.</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">If the desire is to align the current code with the one line of expectations/intuition mentioned above, then it seems that the alternatives are the following:</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">1) Allow ‘<span style="color: rgb(187, 44, 162);" class="">override</span>’ at the point of definition of x() inside C() (despite the absence of a x() definition inside B). The same could be said of the definition of helper() inside B. </div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">One issue with this scenario is that technically speaking, the definition of helper() inside B or x() inside C are NOT overrides, because the methods they define are NOT a part of the protocol. This stems directly from the fact that default protocol methods in extensions are an <i class="">extension of the internal resolution mechanism</i> that is NOT a part of the formal definition of the protocol they supplement (see #5 for a solution that would make them FORMALLY a part of the protocol itself). IMO this semantic gap should eliminate this solution entirely</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">2) Support the following calling convention</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="color: rgb(187, 44, 162); font-family: Menlo;" class="">straw_man_dynamic_dispatch</span><font color="#4f8187" face="Menlo" class=""> v2</font><span style="color: rgb(79, 129, 135); font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">.</span><span style="color: rgb(49, 89, 93); font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">x</span><span style="color: rgb(79, 129, 135); font-family: Menlo; font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><font color="#008400" face="Menlo" class="">// ext-helper + ext-x (NOTE: does leave an expectation mismatch regarding 'b-helper’)</font></span></div><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch</span><font color="#4f8187" class=""> v2</font><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#4f8187" class="">.</font><font color="#31595d" class="">helper</font></span><span style="color: rgb(79, 129, 135); font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">// b-helper</span></span></div><div style="color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><span style="color: rgb(0, 132, 0);" class=""><br class=""></span></span></div></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><span style="color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch</span> v3</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">// c-</span><span style="color: rgb(0, 132, 0);" class="">x</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><span style="color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch</span> v3</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.<font color="#31595d" class="">helper</font></span><span style="font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">// c-</span><span style="color: rgb(0, 132, 0);" class="">helper</span></div><div class=""><span style="color: rgb(0, 132, 0);" class=""><br class=""></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">In this scenario, the user of P would express the desire to include any object type level redefinitions take precedence over any possible default behavior she might have provided in a protocol extension. Note that it does leave a possible expectations mismatch regarding the call to helper() from within the context of a dynamically resolved parent call. This could also be resolved by deciding that once-dynamic, always dynamic which would create more cognitive overload by having to trace every call-tree...</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">3) Extend 2) to all call sites of x() by making the annotation on the method inside protocol extension</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><div class=""><span style="color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><div style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> {</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class=""> func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x() {</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""> helper()</div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="color: rgb(209, 47, 27); font-variant-ligatures: no-common-ligatures;" class="">“ext-x”</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""> }</div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">fun</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> helper() {</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="color: rgb(209, 47, 27); font-variant-ligatures: no-common-ligatures;" class="">“ext-helper”</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""> }</div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class="">}</div></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v1</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// a-x</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v1</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v2</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// ext-helper + ext-x<span class="Apple-tab-span" style="white-space: pre;">        </span>might surprise some, but once again logical as helper() is NOT </span><span style="color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v2</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// c-x<span class="Apple-tab-span" style="white-space: pre;">                        </span></span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper<span class="Apple-tab-span" style="white-space: pre;">                </span>again complete logical as helper() in P is NOT </span><span style="color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch</span> and C has no formal relationship to P</div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="color: rgb(0, 132, 0);" class=""><br class=""></div></span></div><div class=""><span style="color: rgb(0, 0, 0);" class="">4) change the default behavior for dispatching calls to default methods in protocol extensions, and provide an annotation that indicates to opposite behavior per call-site and/or for all call-sites</span></div><div class=""><span style="color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><div style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">P</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> {</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">straw_man_static_dispatch func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x() {</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">“ext-x”</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">STATICALLY dispatched</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">fun</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> helper() {</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">“ext-helper”</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">dynamic dispatch</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span> </div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><br class=""></span></span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v1</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// a-x</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v1</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// ext-helper</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><br class=""></span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v2</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// b-helper + b-x</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v2</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// b-helper</span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><br class=""></span></div><div style="color: rgb(0, 0, 0); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</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="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">() </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 132, 0);" class="">// ext-x<span class="Apple-tab-span" style="white-space: pre;">                        </span></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">() </span><span style="font-variant-ligatures: no-common-ligatures;" class="">// c-helper</span></div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class="">5) leave things the way there are today, and support dynamically dispatched protocol defaults via a new default methods mechanism on protocol directly</div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""><div style="font-family: Menlo; margin: 0px; line-height: normal; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> P {</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font face="Menlo" class=""> </font><font color="#bb2ca2" face="Menlo" class="">straw_man_default_attribute</font><font face="Menlo" class=""> </font></span><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x() {</span></div><div style="font-family: Menlo; color: rgb(209, 47, 27); margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">“proto-x”</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> }</span></div><div style="font-family: Menlo; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></span></span></div><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">v1</span><span style="color: rgb(0, 0, 0);" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">x</span><span style="color: rgb(0, 0, 0); font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">                </span></span><span style="color: rgb(0, 132, 0);" class="">// a-x</span></span></span></div><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="color: rgb(79, 129, 135); font-variant-ligatures: no-common-ligatures;" class="">v1</span><span style="color: rgb(0, 0, 0);" class="">.</span><font color="#31595d" class="">helper</font><span style="color: rgb(0, 0, 0); font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">// ext-helper</span></span></span></div><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="color: rgb(0, 132, 0);" class=""><br class=""></span></span></span></div><div style="font-family: Menlo;" class=""><span style="color: rgb(79, 129, 135); font-variant-ligatures: no-common-ligatures;" class="">v2</span>.<span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">                </span></span><span style="color: rgb(0, 132, 0);" class="">// proto-x</span></div><div style="font-family: Menlo;" class=""><span style="color: rgb(79, 129, 135); font-variant-ligatures: no-common-ligatures;" class="">v2</span>.<span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="color: rgb(0, 132, 0);" class="">// ext-helper</span></div><div style="font-family: Menlo;" class=""><span style="color: rgb(0, 132, 0);" class=""><br class=""></span></div><div style="font-family: Menlo;" class=""><div style="font-family: Helvetica; margin: 0px; line-height: normal; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</span><font face="Menlo" class="">.</font><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">x</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">                </span></span><font color="#008400" face="Menlo" class="">// c-x</font><span class="Apple-tab-span" style="color: rgb(0, 132, 0); white-space: pre;">                </span><font color="#008400" face="Menlo" class="">- note that ‘override’ would then be REQUIRED inside the implementation of C().</font></div><div class=""><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">v3</span><font face="Menlo" class="">.</font><span style="font-variant-ligatures: no-common-ligatures; color: rgb(49, 89, 93);" class="">helper</span><span style="font-variant-ligatures: no-common-ligatures;" class="">()<span class="Apple-tab-span" style="white-space: pre;">        </span></span><font color="#008400" face="Menlo" class="">// ext-helper<span class="Apple-tab-span" style="white-space:pre">        </span>again local due to he absence of direct relationship between C and P (it is all via B-ness)</font></div><div class=""><font color="#008400" face="Menlo" class=""><br class=""></font></div></span></div></div></span></div></div></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class="">Regardless of the path chosen, there seems to be room today from more information from the compiler. </div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class="">@michael</div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><i class=""><span style="font-family: Helvetica;" class="">Can we agree that two methods with the same name sometimes have the same contract and sometimes not? And that this is not a programmer error? And that it would be good to distinguish between these two cases?</span></i></div></blockquote><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-family: Helvetica;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; min-height: 14px;" class="">yes on all accounts.</div><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; min-height: 14px;" class="">NOTES: </div><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""><ul class="MailOutline"><li class="">a<span style="font-family: Menlo;" class=""> reasonable candidate for the </span><span style="font-family: Menlo; color: rgb(187, 44, 162);" class="">straw_man_dynamic_dispatch </span><span style="font-family: Menlo;" class="">attribute may very well be the existing </span><span style="color: rgb(187, 44, 162); font-family: Menlo;" class="">dynamic</span></li><li class="">a<span style="font-family: Menlo;" class=""> reasonable candidate for the </span><span style="font-family: Menlo; color: rgb(187, 44, 162);" class="">straw_man_default_attribute </span><span style="font-family: Menlo;" class="">attribute might be </span><span style="color: rgb(187, 44, 162); font-family: Menlo;" class="">default</span></li><li class=""><span style="font-family: Menlo;" class="">a reasonable candidate for the </span><span style="font-family: Menlo; color: rgb(187, 44, 162);" class="">straw_man_static_dispatch </span><font face="Menlo" class="">attribute might be: </font><span style="color: rgb(187, 44, 162); font-family: Menlo;" class="">nondynamic </span></li><li class=""><span style="color: rgb(187, 44, 162); font-family: Menlo;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; margin: 0px; line-height: normal; min-height: 14px;" class=""><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""><ul class="MailOutline"><br class="Apple-interchange-newline"></ul></div></div><div class=""><br class=""></div></span></li></ul></div><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""><div style="margin: 0px; line-height: normal; min-height: 14px;" class=""></div></div></body></html>