https://issues.dlang.org/show_bug.cgi?id=17349
Issue ID: 17349
Summary: Covariant overrides should be allowed
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The following:
class C {
void bar();
void foo(void* p);
}
class D : C {
override void bar() const; // works
override void foo(const void* p); // error
}
produces the error:
test.d(8): Error: function test.D.foo does not override any function, did you
mean to override 'test.C.foo'?
when it should compile successfully.
The covariance check is only done on the 'this' pointer. The problem is in the
compiler function findVtblIndex().
--