If I use interfaces instead of classes is there a way to have new return the underlying interface that I want it to?

interface A { }
class B : A {}

auto a = new B; // should return cast(A)(new B);

Maybe it's not such a big deal though? (I can't think of any case where a being of type B will hurt since it is always implicitly castable to type A.

Reply via email to