Hello,

A possible inline way (without declaring specialized local variables) to
compile the attached test at the issue #30498
<http://bugs.freepascal.org/view.php?id=30498> is:

...
  procedure Test(const AItems: TArray<string>);
  begin
  end;

begin
  // Test(['foo', 'bar']); issue #30498
  Test(TArray<string>.Create('foo', 'bar'));
...

However, how to do something like this in the following declaration?:

...
procedure Test(const AItems: TArray<TPair<string, string>>);
...

I've tried:

...
  procedure Test(const AItems: TArray<TPair<string, string>>);
  begin
  end;

begin
  Test(TArray<TPair<string, string>>.Create(TPair<string,
string>.Create('foo', 'bar')));
...

Got:

project1.dpr(18,37) Error: Illegal expression
project1.dpr(18,38) Fatal: Syntax error, ")" expected but "identifier
CREATE" found

Thank you!

--
Silvio Clécio
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to