import tango.io.Console;
import tango.text.convert.Integer;

interface ITest
{
	void doSomething();
}

class Test : ITest
{
	void doSomething()
	{
		Cout("Hi there!\n");
		//Cout("I am " ~ this.classinfo.name).newline;
		//Cout("I am " ~ this.classinfo.name ~ " (" ~ (cast(Object)this).classinfo.name ~ ")").newline;
	}
}

void main()
{
	Test obj = new Test();
	obj.doSomething();                         // works
	
	Test[] objarr = [obj];
	objarr[0].doSomething();                   // works
	
	ITest intf = obj;
	intf.doSomething();                        // works

	ITest[] intfarr = [intf];
	intfarr[0].doSomething();                  // works
	Cout(intfarr[0].classinfo.name).newline;   // works

	Cout("---").newline;
	ITest[] intfarr2 = cast(ITest[])objarr;
	intfarr2[0].doSomething();                 // does nothing?
	Cout(intfarr2[0].classinfo.name).newline;  // access violation

	Cout("Done!").newline;
}
