<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">It certainly could break *some* code. But it only breaks code written by an author who wrote ‘private extension’ knowing that ‘fileprivate extension’ was also an option, but still intended it to be shared with the whole file. (If that code was from Swift 2, it would have already been migrated to ‘fileprivate extension’ by the 2-&gt;3 migrator.)<div><br></div><div>So existing code that says ‘private extension’ was written in a Swift 3 or 4 era when ‘fileprivate’ was an option. If the goal was specifically to share it with the whole file, it seems likely that most authors would have used ‘fileprivate extension’ instead of ‘private extension’, as that better communicates the intention. Regardless, though, we could check against the Swift source compatibility test suite to see how widespread that is.</div><div><br></div><div>Regardless, I think this change makes Swift a better language, and I’m in favor of it.</div><div><br><div id="AppleMailSignature">-BJ</div><div><br>On Oct 4, 2017, at 9:10 PM, Jose Cheyo Jimenez via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div></div><div><br></div><div><br>On Oct 2, 2017, at 9:59 PM, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><br><div><br>On 3 Oct 2017, at 05:12, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">On Mon, Oct 2, 2017 at 9:16 PM, Matthew Johnson via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><br><br><div id="m_565568921357597014AppleMailSignature">Sent from my iPad</div><span class=""><div><br>On Oct 2, 2017, at 7:33 PM, Jordan Rose via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><br><div><br><blockquote type="cite"><div>On Oct 2, 2017, at 03:25, Vladimir.S via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_565568921357597014Apple-interchange-newline"><div><div>On 01.10.2017 1:18, Chris Lattner wrote:<br><blockquote type="cite"><blockquote type="cite">On Sep 29, 2017, at 10:42 AM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><br>Vladimir, I agree with you on that change, but it’s a separate topic from this one.<br><br>Tony is absolutely correct that this topic has already been discussed. It is a deliberate design decision that public types do not automatically expose members without explicit access modifiers; this has been brought up on this list, and it is clearly not in scope for discussion as no new insight can arise this late in the game. The inconsistency with public extensions was brought up, the proposed solution was to remove modifiers for extensions, but this proposal was rejected. So, the final design is what we have.<br></blockquote>Agreed.&nbsp; The core team would only consider a refinement or change to access control if there were something actively broken that mattered for ABI stability.<br></blockquote><br>So we have to live with *protected* extension inconsistency for very long time just because core team don't want to even discuss _this particular_ inconsistency(when access level in *private extension* must be private, not fileprivate)?<br><br>Yes, we decided that access level for extension will mean a default and top most access level for nested methods, OK. But even in this rule, which already differ from access modifiers for types, we have another one special case for 'private extension'.<br><br>Don't you think this is not normal situation and actually there IMO can't be any reason to keep this bug-producing inconsistency in Swift? (especially given Swift 5 seems like is a last moment to fix this)</div></div></blockquote><br></div><div>I hate to say it but I'm inclined to agree with Vladimir on this. "private extension" has a useful meaning now distinct from "fileprivate extension", and it was an oversight that&nbsp;<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md" target="_blank">SE-0169</a>&nbsp;didn't include a fix here. On this <i>very narrow, very specific </i>access control issue I think it would still be worth discussing; like Xiaodi said it's not related to James' original thread-starter.</div></div></blockquote><div><br></div></span><div>I agree with this in principle but would not want to see it become a slippery slope back into extremely long access control discussions.</div><span class=""><br></span></div></blockquote><div><br></div><div>As I've said elsewhere, I too agree with this in principle. I agree with Jordan that the current state of things is justifiable but the alternative would be somewhat superior, agree that in a vacuum this very narrow and specific discussion might be warranted, and agree also that this could be a very slippery slide down a very steep slope.</div></div></div></div></div></blockquote><div><br></div><div>Same here. It’s the only grudge I have left with the current access control situation. I remember Doug Gregor and John McCall discussing this during the last access control proposal. And I wouldn’t mind having a very narrow discussion about only this.</div><div><br></div><div>I organize my types into extensions for each conformance and for each access control. I can currently implicitly apply public or fileprivate to all members of an extension but I have no way of doing the same for private. That’s why I think it should be fixed.</div></div></blockquote><div><br></div><div>This will break a bunch of code because `private extension` has <u>always</u> meant `fileprivate extension`. <span style="background-color: rgba(255, 255, 255, 0);">Even Swift 3 had this same behavior.&nbsp;</span>Lowering the access level of the extension members will hide a bunch of code that was visible to the file.&nbsp;</div><div><br></div><div>169 was not a breaking change but this “fix” would have made it a breaking change. I doubt 169 would had been accepted if it was a breaking change. I don’t think it’s worth it.&nbsp;</div><div><br></div><div><br></div><div><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica;"><span style="font-size: 12pt;"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md">https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md</a></span></p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica;"><span style="font-size: 12pt;"><br></span></p><p style="margin: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Helvetica;"><span style="font-size: 12pt;"><br></span></p></div><br><blockquote type="cite"><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><blockquote type="cite"><div><div><br></div><div>(I maintain that the current model does <i>not</i>&nbsp;include a special case; it simply means the 'private' is resolved at the level of the extension rather than the level of its members. But that isn't what people expect and it's not as useful.)</div><div><br></div><div><br></div><div>I agree that changing the behavior of <i>all</i>&nbsp;access modifiers on extensions is out of scope. (I also agree that it is a bad idea. Sorry, James, but wanting 'pubic' here indicates that your mental model of extensions does not match what Swift is actually doing, and that could get you into trouble.)</div><div><br></div><div>Jordan</div><br></div></blockquote></span><span class=""><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></span><br></div></blockquote></span></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></body></html>