D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4507 - use spellchecker when override function doesn't override anything
Summary: use spellchecker when override function doesn't override anything
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2010-07-26 07:17 UTC by Trass3r
Modified: 2015-06-09 05:10 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Trass3r 2010-07-26 07:17:49 UTC
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 Trass3r 2010-07-26 07:44:36 UTC
k, had a quick look, obviously FuncDeclaration::findVtblIndex would need to be modified.