Bug 10271 – override const message is not helpful

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-04T18:29:03Z
Last change time
2021-05-11T09:09:05Z
Keywords
diagnostic
Assigned to
uplink.coder
Creator
Ellery Newcomer

Comments

Comment #0 by ellery-newcomer — 2013-06-04T18:29:03Z
class A { string filename() const { return "1";} } class B : A { override string filename() { return "2";} } void main(){ } yields tink.d(6): Error: function tink.B.filename does not override any function, did you mean to override 'tink.A.filename'? There should probably be some mention of const in there.
Comment #1 by uplink.coder — 2017-07-19T09:15:34Z
I'm taking this. It's a nice diversion.
Comment #2 by razvan.nitu1305 — 2021-05-11T09:09:05Z
This was fixed. Today's compiler yields: onlineapp.d(6): Error: function `string onlineapp.B.filename()` does not override any function, did you mean to override `const string onlineapp.A.filename()`? Closing as w4m.