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

W503 missing with "self"

 Post Reply Post Reply
Author
Sveinsson Kjaran View Drop Down
New Member
New Member
Avatar

Joined: 18 Nov 2016
Posts: 6
Post Options Post Options   Quote Sveinsson Kjaran Quote  Post ReplyReply Direct Link To This Post Topic: W503 missing with "self"
    Posted: 18 Nov 2016 at 1:47pm
The following code does not produce a warning W503. If self is removed there is a warning.

type
  TNoWarning = class
  private
    FText: String;
  public
    Procedure SetText(const AText: String);
  end;

{ TNoWarning }

procedure TNoWarning.SetText(const AText: String);
begin
  self.FText:= FText;
end;
Back to Top
Nicholas Ring View Drop Down
New Member
New Member
Avatar

Joined: 09 Sep 2016
Posts: 7
Post Options Post Options   Quote Nicholas Ring Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 2016 at 10:59pm
I have found a similar thing with this code:

procedure AMethod(AString : string);
begin
  System.Delete(AString, 1, 1);
end;

FixInsight says that "AString" is missing "const". If you remove the "System.", all is good.
Back to Top
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 Posted: 27 Sep 2017 at 11:13am
There are a lot of false positives like this. If a string is passed into a method (without const) and the same string is passed into another method where it is modified, FixInsight complains about the missing const
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down