Boo

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

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.8.1
  • Fix Version/s: 0.9
  • Component/s: Compiler
  • Labels:
    None
  • Number of attachments :
    0

Description

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.

Activity

Hide
Cedric Vivier added a comment -

Landed in rev. 3192

Show
Cedric Vivier added a comment - Landed in rev. 3192

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: