[fpc-pascal] Doubt related to the issue #30498

Sven Barth pascaldragon at googlemail.com
Tue Aug 23 07:57:07 CEST 2016


Am 23.08.2016 04:24 schrieb "silvioprog" <silvioprog at gmail.com>:
>
> Hello,
>
> A possible inline way (without declaring specialized local variables) to
compile the attached test at the issue #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

See here: http://bugs.freepascal.org/view.php?id=30503

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160823/588f3ca0/attachment.html>


More information about the fpc-pascal mailing list