Ok, bad example :)
Here's a better example of what I wanted to ask:
class XA { uint x; }
class XB : XA { uint y; }
class A
{
XA j;
this(XA j) { this.j = j; }
}
class B : A
{
XB j;
this(XB j) { super(j); }
}
void main()
{
XB j = new XB();
j.x = 10;
j.y = 20;
B b = new B(j);
writefln("%d\n", b.j.x);
}
Why doesn't this work?