[Issue 3878] Arguments and attributes with the same name

2010-09-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3878



--- Comment #4 from bearophile_h...@eml.cc 2010-09-30 18:15:47 PDT ---
See also Using Redundancies to Find Errors, by Yichen Xie and Dawson Engler,
2002:
www.stanford.edu/~engler/p401-xie.pdf

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3878] Arguments and attributes with the same name

2010-03-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3878


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au


--- Comment #2 from Don clugd...@yahoo.com.au 2010-03-08 13:09:53 PST ---
As I understand option(2) of this proposal, if a function parameter 'shadows' a
member variable of the same name, it should be illegal to use that parameter as
an lvalue.

I think you're probably correct in claiming that any such code is highly likely
to be a bug. If x is both a parameter and a member, then
x = 3;   should almost certainly be 
this.x = 3;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3878] Arguments and attributes with the same name

2010-03-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3878



--- Comment #1 from bearophile_h...@eml.cc 2010-03-04 14:07:38 PST ---
A comment by Clemens
(http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=106995
) about the second idea:

As soon as you have an instance variable x and a function parameter x, there 
will *always* be ambiguity (unless you don't use the parameter). Requiring the 
use of this. amounts to disallowing access to the parameter x. Or do you 
suggest making the distinction based on whether x is used as an lvalue or a 
rvalue?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---