The following code does not compile:

void foo(string a) {}

class Base
{
    alias bar this;

    string bar()
    {
        return "";
    }
}

class Sub : Base {}

void main()
{
    auto sub = new Sub;
    foo(sub);
}

But if the "alias this" is copied/moved to the subclass it works. Is this expected behavior?

--
/Jacob Carlborg

Reply via email to