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

Robert Widmann devteam.codafi at gmail.com
Thu Jun 16 03:06:30 CDT 2016



~Robert Widmann

2016/06/16 0:44、Charles Srstka <cocoadev at charlessoft.com> のメッセージ:

>> On Jun 15, 2016, at 11:16 PM, Robert Widmann <devteam.codafi at gmail.com> wrote:
>> 
>> Charles we've diverged from the actual issue at hand to nitpick my English.  Read the code (that std::min tho!).  We have a problem here and no obvious solution that doesn't involve special-casing parts of this proposal.  Do you have a solution or shall we take this offline?  I can provide you my iMessage information in a person email if you wish to discuss this with me or any other members of the team, but the list is not the most productive place for this.
>> 
>> Thanks,
>> 
>> ~Robert Widmann
> 
> I am not sure why you think I am nitpicking your English (unless if you are possibly referring to the post where I corrected my own typo, but that was my English, not yours). What I am trying to express is that I do not believe there is an issue with the syntax as proposed. If there is no access modifier on a declaration, there is no reason that that declaration should be less visible than its container, except in the case that the container’s visibility is greater than the default level of internal―i.e. it is public.
> 

We agree on the latter half, but the former is suspect.  You may have gleaned that from the spirit of this proposal, but its letter says nothing of the sort.  Access and visibility are one and the same in the compiler.  We use access to determine (for lack of a better word) the "lookup-ability" of a symbol (hence its visibility) during Sema.  To divorce or tie the two any further is not specified and should have been originally.  If you honestly believe that we should break containment because that is the right thing to do then I need the proposal to match that belief.  Otherwise, the implementation I have is subject to the issue in root.

If you read the very example given in that proposal, you will see that the author intended private members to be scoped by their containing declaration.  There is precisely zero mention of top-level semantics.  If that was an honest mistake or an ambiguity that didn't get removed, then we need to address it here and now before we merge a proper implementation.

> Furthermore, I do not see the need for an access modifier that says to give something the same visibility as its parent, since for all access levels other than public (and of course, for public APIs, you want to declare those explicitly anyway), you get that already by default, so an access modifier seems somewhat redundant.

Precisely.

> 
> Charles
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160616/255da9c7/attachment.html>


More information about the swift-evolution mailing list