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

Nick Treleaven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Nick Treleaven <[email protected]> ---
Note that an enum E is allowed to take values larger than E.max using binary
operations:

    enum E { a, b}
    pragma(msg, E.max); // E.b which is 1
    E value = E.b << E.b; // 2

So that violates `final switch` anyway, even in @safe code, and casting can
(see https://issues.dlang.org/show_bug.cgi?id=11051#c7). Though void
initialization is worse because the bug might not even be reproducible. Sadly
void initialization is not banned in @safe.

--

Reply via email to