Skip to content

Quickfix for Redundant Inherited removes too much when in else clause #430

@alisterchristie

Description

@alisterchristie

SonarDelphi version

1.18.3

SonarQube version

No response

Issue description

The quickfix for this "Redundant inherited statement should be removed"

procedure TForm47.Button1Click(Sender: TObject);
begin
  if Sender = Button1 then
  begin
    // do something
  end
  else
    inherited;
end;

is

procedure TForm47.Button1Click(Sender: TObject);
begin

end;

Which seems a tad excessive.

Steps to reproduce

Just create a button event as in the description above.

Minimal Delphi code exhibiting the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions