Why is D unpopular
Mike Parker
aldacron at gmail.com
Mon Jun 13 09:34:46 UTC 2022
On Monday, 13 June 2022 at 09:11:42 UTC, Ola Fosheim Grøstad
wrote:
> It follows from the principles of inheritance. A Bar is a more
> detailed Foo. If you cannot interact with a Bar as you would
> with a Foo, then Bar is breaking with the core principles of
> inheritance
No, it does not follow in this case. A subclass does not have
access to the private members of the superclass in D unless they
are declared in the same module. So what that code is doing is
saying, "Hey Bar, give me this field that you don't have access
to."
More information about the Digitalmars-d
mailing list