typeof(t) not working correctly?

%u wfunction at hotmail.com
Sun Dec 26 21:48:42 PST 2010


Hi,

I'm running this code below, and it returns an array of length zero for both
print statements. Is this a bug, or am I missing something?

Thank you!



private import std.stdio;
private import std.traits;

class Temp
{
	public int base1;
	public void foo() { writeln("foo base called"); }
}

class Temp2 : Temp
{
	public int derived1;
	public override void foo() { writeln("foo derived called"); }
}

void main()
{
	Temp t = new Temp2();
	writeln(typeid(t).offTi().length); //Prints 0
	writeln(typeid(t).getMembers(null).length); //Prints 0
}


More information about the Digitalmars-d mailing list