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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 1 05:29:00 PST 2010


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

           Summary: The lookup order of recursive with statements is
                    undefined.
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: websites
        AssignedTo: nobody at puremagic.com
        ReportedBy: blood.of.life at gmail.com


--- Comment #0 from Bernard Helyer <blood.of.life at gmail.com> 2010-12-01 05:27:29 PST ---
In implementing SDC I find myself asking these questions, and I wish to try and
put and end to DMD being the sole definer of semantics; just letting you know
the reason for this and subsequent bug reports.

Given a series of with statements:

    with (a) with (b) with (c) {
        d();
    }

If all three objects have a method d(), then c gets called. Obviously the with
statements are considered in a LIFO order, and the sentence

http://www.digitalmars.com/d/2.0/statement.html#WithStatement
"Use of with object symbols that shadow local symbols with the same identifier
are not allowed. "

does not apply here. Neither is documented behaviour, and the only to figure
out how D behaves is to run DMD.

-- 
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