alias this

Mf_Gh Mf_Gh at trash-mail.com
Fri Nov 22 02:21:35 PST 2013


hi, i started to play a round with D and try to do something like:

class A{
	string a = "alias A";
	alias a this;
}

class B:A{
	string b = "alias B";
	alias b this;
}


void main() {
	A b = new B();
	writeln(b); //outputs alias A
}

i thought the output would be "alias B". why isn't the alias 
taken from the runtimetype?


More information about the Digitalmars-d-learn mailing list