www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2646] New: Named mixins and member functions

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2646

           Summary: Named mixins and member functions
           Product: D
           Version: 1.039
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samukha voliacable.com


Functions inserted into a class using named mixins should be considered
separate functions.

template Signal
{
  void connect();
}

class AbstractButton
{
  mixin Signal clicked;
}

class CheckBox : AbstractButton
{
  mixin Signal toggled;
  mixin Signal kicked; 
}

CheckBox.toggled.connect shouldn't override AbstractButton.clicked.connect.
CheckBox.kicked has nothing to do with AbstractButton.clicked, but currently it
causes compilation to fail: "CheckBox.Signal!().connect multiple overrides of
same function".


-- 
Feb 05 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2646





------- Comment #1 from samukha voliacable.com  2009-02-05 12:05 -------
Another try:

template Signal()
{
  void connect() {};
}

class AbstractButton
{
  mixin Signal clicked;
}

class CheckBox : AbstractButton
{
  mixin Signal toggled;
  mixin Signal kicked;
}


-- 
Feb 05 2009