[Issue 5297] The lookup order of recursive with statements is undefined.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 1 12:41:07 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5297


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #2 from bearophile_hugs at eml.cc 2010-12-01 12:39:36 PST ---
(In reply to comment #1)
> Symbols used in with should shadow symbols from other
> with statements.

Do you mean "shouldn't"?

This shadowing is not detected, and I think the compiler has to flag this is as
a compile error (just like it does with normal variables in the function stack
frame):

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);
}

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


More information about the Digitalmars-d-bugs mailing list