Why is D unpopular

Max Samukha maxsamukha at gmail.com
Mon Jun 13 12:03:10 UTC 2022


On Monday, 13 June 2022 at 10:55:36 UTC, Ola Fosheim Grøstad 
wrote:
> On Monday, 13 June 2022 at 10:51:10 UTC, Mike Parker wrote:
>> And I'm arguing that this is exactly what we should expect 
>> from private-to-the-module, since B is not declared in the 
>> same module as the superclass, so it's neither unfinished nor 
>> a bug.
>
> It breaks the sub-typing requirement.
>
> If you get more access by recasting a pointer to the super-type 
> then the sub-typing relation cannot be satisfied.

And the reason is the private member of the class shouldn't be 
accessible outside its declaration scope in the first place. 
Module-level 'private' is dysfunctional by design.

>
> Hence, it is certainly broken. If it is not a bug, then it is 
> broken by design. Which is no better.




More information about the Digitalmars-d mailing list