D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3526 - Mixin of member function not overriden by enclosing scope
Summary: Mixin of member function not overriden by enclosing scope
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-19 10:22 UTC by Tomasz Sowiński
Modified: 2015-06-09 01:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tomasz Sowiński 2009-11-19 10:22:45 UTC
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.