[Issue 11947] std.typecons.Proxy incorrectly handles variadic member templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 20 08:18:35 PST 2014


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



--- Comment #1 from Stanislav Blinov <stanislav.blinov at gmail.com> 2014-01-20 08:18:31 PST ---
Proxy's opCall() seems to exhibit similar issue, when using getter property as
proxy:

struct RealThing {
    void opCall(T...)(T args) {}
}

struct Impostor {
    private RealThing p;
    private @property RealThing* get() { return &p; }
    mixin Proxy!get;

    void opCall(T...)(T args) {}
}

void main() {
    Impostor imp;
    imp();        // ok
    imp("hello"); // error instantiating
}


Proposed solution (explicitly call opCall):

// Original (std.typecons at 3817):
    auto ref opCall(this X, Args...)(auto ref Args args) { return a(args); }

// Change to (std.typecons at 3817):
    auto ref opCall(this X, Args...)(auto ref Args args) { return
a.opCall(args); }

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