View Issue Details

IDProjectCategoryView StatusLast Update
0038014pas2jstranspilerpublic2020-11-28 12:45
ReporterSven Barth Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Versiontrunk 
Summary0038014: Concatenating an array with += does not compile
DescriptionThis is a follow up to 0037913.

If COperators are enabled and ModeSwitch ArrayOperators is set then using "+=" for an array should compile. FPC simply expands A +=B to Concat(A, B) (adding a single element is expanded to Insert(B, A, Length(A))).

Example is attached.
TagsNo tags attached.
Fixed in Revision
Attached Files

Activities

Sven Barth

2020-10-30 15:28

developer  

tarrtest.pp (160 bytes)   
program tarrtest;

{$mode objfpc}
{$COperators on}
{$modeswitch arrayoperators}

var
  A: array of TClass;
begin
  A := nil;
  A += [TObject];
end.
tarrtest.pp (160 bytes)   

Issue History

Date Modified Username Field Change
2020-10-30 15:28 Sven Barth New Issue
2020-10-30 15:28 Sven Barth File Added: tarrtest.pp
2020-10-30 15:40 Mattias Gaertner Assigned To => Mattias Gaertner
2020-10-30 15:40 Mattias Gaertner Status new => assigned
2020-11-28 12:45 Mattias Gaertner Status assigned => confirmed