D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10271 - override const message is not helpful
Summary: override const message is not helpful
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: uplink.coder
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2013-06-04 18:29 UTC by Ellery Newcomer
Modified: 2021-05-11 09:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ellery Newcomer 2013-06-04 18:29:03 UTC
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 uplink.coder 2017-07-19 09:15:34 UTC
I'm taking this.
It's a nice diversion.
Comment 2 RazvanN 2021-05-11 09:09:05 UTC
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.