<div dir="ltr">I'm terribly sorry to be _that guy_, but I have to interject that `private(file)` was discussed extensively during review for SE-0025, that the full scheme laid out in the first message of this thread was given consideration, and that the core team took these suggestions into account before accepting and implementing `fileprivate`.<div><br></div><div>Now, it has been said that real-world experience opens the door to reconsidering the substantive content of SE-0025 (as in, whether "new" private should exist at all). It has also long been said that a superior name would be considered instead of `fileprivate` if someone came up with one. But clearly, if hundreds of messages advocating for `private(file)` did not cause the core team to consider it to be a superior name, it is exceedingly poor form to keep bringing it up again. It's already exhausting to bikeshed upcoming features, but this shed has already shipped.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 11:14 AM, Haravikk via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></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"><br><div><span class=""><blockquote type="cite"><div>On 20 Feb 2017, at 15:25, Ross O'Brien <<a href="mailto:narrativium+swift@gmail.com" target="_blank">narrativium+swift@gmail.com</a>> wrote:</div><div><div dir="ltr"><div class="gmail_extra">Does 'private(module, type)' grant get-set access to external subclasses, or get-only?</div></div></div></blockquote><div><br></div></span><div>Without a specific set condition it'd be both get and set for both. So you might need to do for example:</div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="Monaco">private(module, set:type) func someMethod() { … }</font></div></div></blockquote><div><div><br></div><div>Though this may be assuming that set always implies get; I'm not sure if there's a need for set-only access restrictions, as any example I can think of that might need it can be handled by a method specifically for that purpose.</div><span class=""><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra">If I write 'private(file, type)' is the property accessible only to types within the module, or outside as well?</div></div></blockquote><div><br></div></span><div>The property would be accessible anywhere in the same file, as well as accessible to any sub-class both in the module and externally.</div><div><br></div><div>Are you asking whether it'd be possible to restrict the external access of type? This might be an argument for allowing the type parameter on both private and public perhaps? So if you want external access to sub-classes you'd do:</div><div><br></div><div><font face="Monaco"><span class="m_789615626212391253Apple-tab-span" style="white-space:pre-wrap">        </span>public(type) func someMethod() { … }</font></div><div><br></div><div>Whereas for internal access you'd do:</div><div><br></div><div><font face="Monaco"><span class="m_789615626212391253Apple-tab-span" style="white-space:pre-wrap">        </span>public(file, type) func someMethod() { … }</font></div><div><font face="Monaco"><br></font></div><div>Or are there still cases that aren't covered? It's possible it's a bad example of something that can be added to the parameterised form in future, and maybe it is something that does still require its own keyword?</div></div></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>