0
Planned

Extension to "W519 Method '%s' is empty" for methods which only contain "inherited"

Nicholas Ring 10 years ago updated by Roman 10 years ago 1

While W519 is flagged when a method is empty. I am suggesting that methods the only call "inherited" should (optionally) be flagged as empty.


Examples:

The should be flagged as empty

procedure TMyForm.OnKeyDown(Sender : TObject; var Key: Word; Shift: TShiftState);
begin
  inherited;  // will call the inherited version of "OnKeyDown(Sender, Key, Shift);"
end;

Should not be flagged as empty:

procedure TMyForm.OnKeyDown(Sender : TObject; var Key: Word; Shift: TShiftState);
begin
  inherited OnSpecialKeyDown(Sender, Key, Shift);
end;
Likewise, both the following should be flagged as empty:

constructor TMyObject.Create;
begin
  inherited;
end;
constructor TMyObject.Create;
begin
  inherited Create;  // inherited call method name is the same.
end;