[Issue 277] New: Named mixin operator resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 3 09:22:29 PDT 2006


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

           Summary: Named mixin operator resolution
           Product: D
           Version: 0.163
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: xergen at hotmail.com


template TestMixin(){
    void opCall()    {
    }

    void opCatAssign(uint val)    {
    }
}

class Test{
    mixin TestMixin bar;

    void foo(){
    //bar(); // doesn't work !?!?
    bar.opCall(); // works
    //bar ~= 3; // doesn't work
    bar.opCatAssign(3); // works
    }
}

void main(char[][] args){
    Test t = new Test();
    t.bar ~= 3; // works
    t.bar(); // works
    t.bar.opCall(); // works

    t.foo();
}

May seem trivial, but its actually pretty important for some friendly things im
working on.  Mixin operators can't be called from within the scope using the
mixin? Odd :) Thanks.
PS. You're my hero Walter.


-- 




More information about the Digitalmars-d-bugs mailing list