0
Fixed

[W504] not detected when class is declared in the implementation part

Lübbe Onken 9 years ago updated by Roman 8 years ago 2

There's a bug with the W504 detection in FixInsight 2016.04, when the class is declared in the implementation part of a unit.

In the following code, there should be a W504 and a W525 detected, but only the 504 is shown and it is shown in the wrong location.


unit W504Test;

interface

uses
  System.Classes;

// Declare class in implementation, only the 504 warning is thrown in destructor
// nothing is shown for constructor
implementation 

type
  TBinWriter = class
  end;

  TContentBuilder = class(TStringList)
  private
    FBinWriter: TBinWriter;
  public
    constructor Create(ABinWriter: TBinWriter);
    destructor Destroy; override;
  end;

// Declare class in interface, behaviour is correct
// implementation 

constructor TContentBuilder.Create(ABinWriter: TBinWriter);
begin
//  inherited Create;
  FBinWriter := ABinWriter;
end;

destructor TContentBuilder.Destroy;
begin
  FBinWriter := Nil;
//  inherited;
end;

end.

This FixInsight bug bit me really hard until I spotted the missing "inherited create" bug in my code...

Should read "W525 not detected", but I got the numbers reversed...

Fixed

Fixed in upcoming 2016.09 release