<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 6, 2017 at 9:29 PM Jose Cheyo Jimenez &lt;<a href="mailto:cheyo@masters3d.com">cheyo@masters3d.com</a>&gt; wrote:<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><blockquote type="cite"><div>On Oct 6, 2017, at 8:58 PM, Tony Allevato &lt;<a href="mailto:tony.allevato@gmail.com" target="_blank">tony.allevato@gmail.com</a>&gt; wrote:</div><br class="m_-164326603858471284Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;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"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 6, 2017 at 8:45 PM Jose Cheyo Jimenez &lt;<a href="mailto:cheyo@masters3d.com" target="_blank">cheyo@masters3d.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Oct 6, 2017, at 8:01 PM, Tony Allevato &lt;<a href="mailto:tony.allevato@gmail.com" target="_blank">tony.allevato@gmail.com</a>&gt; wrote:</div><div><div dir="ltr" style="font-family:Helvetica;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"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><br></div></div></blockquote><div>At the time SE-0025 was accepted, &quot;private extension&quot; would have been meaningless if it did not mean &quot;fileprivate&quot; because it predated the SE-0169 behavior extending &quot;private&quot; to extensions in the same file. The very issue being debated here is whether the oversight that SE-0169 did not consider extensions—now that &quot;private extension&quot; *could* have a meaningful use separate from &quot;fileprivate extension&quot;—is something that is worth correcting.</div><div><br></div><div>If the documentation is out-of-date and needs to be updated to list describe unintuitive special behavior, why not use the opportunity to make the behavior intuitive and consistent instead?</div></div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>Lets say you “fix” the private extension override. Now MyClass2.myFunc2() is not accessible from outside the type. </div><div>Wouldn&#39;t MyClass2.myFunc2() now be inconsistent with MyClass.myFunc()? </div><div>I don’t think you can make a change to one with out causing other inconsistencies. I rest my case.  :) </div></div></div></blockquote><div><br></div><div>No, because a class is a concrete &quot;thing&quot; whose access level which—while providing an upper bound for access levels of its defaulting members—is otherwise independent of the access level of its members.</div><div><br></div><div>Extensions, on the other hand, aren&#39;t a concrete thing of their own. The access level on an extension exists *solely* as a shortcut to specify the upper bound for its defaulting members that are injected into the main type.</div><div><br></div><div>What happens in your example if you replace &quot;private&quot; with &quot;public&quot;? Then myFunc has internal access but myFunc2 is public. So the &quot;inconsistency&quot; you&#39;re pointing out between access inherited from a type and access inherited from an extension already exists—they&#39;re apples and oranges.</div><div><br></div><div>That&#39;s why access levels of classes/structs/other types aren&#39;t relevant examples here—extensions treat access levels fundamentally differently.</div></div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div>Sure. Extensions apply a default upper bound and types can lower the upper bound of the default internal members. The upper bound on the below example is the same for both when dealing with top level private.</div><div><br></div><div>Extensions should resolve their upper bound accessibility where the ‘private’ appears explicitly and this now happens to be the same for both types and extensions regardless of how they are enforced. </div></div></blockquote><div><br></div><div>But *why* do you think that should be? You&#39;re stating what the current situation is and you say that it &quot;should&quot; be that way, but why should we accept that status quo instead of making &quot;private extension&quot; more useful for people who use &quot;private&quot; in the sense introduced by SE-0169, when the argument for consistency can honestly be argued either way (the two options I wrote a few messages up)?</div><div><br></div><div> </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><blockquote type="cite"><div><div dir="ltr" style="font-family:Helvetica;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"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div><div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(222,56,165);background-color:rgb(0,0,0)">private<span style="color:rgb(255,255,255)"> </span>class<span style="color:rgb(255,255,255)"> MyClass {</span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">    <span style="color:rgb(222,56,165)">static</span> <span style="color:rgb(222,56,165)">func</span> myFunc(){ <span style="color:rgb(75,209,86)">// This would now act differently from private extensions? </span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,70,71);background-color:rgb(0,0,0)"><span style="color:rgb(255,255,255)">        </span><span style="color:rgb(0,177,255)">print</span><span style="color:rgb(255,255,255)">(</span>&quot;acts like fileprivate now&quot;<span style="color:rgb(255,255,255)">)</span></div></div></div></div></div><div style="word-wrap:break-word"><div><div><div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">    }</div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">}</div><div style="margin:0px;font-size:12px;line-height:normal;background-color:rgb(0,0,0);min-height:14px"><br></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)"><span style="color:rgb(222,56,165)">private</span> <span style="color:rgb(222,56,165)">class</span> MyClass2 {}</div><div style="margin:0px;font-size:12px;line-height:normal;background-color:rgb(0,0,0);min-height:14px"><br></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(222,56,165);background-color:rgb(0,0,0)">private<span style="color:rgb(255,255,255)"> </span>extension<span style="color:rgb(255,255,255)"> </span><span style="color:rgb(8,250,149)">MyClass2</span><span style="color:rgb(255,255,255)">{</span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">      <span style="color:rgb(222,56,165)">static</span> <span style="color:rgb(222,56,165)">func</span> myFunc2(){</div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,70,71);background-color:rgb(0,0,0)"><span style="color:rgb(255,255,255)">       </span><span style="color:rgb(0,177,255)">print</span><span style="color:rgb(255,255,255)">(</span>&quot;Same as MyClass.myFunc&quot;<span style="color:rgb(255,255,255)">)</span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">    }</div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">}</div><div style="margin:0px;font-size:12px;line-height:normal;background-color:rgb(0,0,0);min-height:14px"><br></div><div style="margin:0px;font-size:12px;line-height:normal;background-color:rgb(0,0,0);min-height:14px"><br></div></div></div></div></div><div style="word-wrap:break-word"><div><div><div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(75,209,86);background-color:rgb(0,0,0)"><span style="color:rgb(8,250,149)">MyClass</span><span style="color:rgb(255,255,255)">.</span><span style="color:rgb(8,250,149)">myFunc</span><span style="color:rgb(255,255,255)">() </span>// acts like fileprivate</div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(75,209,86);background-color:rgb(0,0,0)"><span style="color:rgb(8,250,149)">MyClass2</span><span style="color:rgb(255,255,255)">.</span><span style="color:rgb(8,250,149)">myFunc2</span><span style="color:rgb(255,255,255)">() </span>// The proposed change would hide myFunc2</div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(75,209,86);background-color:rgb(0,0,0)"><span style="color:rgb(255,255,255)">             </span>//Error: &#39;myFunc2&#39; is inaccessible due to &#39;private&#39; protection level</div></div></div></div></div></blockquote></div></div></div></blockquote></div><br></div></blockquote></div></div>