[Issue 16254] New: [REG 2.072-devel] wrong switch skips initialization error with mixed in case labels

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 8 13:29:30 PDT 2016


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

          Issue ID: 16254
           Summary: [REG 2.072-devel] wrong switch skips initialization
                    error with mixed in case labels
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

cat > bug.d << CODE
bool bug(int val)
{
    switch (val)
    {
    mixin("case 0:");
        auto v = 0;
        return true;

    default:
        return false;
    }
}
CODE

dmd -c bug
----
bug.d(3): Error: 'switch' skips declaration of variable bug.bug.v at bug.d(6)
----

I'd guess something in the semantic order changed since 2.071.1.

--


More information about the Digitalmars-d-bugs mailing list