Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Test version causes unexpected W525 warnings

 Post Reply Post Reply
Author
Onken L. View Drop Down
Member
Member
Avatar

Joined: 16 Jun 2010
Posts: 60
Post Options Post Options   Quote Onken L. Quote  Post ReplyReply Direct Link To This Post Topic: Test version causes unexpected W525 warnings
    Posted: 21 Mar 2019 at 2:25pm
The test version which you made available in the "https://www.tmssoftware.com/site/forum/forum_posts.asp?TID=13009&title=possible-concurrency-issue-in-fixinsight" thread throws unexpected W525 "Missing INHERITED call in constructor" warnings.

In one module we have a class with an additional constructor, like:

  TMyClass = class
public constructor Create(AOwner: TComponent); override; constructor CreateWithTemplate(AOwner: TComponent; AList: TList<TColor32>);
end;

constructor TMyClassCreate(AOwner: TComponent);
begin
inherited;
...
end;

constructor TMyClass.CreateWithTemplate(AOwner: TComponent; xList: TList<TColor32>);
begin
  Create(AOwner);
  ...
end;

The warning is shown for the alternative constructor even though there is nothing to inherit from.
It looks like the rule is applied to every constructor. I can understand the reasoning behind it. Wouldn't it be better to apply this rule only when a constructor actually overrides its parent?
Or should we just turn the warning off on this line, because we know that the parent constructor is called indirectly?

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down