Why do private member variables behaved like protected in the same module when creating deriving class?
12345swordy
alexanderheistermann at gmail.com
Fri Oct 26 21:30:25 UTC 2018
On Friday, 26 October 2018 at 21:05:56 UTC, Steven Schveighoffer
wrote:
> On 10/26/18 3:28 PM, 12345swordy wrote:
>> On Friday, 26 October 2018 at 18:57:00 UTC, Neia Neutuladh
>> wrote:
>>> On Fri, 26 Oct 2018 18:16:38 +0000, 12345swordy wrote:
>>>> [...]
>>>
>>> D's `private` within a module is identical to Java's
>>> `private` within a class and its nested classes. The
>>> following is valid Java:
>>>
>>> [...]
>>
>> Again I am referring to classes in the module not the module
>> itself.
>
> Classes in the module are in the module. So any classes in the
> module *are* the module itself.
>
> What it seems like you are saying is that you want
> non-derivatives to still be able to access private variables,
> but derivative classes are forbidden? Nothing personal, but
> this really doesn't make a lot of sense. I feel like maybe
> there is a misunderstanding.
There is a misunderstanding! I am asking why the child class have
the parent class private member variables in the first place!!!
Do I need to write a DIP for you guys to understand what the hell
I am talking about!?
More information about the Digitalmars-d
mailing list