Arguments and attributes with the same name
bearophile
bearophileHUGS at lycos.com
Thu Mar 4 06:32:53 PST 2010
Ary Borenszweig:
> This can be solved if the compiler warns when an assignment is from a
> variable to the same one.
>
> x = x; // error: assignment has no effect
That's nice in general to have, but I think it's not enough, because if I want to assign to an attribute an incremented value:
x = x+1;
What is that x? The attribute or the argument?
Bye,
bearophile
More information about the Digitalmars-d
mailing list