[Issue 3474] PATCH: Implement opDollar for struct and class indexing operations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 22 00:06:49 PST 2011


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



--- Comment #11 from bearophile_hugs at eml.cc 2011-11-22 00:05:51 PST ---
With the recent patch this doesn't compile, is this expected?


struct Foo {
    int x;
    alias x opDollar;
    int opIndex(int k) { return x * k; }
}
void main() {
    Foo f = Foo(7);
    int x = f[$ - 5]; // Error: undefined identifier __dollar
    assert(x == 2 * 7);
}

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