Bug 18551 – Improve hint for "does not override any function

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2018-03-03T03:09:57Z
Last change time
2018-03-06T09:58:39Z
Assigned to
No Owner
Creator
Christian Köstlin

Comments

Comment #0 by christian.koestlin — 2018-03-03T03:09:57Z
https://run.dlang.io/is/TKIgPU class A { void test() {} } class B : A { override int test() {} } the errormessage sound strange (although the message is correct). It would be helpful, if the hint would show both complete method signatures to make the mistake more obvious. Another example could be class A { void test() {} } class B : A { override void test() nothrow {} } again, the error message is correct, but could be more helpful. e.g. onlineapp.d(6): Error: function "void onlineapp.B.test() nothrow" does not override any function, did you mean to override "void onlineapp.A.test()"?
Comment #1 by razvan.nitu1305 — 2018-03-05T09:59:14Z
Comment #2 by github-bugzilla — 2018-03-06T09:58:39Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/89243bdc93ef220f85e53d18a0c8521fc43afead Fix Issue 18551 - Improve hint for does not override any function https://github.com/dlang/dmd/commit/bc85c44e819a9ceaf14c33970a07e1105aaf5a93 Merge pull request #7984 from RazvanN7/Issue_18551 Fix Issue 18551 - Improve hint for does not override any function merged-on-behalf-of: Mike Franklin <[email protected]>