Why do private member variables behaved like protected in the same module when creating deriving class?

Steven Schveighoffer schveiguy at gmail.com
Sat Oct 27 14:15:42 UTC 2018


On 10/27/18 7:40 AM, Timon Gehr wrote:
> On 27.10.18 05:20, Mike Parker wrote:
>> If used to be that even if you moved the declaration of B to another 
>> module, then main would still have access to y through b. That was 
>> deemed to be a bug an is now deprecated.
> 
> That seems to make no sense at all (clearly main can access y though b 
> by just implicitly casting to a superclass reference). Why was this done?

Read the bug report:

https://issues.dlang.org/show_bug.cgi?id=15897

-Steve


More information about the Digitalmars-d mailing list