Bug 10007 – function overrides but is not covariant
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-29T05:20:00Z
Last change time
2013-09-07T22:47:56Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
rswhite4
Comments
Comment #0 by rswhite4 — 2013-04-29T05:20:00Z
----
import std.stdio;
struct A { }
interface IFoo {
void bar(ref const A);
}
class Foo : IFoo {
void bar(ref const A a) {
}
void bar(const A a) {
return this.bar(a);
}
}
----
prints:
Error: function c517.Foo.bar of type void(const(A) a) overrides
but is not covariant with c517.IFoo.bar of type void(ref const(A))