Updated DIP22 - Private symbol visibility

Timon Gehr timon.gehr at gmx.ch
Sat Dec 21 09:41:31 PST 2013


On 12/20/2013 09:48 PM, Martin Nowak wrote:
> I updated DIP22 - Private symbol visibility with my findings from
> implementing the 'Hide module members' pull request.
>
> https://github.com/D-Programming-Language/dmd/pull/739
>
> I don't have much time to cope with the topic but any feedback is welcome.

Looks mostly good to me, but the following snippets that both seem 
reasonable unfortunately contradict each other.

"private is an encapsulation tool. If it is not intended to be used by 
"outsiders", it should not interfere with them at all."

"* The least protected symbol determines the visibility for an overload 
set.
     After overload resolution an access check will be performed.
     Thereby overload resolution is independent of look-up origin."

Adding a private symbol to an overload set can break 3rd party code with 
these rules. Since private symbols are usually excluded from di files I 
don't think this design is viable. I think it would be better to 
disallow overload sets with mixed protection.


More information about the Digitalmars-d mailing list