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

           Summary: If a class have some signals it's impossible for a
                    derived class to have any signals
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: verylonglogin....@gmail.com


--- Comment #0 from Denis <verylonglogin....@gmail.com> 2012-05-04 14:55:44 MSD 
---
`Signal` methods should never ever by virtual. We don't want user to override
connect/disconnect etc.

All `Signal` methods are virtual. As a result with current named mixin
templates behavior (they can add virtual methods):
---
import std.signals;

class A {
    mixin Signal created;
}
class B : A {
    mixin Signal moved; // Yes, it overrides `created` signal!
}
---
or even worse:
---
import std.signals;

class A {
    mixin Signal s1;
    mixin Signal s2;
}

class B : A {
    mixin Signal s3; // Guess what A signal is overriden?
}
---
or even worse:
---
import std.signals;

class A {
    mixin Signal s1;
}

class B : A {
    // Guess what exectly is overriden?
    // Spoiler: unhook is overriden!
    mixin Signal!int s2;
}
---

Hello heisenbugs for every unlucky person who doesn't compile with `-w`!

That's why it's impossible to use `std.signals` in any GUI library for now.

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

Reply via email to