[Issue 9515] UFCS fails with local aliases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 23 18:45:19 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=9515



--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> 2014-03-23 18:45:17 PDT ---
(In reply to comment #4)
> > UFCS is not designed to work for local symbols.
> 
[snip]
> Certainly, I don't know why we wouldn't implement this.

My concern case is:

import std.array;
struct MyRange(E) {
    E[] data;

    E front() {
        return data.front;
        // If UFCS could see local symbols, the inner-most 'front' will be
chosen
        // and this line will be rewritten to this.front(data).
    }
}

Note that, in symbol lookup phase function static-ness is not considered.
Because functions could be overloaded, and it should be resolved in later
phase.

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


More information about the Digitalmars-d-bugs mailing list