Bug 7807 – Ambiguous virtual function error on const overloading with covariant return types

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2012-04-01T13:55:00Z
Last change time
2012-04-27T12:25:42Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
rbixby

Comments

Comment #0 by rbixby — 2012-04-01T13:55:17Z
The following code produces the error: "Error: class Implementation ambiguous virtual function getNext" interface Interface { Interface getNext(); const(Interface) getNext() const; } class Implementation : Interface { Implementation getNext() { return null; } const(Implementation) getNext() const { return null; } } The error does not appear if "Interface" is changed to an abstract class.
Comment #1 by k.hara.pg — 2012-04-02T04:28:12Z
Comment #2 by github-bugzilla — 2012-04-27T10:47:55Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fecb72a7f64e346c27e082bf89efde83ff9ddf5b fix Issue 7807 - Ambiguous virtual function error on const overloading with covariant return types