xxxxxxxxxx
import std.stdio;
interface I
{
void foo();
}
class C : I {
void foo() {writeln("C");}
void bar() {writeln("C bar");}
}
C[] getInstance()
{
return [new C, new C];
}
void main()
{
C[] carray = getInstance();
//I[] iarray = carray; // compile error
I[] iarray = cast(I[])carray; // runtime error (1)
iarray[0].foo();
}