Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Delphi IDE Wizard bug


#1

SmartInspect -> Instrument Unit… Wizard having issues with type clause in the middle of the code (see below), it will stop processing source code after type:

[code]var
Form6: TForm6;

implementation

{$R *.dfm}

procedure TForm6.FormClick(Sender: TObject);
begin
SiMain.EnterMethod(lvDebug, Self, ‘FormClick’);

// empty

SiMain.LeaveMethod(lvDebug, Self, ‘FormClick’);
end;

[color=red]type
TMyForm = class(TForm);[/color]

procedure TForm6.FormCreate(Sender: TObject);
begin
// empty
end;
[/code]


#2

Thanks for reporting this, Alex. I will take a look at the sample code and try to reproduce the problem here (will post my results by tomorrow). It may be that our parser does not expect a type declaration after it has found a method.

Thanks,
Tobias


#3

I could reproduce the behavior and it indeed seems to be related to the type declaration. It seems that the parser does not handle type declarations in the implementation section correctly. I opened a bug report for this problem and we will look into it. For now, I would recommend putting the type declaration into the interface section, if this would work for you.

Thanks,
Tobias