sonar-delphi icon indicating copy to clipboard operation
sonar-delphi copied to clipboard

ERROR Error while analyzing ... missing FORWARD at 'var'

Open simonegirlanda opened this issue 11 months ago • 3 comments

Prerequisites

  • [X] This bug is in SonarDelphi, not SonarQube or my Delphi code.
  • [X] This bug has not already been reported.

SonarDelphi version

1.11.0

SonarQube version

10.7

Issue description

ERROR Error while analyzing ... missing FORWARD at 'var'

we get this error inside implementation of methods, with different conditions (some of them are to be discovered yet)

We have solved by changing syntax of written code.

Steps to reproduce

use test code in description

Minimal Delphi code exhibiting the issue

Case 1

Two contiguous IF without begin/end block and an instructions contained in parenthesis... (ok, this is very strange)

unit testassignment;
interface
type
 myclass = Class(Tobject)
   Public
	Procedure myMethod;
 End;
 
Implementation
 Procedure myClass.myMethod;	
 Var
    B : Boolean;
 Begin
   if B then 
     B := B;
	 
   if B then 
     (B := B);
  end;
 end.

Case 2

tArray=

Moved in #318, it give "missing FORWARD at 'var'" error message, but it is related to that issue.

simonegirlanda avatar Dec 05 '24 17:12 simonegirlanda