Fatal: Syntax error, ")" expected but "(" found
Original Reporter info from Mantis: inoussa @inoussa12
-
Reporter name: Inoussa OUEDRAOGO
Original Reporter info from Mantis: inoussa @inoussa12
- Reporter name: Inoussa OUEDRAOGO
Description:
The compiler conplains( see the code below ) :
"Fatal: Syntax error, ")" expected but "(" found"
It compiles under Delphi ( D7 ).
I tried with "mode delphi" and "mode objfpc" and still got the same syntax error.
Additional information:
program test_syntax;
{$IFNDEF FPC}
{$APPTYPE CONSOLE}
{$ENDIF}
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
type
{$IFNDEF FPC}
PPtrInt = ^Integer;
{$ENDIF}
PRecA = ^TRecA;
TRecA = record
_data : array[0..0] of Byte;
end;
TTestObj = class
function Append() : PRecA;
end;
function TTestObj.Append() : PRecA;
begin
Result := nil;
end;
var
ox : TTestObj;
begin
ox := TTestObj.Create();
//this one compiles
PPtrInt(@((ox.Append()^._data[0])))^ := 0;
// error on this line : "Fatal: Syntax error, ")" expected but "(" found"
PPtrInt(@(ox.Append()^._data[0]))^ := 0;
end.
Mantis conversion info:
- Mantis ID: 10933
- Version: 2.3.1
- Fixed in revision: 35495 (#16a11c8b)