<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 26, 2016 at 2:42 PM, Charles Srstka <span dir="ltr">&lt;<a href="mailto:cocoadev@charlessoft.com" target="_blank">cocoadev@charlessoft.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><blockquote type="cite">On Aug 26, 2016, at 2:34 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:<br></blockquote></span><div><span class=""><blockquote type="cite"><br><div><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>internal</span><span><span> </span></span><span>struct</span><span><span> </span>S {}</span></div><span><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>private</span><span><span> </span></span><span>protocol</span><span><span> </span>P {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>   <span> </span></span><span style="color:rgb(187,44,162)">func</span><span><span> </span>foo()</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>extension</span><span><span> </span></span><span style="color:rgb(79,129,135)">S</span><span>:<span> </span></span><span style="color:rgb(79,129,135)">P</span><span><span> </span>{</span></div></span><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>   <span> </span></span><span style="color:rgb(187,44,162)">func</span><span><span> </span>foo() {}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></div><div style="margin:0px;line-height:normal">- - - choose “Generated Interface” and you get: - - -</div><div style="margin:0px;line-height:normal"><br></div><div style="margin:0px;line-height:normal"><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>internal</span><span><span> </span></span><span>struct</span><span><span> </span>S {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>extension</span><span><span> </span></span><span style="color:rgb(79,129,135)">S</span><span><span> </span>{</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(187,44,162)"><span>   <span> </span></span><span>internal</span><span><span> </span></span><span>func</span><span><span> </span>foo()</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>}</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><span style="font-family:Helvetica;font-size:12px">- - -</span></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><span style="font-family:Helvetica;font-size:12px"><br></span></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><span style="font-family:Helvetica;font-size:12px">While the extension is visible, the fact that it adds conformance to P is not. Therefore, as far as code outside this file is concerned, there is no conformance to P.</span></span></div></div></div></div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">That&#39;s correct, but why should the compiler accept the code in this file, when both S and P are visible, and S is not overriding default implementations in P as it should? </div></div></blockquote><div><br></div></span><div>I am confused. Why should S, above, be required to override P’s default implementation of foo()?</div></div></div></blockquote><div><br></div><div>Sorry, I was referring to my original example: S is in a different file from P and has its own implementation of foo(), and P has its own default implementation of foo(). I assumed you simplified the example above to discuss the generated interface. I didn&#39;t realize you were moving on to a different example.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class=""><blockquote type="cite"><div><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></div></div><span><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">In any case, you have not solved the problem, which has nothing to do with whether something is &quot;reasonable to know&quot;: when a default implementation A is overridden by implementation B, implementation A may be visible only in a *more restricted* access scope than implementation B. (This is not the case with overriding superclass members in subclasses.) It can be perfectly &quot;reasonable to know&quot; about both A and B, but there is still no way you can indicate this knowledge by appending a keyword to the declaration for implementation B if the access scope for implementation A is unutterable where B is declared.</div></div></blockquote></span></div><div><br></div><div>Could you provide an example of code where this would present a problem?</div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I&#39;m still talking about the same example. How do you rationalize your statement that no keyword is needed because it&#39;s not &quot;reasonable to know&quot; about both S and P when compiling the file in which P is declared?</div></div></blockquote></span></div><br><div>When compiling the file in which P is declared, you would add the keyword. Code outside this file that happened to define methods named foo() would not, since they would not be consciously conforming to the protocol.</div></div></blockquote><div><br></div><div>What keyword could you add to P, when the overriding member is in S?</div><div><br></div><div>File A:</div><div>```</div><div>internal struct S {</div><div>  func foo() { }</div><div>}</div><div>```</div><div><br></div><div>File B:</div><div>```</div><div>private protocol P {</div><div>  func foo()</div><div>}</div><div><br></div><div>extension P {</div><div>  func foo() { }</div><div>}</div><div><br></div><div>extension S : P { }</div><div>```</div><div><br></div><div>Where do I append your proposed keyword? Or, how do you rationalize its not being required on the basis of &quot;reasonable to know&quot;?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div>Charles</div><div><br></div></font></span></div></blockquote></div><br></div></div>