[Issue 4889] Declarator in "if" statement allows name shadowing

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 18 17:27:02 PDT 2010


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


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |spec
                 CC|                            |smjg at iname.com
         OS/Version|Linux                       |All


--- Comment #1 from Stewart Gordon <smjg at 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: -------


More information about the Digitalmars-d-bugs mailing list