Redundancies often reveal bugs
Simen kjaeraas
simen.kjaras at gmail.com
Fri Oct 1 18:02:49 PDT 2010
bearophile <bearophileHUGS at lycos.com> wrote:
> but it can't avoid bugs like the following inc(), so I think it's not
> enough to solve the problems I was talking about:
>
>
> // Code #5
> class Foo {
> int x;
> void inc(int x) { x += x; }
> }
> void main() {}
Oh, but it can (sort of). By allowing this syntax, there is *very* little
reason to allow for shadowing of members by parameters or local variables,
and those may thus more readily be disallowed.
--
Simen
More information about the Digitalmars-d
mailing list