Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / pas2js / 2019-07

+= notation in pas2js 1.5.1

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

warleyalex

I've got an fatal error when compiling the function Add (Error: Identifier expected) using the compiler
Pas2JS Compiler version 1.5.1 [2019/07/24] for Win32 i386

The pas2js 1.4.10 it compiles as expected.

----------
{$modeswitch AdvancedRecords}
type
  TPoint = record
    x,y: word;
    function Add(const apt: TPoint): TPoint;
  end;
implementation
function TPoint.Add(const apt: TPoint): TPoint;
begin
  Result:=Self;
  Result.x+=apt.x;   //------>>>>  this error occurr in pas2js 1.5.1
  Result.y:=Result.y+apt.y;
  Self:=apt;
 end;
----------
Project: Executing command before: Exit code 6, Errors: 1
unit2.pas(173,12) Error: Identifier expected

------------------------

Reply by email

Mattias Gaertner
to warleyalex
warleyalex wrote 27 lines
I've got an fatal error when compiling the function Add (Error: Identifier expected) using the compiler Pas2JS Compiler version 1.5.1 [2019/07/24] for Win32 i386 The pas2js 1.4.10 it compiles as expected. ---------- {$modeswitch AdvancedRecords} type TPoint = record x,y: word; function Add(const apt: TPoint): TPoint; end; implementation function TPoint.Add(const apt: TPoint): TPoint; begin Result:=Self; Result.x+=apt.x; //------>>>> this error occurr in pas2js 1.5.1 Result.y:=Result.y+apt.y; Self:=apt; end; ---------- Project: Executing command before: Exit code 6, Errors: 1 unit2.pas(173,12) Error: Identifier expected

Please create a bug report.

Mattias

Reply by email