Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 18, 2010 [Issue 4889] New: Declarator in "if" statement allows name shadowing | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=4889 Summary: Declarator in "if" statement allows name shadowing Product: D Version: D2 Platform: All OS/Version: Linux Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: tomash.brechko@gmail.com --- Comment #0 from Tomash Brechko <tomash.brechko@gmail.com> 2010-09-18 13:24:55 PDT --- The following compiles without error with dmd 2.049: void main() { int i = 1; if (int i = 2) { assert(i == 2); } assert(i == 1); } It seems prohibiting such shadowing would be in line with block shadowing rules. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 19, 2010 [Issue 4889] Declarator in "if" statement allows name shadowing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomash Brechko | http://d.puremagic.com/issues/show_bug.cgi?id=4889 Stewart Gordon <smjg@iname.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |spec CC| |smjg@iname.com OS/Version|Linux |All --- Comment #1 from Stewart Gordon <smjg@iname.com> 2010-09-18 17:26:28 PDT --- I'm not sure if the classification of this as enhancement is correct. The mention of the restriction is under ScopeStatement "Even though a new scope is introduced, local symbol declarations cannot shadow (hide) other local symbol declarations in the same function." but was the intent of this statement that it would apply just as well to a variable declared in an if statement? After all, it seems to me that reality its scope is that of the ScopeStatement, even though it isn't lexically within it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 15, 2011 [Issue 4889] Declarator in "if" statement allows name shadowing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomash Brechko | http://d.puremagic.com/issues/show_bug.cgi?id=4889 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies@gmail.com Version|D2 |D1 Severity|enhancement |normal --- Comment #2 from yebblies <yebblies@gmail.com> 2011-06-15 08:45:40 PDT --- Errors in D2 (2.053) but still allowed in D1 (1.068) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 24, 2012 [Issue 4889] Declarator in "if" statement allows name shadowing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomash Brechko | http://d.puremagic.com/issues/show_bug.cgi?id=4889 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|spec | CC| |bugzilla@digitalmars.com --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2012-01-23 23:28:02 PST --- D1 only bug, not a spec issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation