Bug 4507 – use spellchecker when override function doesn't override anything
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-07-26T07:17:00Z
Last change time
2015-06-09T05:10:41Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
hoganmeier
Comments
Comment #0 by hoganmeier — 2010-07-26T07:17:49Z
interface Foo
{
void tranform();
}
class Bar : Foo
{
override void transform()
{
}
}
override.d(8): Error: function override.Bar.transform does not override any function
Omitting override gives the equally useless message:
override.d(6): Error: class override.Bar interface function Foo.tranform isn't implemented
I once spent a lot of time to figure out the cause of this error because the missing 's' is hardly noticeable.
Why doesn't dmd use its spellchecker to help here?
Similar problem is if the name is correct but parameters or other things don't match. In this case dmd should also suggest something like "did you mean transform(f) instead of transform(const f)" or whatever.
Comment #1 by hoganmeier — 2010-07-26T07:44:36Z
k, had a quick look, obviously FuncDeclaration::findVtblIndex would need to be modified.
Comment #2 by github-bugzilla — 2012-03-12T00:40:47Z