[Issue 2450] New: Error using operators from named template mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 12 20:31:03 PST 2008


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

           Summary: Error using operators from named template mixin
           Product: D
           Version: 1.033
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jminer2613 at students.pcci.edu


template Event() {
        void opCall() { }
        void opAddAssign(int i) { }
}
class Button {
        mixin Event clicked;
        void func() {
                clicked.opCall(); // works
                this.clicked();   // works

                // Error: function expected before (), not mixin Event!()
clicked; of type void
                clicked();
                // Error: mixin 'Event!()' is not a variable
                clicked += 7;
        }
}

Tested with DMD v1.033.
A workaround is shown of using "this." before the name of the mixin, but that
could get annoying.


-- 



More information about the Digitalmars-d-bugs mailing list