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.