[Issue 1399] New: Wrapping a case statement in a version statement gives a shadowing declaration error.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 4 10:17:10 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1399

           Summary: Wrapping a case statement in a version statement gives a
                    shadowing declaration error.
           Product: D
           Version: 1.019
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: aziz.kerim at gmail.com


When compiling the snippet below with -version=D2 I get the following error:
"Error: shadowing declaration func.a is deprecated"

void func()
{
  switch(1)
  {
  case 1:
    auto a = 2;
    break;
  version(D2)
  {
  case 2:
    auto a = 2; // error
    break;
  }
  default:
  }
}


-- 



More information about the Digitalmars-d-bugs mailing list