On Wed, 12 Mar 2014 06:57:08 -0400, Steve Teale <[email protected]> wrote:

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

Reply via email to