<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 <<a href="mailto:marc@knaup.koeln" class="">marc@knaup.koeln</a>> 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. It only grants access to other members declared within the same body. Some examples may help clarify the concept:</div><div><br class=""></div><div>struct S {</div><div> // visible within the struct declaration only and *nowhere* else</div><div> scoped let foo: String</div><div><br class=""></div><div> struct T {</div><div> // still within the scope of S so foo is still visible here</div><div> // buzz is only visible within the inner type, buzz is not visible to members of S</div><div> scoped let buzz: String</div><div> }</div><div>}</div><div><br class=""></div><div>// in same file</div><div>extension S {</div><div> // foo is not visible here</div><div> // bar is visible only within the extension in which it is declared and *nowhere* else</div><div> scoped fun bar() -> String</div><div>}</div><div><br class=""></div><div><br class=""></div></body></html>