www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 47] New: Entity name shadowing: compiler not acting according to spec.

http://d.puremagic.com/bugzilla/show_bug.cgi?id=47

           Summary: Entity name shadowing: compiler not acting according to
                    spec.
           Product: D
           Version: 0.149
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: daiphoenix lycos.com


The D Doc, in http://www.digitalmars.com/d/statement.html , says the following
piece of code is invalid:

void func2() {
    int x;
    {
        int x;  // illegal, x is multiply defined in function scope
    }
}

However the code compiles fine. Is this a compiler error or Doc error? In other
words is entity name shadowing valid or not? (IMO it should be valid)


-- 
Mar 14 2006