<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 Dec 14, 2015, at 11:58 AM, Marc Knaup &lt;<a href="mailto:marc@knaup.koeln" class="">marc@knaup.koeln</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">To sum up (what I understand) the new access modifier<div class=""><ul class=""><li class="">can be used only on type members (properties, methods, initializers, subscripts and nested types) - so not at file-level<br class=""></li><li class="">grants access to that symbol to</li><ul class=""><li class="">the containing type</li><li class="">(nested types)?</li><li class="">extension in the same file</li></ul><li class="">and does not grant access to</li><ul class=""><li class="">extensions declared in a different file</li><li class="">subclasses</li><li class="">other locations in the same file as the ones granted above</li></ul></ul><div class="">Did I forget anything?</div></div></div></div></blockquote><br class=""></div><div>This is *not* correct. &nbsp;It only grants access to other members declared within the same body. &nbsp;Some examples may help clarify the concept:</div><div><br class=""></div><div>struct S {</div><div>&nbsp; &nbsp; // visible within the struct declaration only and *nowhere* else</div><div>&nbsp; &nbsp; scoped let foo: String</div><div><br class=""></div><div>&nbsp; &nbsp; struct T {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // still within the scope of S so foo is still visible here</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // buzz is only visible within the inner type, buzz is not visible to members of S</div><div>&nbsp; &nbsp; &nbsp; &nbsp; scoped let buzz: String</div><div>&nbsp; &nbsp; }</div><div>}</div><div><br class=""></div><div>// in same file</div><div>extension S {</div><div>&nbsp; &nbsp; // foo is not visible here</div><div>&nbsp; &nbsp; // bar is visible only within the extension in which it is declared and *nowhere* else</div><div>&nbsp; &nbsp; scoped fun bar() -&gt; String</div><div>}</div><div><br class=""></div><div><br class=""></div></body></html>