Bug 17349 – Covariant overrides should be allowed

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-04-26T08:29:00Z
Last change time
2017-08-07T13:16:39Z
Assigned to
nobody
Creator
bugzilla
See also
https://issues.dlang.org/show_bug.cgi?id=16303, https://issues.dlang.org/show_bug.cgi?id=16600, https://issues.dlang.org/show_bug.cgi?id=3075, https://issues.dlang.org/show_bug.cgi?id=17354

Comments

Comment #0 by bugzilla — 2017-04-26T08:29:31Z
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().
Comment #1 by bugzilla — 2017-04-26T18:16:28Z
Comment #2 by github-bugzilla — 2017-06-10T19:57:11Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/832031adddadc3b9b8a3bca94bd30be1393b570a fix Issue 17349 - Covariant overrides should be allowed https://github.com/dlang/dmd/commit/e07c3de8d93dee095edfeb0322f408726dcfd5a0 Merge pull request #6731 from WalterBright/fix17349 fix Issue 17349 - Covariant overrides should be allowed merged-on-behalf-of: Andrei Alexandrescu <[email protected]>
Comment #3 by github-bugzilla — 2017-08-07T13:16:39Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/832031adddadc3b9b8a3bca94bd30be1393b570a fix Issue 17349 - Covariant overrides should be allowed https://github.com/dlang/dmd/commit/e07c3de8d93dee095edfeb0322f408726dcfd5a0 Merge pull request #6731 from WalterBright/fix17349