[Issue 9515] UFCS fails with local aliases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 24 06:30:19 PDT 2014


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



--- Comment #6 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-03-24 06:30:13 PDT ---
(In reply to comment #4)
> > UFCS is not designed to work for local symbols.
> 
> It may very well be an enhancement rather than a bug to get it working with
> local symbols, but given that we're trying to make it so that there's no real
> difference between local imports and module-level imports (aside from the scope
> of the import), I'd say that we should definitely get UFCS working with local
> imports. 

To be precise: local imports work, it's local symbols that don't work.

This works ok:

-----
void main()
{
    import std.array;
    assert([].empty);
}
-----

But this doesn't:

-----
void main()
{
    bool empty(T)(T[]) { return true; }
    assert([].empty);
}
-----

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