[fpc-devel] open array calling [[was: Re: C-block reference syntax (blocker for 3.2)]]
Michael Van Canneyt
michael at freepascal.org
Thu Dec 12 17:23:29 CET 2019
On Thu, 12 Dec 2019, Martin Frb wrote:
> On 12/12/2019 17:14, Michael Van Canneyt wrote:
>> On Thu, 12 Dec 2019, Sven Barth via fpc-devel wrote:
>>> For array of const it is not allowed, but any other open array parameter
>>> allows it.
>>
>> Really, are you sure ? Since when is this allowed ?
>
> It works with a variable in the param list, but not with a constant.
>
> program Project1;
> procedure Foo(a: array of integer);
> begin end;
>
> var a: integer;
> begin
> foo(a);
> // foo(1); // fails
> end.
>
>
> And then it also works for array of const
>
> program Project1;
> procedure Foo(a: array of const);
> begin end;
>
> var a: TVarRec;
> begin
> foo(a);
> end.
Great :(
Hm. I modified the delphi program to check. It also works with a variable...
What kind of braindead "feature" is this ? :(
Michael.
More information about the fpc-devel
mailing list