<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Feb 2017, at 15:25, Ross O'Brien <<a href="mailto:narrativium+swift@gmail.com" class="">narrativium+swift@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" class=""><div class="gmail_extra">Does 'private(module, type)' grant get-set access to external subclasses, or get-only?</div></div></div></blockquote><div><br class=""></div><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 class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><font face="Monaco" class="">private(module, set:type) func someMethod() { … }</font></div></div></blockquote><div><div><br class=""></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><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><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 class=""></div><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 class=""></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 class=""></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>public(type) func someMethod() { … }</font></div><div><br class=""></div><div>Whereas for internal access you'd do:</div><div><br class=""></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>public(file, type) func someMethod() { … }</font></div><div><font face="Monaco" class=""><br class=""></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></body></html>