www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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



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


Denis <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |verylonglogin.reg gmail.com
         Resolution|                            |FIXED


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