[swift-evolution] [Discussion] A Problem With SE-0025?

Matthew Johnson matthew at anandabits.com
Wed Jun 15 14:46:51 CDT 2016


> On Jun 15, 2016, at 2:43 PM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Shouldn’t a file act like an individual scope? If so why would A be visible in C? Is it because files act not a lexical scopes?
> 
> 

Did you mean that `C` is in a different file?  That wasn’t clear to me.  Maybe that is what “1” and “2” indicated (different files)?  If that is what you meant then `A` would not be visible in `C`, nor would the `a` member of `B`.
> 
> 
> 
> -- 
> Adrian Zubarev
> Sent with Airmail
> 
> Am 15. Juni 2016 um 21:34:23, Adrian Zubarev (adrian.zubarev at devandartist.com <mailto:adrian.zubarev at devandartist.com>) schrieb:
> 
>> Your example #2 is just incorrect.  `A` is visible inside the scope of `C`.
>> 
>> Now that we have introduced a scope-dependent access modifier it is an incorrect mental model to consider members with no access modifier as having the exact same access modifier as the containing scope.  This is no longer correct.  They have the same *visibility*, not the same *access modifier*.
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160615/29993ef4/attachment.html>


More information about the swift-evolution mailing list