visibility deprecation with last dmd compiler

jacob via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 3 07:14:16 PDT 2017


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"

As I understand, the reason is 
https://dlang.org/changelog/2.071.0.html#dip22

But how can I use private fields from descedant class?



More information about the Digitalmars-d-learn mailing list