https://issues.dlang.org/show_bug.cgi?id=24735

--- Comment #2 from Haruki Shigemori <[email protected]> ---
enum
{
        ENUM1 = 1
}

enum ENUM2 = 2;

synchronized class A
{
        void f()
        {
                auto a = ENUM1; // NG, but ENUM1 is constant.
                auto b = ENUM2; // OK
        }
}

void main()
{
        auto a = new shared(A);
        a.f();
}

source\text.d(12,12): Error: direct access to shared `ENUM1` is not allowed,
see `core.atomic`

Why is ENUM1 shared and ENUM2 not shared?

--

Reply via email to