On 11/24/2013 11:17 AM, bearophile wrote:
Walter Bright:

Shadowing globals is definitely a bad idea. Shadowing members, it's debatable.

So are you saying D here should give an error for the shadowing of the
module-level x?


struct Foo { int x; }
int x;
void main() {
     Foo f;
     with (f) {
         x++;
     }
}

I meant "bad" as in bad, not as in "good" :-)


 From my experience that's quite bug-prone:
http://d.puremagic.com/issues/show_bug.cgi?id=3878

I posted an objection there :-)

Reply via email to