outside an unittest, this compiles fine:

        struct A
        {
                enum A foo = "hehe";
                this(string a) { m_a = a; }
                alias m_a this;
                string m_a;
        }

but if you wrap this a unittest {} and compile with
dmd -unittest -run foo.d

this give the following error:

cannot implicitly convert expression "hehe" of type string to A

Why does inside a unittest it doesn't work? the constructor this(string) {} seems to get disabled.

Reply via email to