This code compile, but array appending doesn't work

----
alias Rebindable!(immutable(InfoImpl)) Info;

class InfoImpl
{
    void foo() {}
    static immutable(InfoImpl) info()
    {
        __gshared immutable InfoImpl x = new immutable InfoImpl;
        return x;
    }
}


void main()
{
    Info t = Info.info;
    Info[] a;
    //a ~= Info.info; <--  KO Compiler Error
    a ~= rebindable(Info.info); // Ok
}
-----

Why can't info() return a Rebindable!(immutable(InfoImpl)) ?

Reply via email to