On Wednesday, 3 May 2017 at 14:14:16 UTC, jacob wrote:
But how can I use private fields from descedant class?
You don't, the whole point of private is that they aren't used
from outside the module.
Try `protected` instead, it is similar to private, but still
allows use from a subclass.
I have 2 files
file abc.d:
==
module my.abc;
class Abc
{
private int x;
this() { this.x = 1; }
}
==
and xyz.d:
==
module my.xyz;
import my.abc;
class Xyz: Abc
{
this() { super(); this.x = 2; }
}
==
Compilation fails with "Deprecation: my.abc.Abc.x is not visible
from module xyz"