Issue Details (XML | Word | Printable)

Key: BOO-989
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Cedric Vivier
Reporter: Marcus Griep
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Possibly suggest alternative when a function marked with 'override' doesn't override anything

Created: 09/Apr/08 10:59 AM   Updated: 25/Jan/09 03:16 PM   Resolved: 25/Jan/09 03:16 PM
Component/s: Compiler
Affects Version/s: 0.8.1
Fix Version/s: 0.9

Time Tracking:
Not Specified


 Description  « Hide

Take, for example, this general class:

class Demonstrative:
  override def GetHasCode():
    return 1

Here, the likely intended override GetHashCode() is not overriden, but an error is produced about the GetHasCode() method. In another example, interfaces do not require overrides, so this will also generate a warning/error:

class Illistrative(IDisposable):
  override def Dispose():
    pass

In both cases, an error is generated, but no suggestion as to fixes are given. Possibly use Cedric's soundex method to suggest the intended override if one exists (perhaps) in first case, and in second case, note that an interface requires the Dispose() method and give explanation 'If you intended to implement 'IDisposable.Dispose()', remove the override keyword.', or be tolerant to the override keyword in this case.



Cedric Vivier added a comment - 25/Jan/09 03:16 PM

Landed in rev. 3192