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