interface I { void foo();} class A : I { void foo() { printf("A\n"); } } class B : I { void foo() { printf("B\n"); } } class C(T) : T { void foo() { printf("C "); super.foo(); } } class D(T) : T { void foo() { printf("D "); super.foo(); } } alias C!(A) CA; alias C!(B) CB; alias C!(D!(A)) CDA; alias D!(C!(B)) DCB; alias C!(D!(C!(D!(B)))) CDCDB; void main() { I ca = new CA(); I cb = new CB(); ca.foo(); cb.foo(); I cda = new CDA(); I dcb = new DCB(); cda.foo(); dcb.foo(); I cdcdb = new CDCDB(); cdcdb.foo(); }