org.sonar.l10n.delphi.rules.community-delphi.RedundantInherited.html Maven / Gradle / Ivy
The newest version!
Why is this an issue?
It is possible to use a bare inherited
in any method implementation, even if there is
no base method to call. Although this statement has no behavioral effect, it is misleading and
indicates a possible programming mistake.
Since the inherited
keyword works regardless of whether the method is marked as
override
, it can also lead to unexpected behavioral change if corresponding ancestor
methods are added later.
How to fix it
Remove the inherited
statement:
procedure TChild.Proc(Foo: TFoo);
begin
inherited;
// ...
end;
procedure TChild.Proc(Foo: TFoo);
begin
// ...
end;
© 2015 - 2024 Weber Informatics LLC | Privacy Policy