[Issue 2779] alias this + tuple expansion on function call doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 22 07:34:37 PDT 2011


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


Andrei Alexandrescu <andrei at metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at metalanguage.com


--- Comment #2 from Andrei Alexandrescu <andrei at metalanguage.com> 2011-07-22 07:34:34 PDT ---
I think it's best to leave things as they are and close this. Automatic
expansion is a bad thing. Consider for example:

struct Tuple(T...) {
    T data;
    alias data this;
}

void doStuff(Tuple!(uint, float) t) {}
void doStuff(uint a, float b) {}

In this case we need to introduce a new rule that says the tuple should NOT be
expanded if there's a matching function, or a new rule that makes the call
ambiguous.

Things are good as they are. If you want to expand, say t.expand. If you want
to pass the tuple as a unit, say t.

Kenji, please advise if you agree, and if so let's close this.

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