xxxxxxxxxx
import std.stdio;
class A {
bool boolean = false;
abstract void foo();
}
class B : A {
bool boolean = false;//delete this line, and everything works as expected
override void foo() {
boolean = true;
}
}
void main() {
A castedB = cast(A) new B();
writeln(castedB.boolean);
castedB.foo();//should call A.foo(), changing boolean to true...
writeln(castedB.boolean);//...but here, boolean is still false
}