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
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2646






Another try:

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

class AbstractButton
{
  mixin Signal clicked;
}

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


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


Denis <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg gmail.com



---
Related NG thread:
http://forum.dlang.org/thread/jo0lmj$4dp$1 digitalmars.com

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 04 2012