www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16254] New: [REG 2.072-devel] wrong switch skips

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 puremagic.com
          Reporter: code 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.

--
Jul 08 2016