[Issue 8030] New: Multiple override are allowed using mixin template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 4 02:32:24 PDT 2012


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

           Summary: Multiple override are allowed using mixin template
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis <verylonglogin.reg at gmail.com> 2012-05-04 13:33:36 MSD ---
IMHO this should rise a compiler error:
---
mixin template T() {
    override string f() { return "T"; }
}

class A {
    string f() { return "A"; }
}

class B: A {
    mixin T;
    override string f() { return "B"; }
    mixin T;
}

void main() {
    A b = new B;
    assert(b.f() == "B"); // This passes
}
---

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


More information about the Digitalmars-d-bugs mailing list