[Issue 16578] New: bogus deprecation - switch skips declaration of variable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Oct 2 15:39:54 PDT 2016


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

          Issue ID: 16578
           Summary: bogus deprecation - switch skips declaration of
                    variable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mk at krej.cz

string[string] opts;

void main()
{
    string arg;
    switch (arg)
    {
        case "-f": opts["fore"] = ""; break;
        debug { case "-throw": opts["throw"] = ""; break; }
        default:
    }
}


bug.d(6): Deprecation: 'switch' skips declaration of variable
bug.main.__aaval51 at bug.d(8)

dmd 2.072 b1
compile with -debug

Related pull:
Pull https://github.com/dlang/dmd/pull/5869

--


More information about the Digitalmars-d-bugs mailing list