www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3526] New: Mixin of member function not overriden by enclosing scope

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

           Summary: Mixin of member function not overriden by enclosing
                    scope
           Product: D
           Version: 2.036
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tomeksowi gmail.com


--- Comment #0 from Tomasz SowiƄski <tomeksowi gmail.com> 2009-11-19 10:22:45
PST ---
interface Foo {
    public int foo();
}

template fooImpl() {
    public override int foo() { return 4; }
}

class Goo : Foo {
    mixin fooImpl!();
    public override int foo() { return 7; }
}

void main() {
    Foo f = new Goo;
    assert (f.foo == 7);
}

The above assert fails. Problem is the declaration order matters -- when the
mixin comes AFTER the hand-coded foo(), it's fine.

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