interface I { auto myType(); }class A: I { auto myType() { return cast(A) null; } } void main() { I x = getSomeI(); typeof(x.myType()) y; }
What you want simply isn't possible. An interface binds at runtime, and you need to declare types at compile-time. You can't use an interface method to define the type of y.
-Steve
