[fpc-pascal] Open array in object constructor gives error

Hairy Pixels genericptr at gmail.com
Sat Dec 31 04:35:52 CET 2022


Why is using the open array parameter illegal using the Object type?

========================

{$mode objfpc}

program test;

type
  TMyObject = object
    constructor Create(text: array of String);
  end;

constructor TMyObject.Create(text: array of String);
begin
end;

begin
  TMyObject.Create(['1', '2', '3']); // error: Illegal expression
end.


Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list