D's greatest mistakes

bearophile bearophileHUGS at lycos.com
Mon Nov 29 14:08:30 PST 2010


Andrei:

> Great. Could you please submit this as a bug report?

This shadowing is not detected :-(

struct X { int a; }
struct Y { int a; }
void main() {
    X x;
    Y y;
    with (x) {
        a = 2;
        with (y) {
            a = 1;
        }
    }
    assert(x.a == 2);
}

Bye,
bearophile


More information about the Digitalmars-d mailing list