D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 47 - Entity name shadowing: compiler not acting according to spec.
Summary: Entity name shadowing: compiler not acting according to spec.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P3 minor
Assignee: Walter Bright
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2006-03-14 10:53 UTC by Bruno Medeiros
Modified: 2014-02-15 02:08 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bruno Medeiros 2006-03-14 10:53:10 UTC
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)
Comment 1 Walter Bright 2006-06-20 02:01:41 UTC
Fixed 0.161
Comment 2 Stewart Gordon 2010-08-19 06:28:38 UTC
*** Issue 2195 has been marked as a duplicate of this issue. ***