[Issue 9807] New: with statement does not work with alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 24 06:26:28 PDT 2013


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

           Summary: with statement does not work with alias this
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: robert at octarineparrot.com


--- Comment #0 from Robert Clipsham <robert at octarineparrot.com> 2013-03-24 13:26:27 GMT ---
The with statement does not appear to take alias this into account:
----
void test(T)(T t)
{
}

struct Foo {
    string[string] strs;
    alias strs this;
}

void main()
{
    Foo f;
    test(f.keys[0]); // Fine
    with(f) {
        test(keys[0]); // Not fine
    }
}
----
test.d(15): Error: undefined identifier keys

Using dmd 2.062.

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