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

--- Comment #4 from hst...@quickfur.ath.cx ---
More interesting clues: running a union method inside CTFE containing a local
variable without an explicit initializer causes a CTFE error "cannot modify
variable at compile time", whereas explicitly initializing the local variable
works.

------
union U {
    int method() {
        int x; // causes CTFE failure unless explicitly initialized
        return x;
    }
}
enum y = U.init.method();
------

--

Reply via email to