In the past weeks we came across plenty of false positives when arrays or lists were involved. It looks like FixInsight doesn't detect the real data type of the value that is passed to the function, but stops at the outer/first data objects that it finds.
typical case:
procedure Write;
var
sl : TStringList;
begin
sl := TStringList.Create;
for i := 0 to sl.count - 1 do
WriteLn(Format('%s', [sl[i]])); // <-- Wrong W537
end;
In the case below FData.Values is a TDictionary<string, IMyInterface>
procedure WriteValue(AValue:IMyInterface);
begin
end;
procedure WriteSorted;
var
SortedKeys: TList<String>;
Key : String;
begin
SortedKeys := TList<String>.Create(FData.Values.Keys);
try
SortedKeys.Sort(FStringComparer);
for Key in SortedKeys do
WriteValue(FData.Values[Key]); // <- Wrong W534: Class instance 'FData' passed to 'WriteValue' but interface expected
finally
SortedKeys.Free;
end;
end;