Known limitations

Top  Previous  Next

 

There are situations that Pascal Analyzer currently cannot handle very well. Some of these limitations, but certainly not all, are:

 

1. Objects that are created through a class reference cannot be resolved. The actual class is determined at runtime.

 

Example:

 

type

TMyClassRef = class of TMyClass;

 

TMyClass = class

   ..

   procedure Method; virtual;

end;

 

TMyDerivedClass = class(TMyClass)

   ..

   procedure Method; override;

end;

 

..

 

procedure Proc(C : TMyClassRef);

begin

C := TMyClassRef.Create; // TMyClass or TMyDerivedClass?

C.Method; // TMyClass.Method or TMyDerivedClass.Method?

..

end;

 

 

2. Methods that are marked as abstract in a base class and used in that class, cannot be resolved:

 

Example:

 

type

TBase = class

..

   procedure Main;

   procedure Proc; virtual; abstract;

end;

 

TDesc = class(TBase)

..

   procedure Proc; overload;

end;

 

TAnotherDesc = class(TBase)

..

   procedure Proc; overload;

end;

 

procedure TBase.Main;

begin

   ..

   Proc; // which one, TDesc.Proc or TAnotherDesc.Proc?

end;

 

The actual usage of Proc is determined at runtime.

 

3. Assert calls are not excluded from the parsing process, unlike in Delphi, regardless if the $C- setting is active or not. This means that identifiers used in the Assert procedure call, will be registered, and appear in the reports.

 

Example:

 

procedure MyProc(P : pointer);

begin

Assert(P <> nil);

..

end;

 

The parameter P will be registered and appear in the reports. When compiled by Delphi, this code line will be stripped out if $C- is defined.

 

See also: