[fpc-pascal] Dynamic array bug

silvioprog silvioprog at gmail.com
Thu Nov 8 05:17:01 CET 2018


On Thu, Nov 8, 2018 at 1:13 AM silvioprog <silvioprog at gmail.com> wrote:

> On Wed, Nov 7, 2018 at 11:06 PM Ryan Joseph <ryan at thealchemistguild.com>
> wrote:
>
>> I read the old thread and we need to add {$modeswitch arrayoperators} to
>> make it work. a += [4] does work now.
>>
>> Also I found the thread where Sven said he fixed the "Incompatible types:
>> got "Set Of Byte” bug in r39554 (
>> https://bugs.freepascal.org/view.php?id=34021). It is indeed fixed but
>> only for + operators.
>>
>> Do you want me to file a new bug report for := operators?
>
>
> You can temporary solve it by specializing a generic array:
>

... or forcing the compiler to get the correct type by cast:

type
  TIntArray = array of integer;

...

var
  r: TMyRec;
begin
  r := TIntArray([1, 2, 3]);
...

--
Silvio Clécio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20181108/825dd620/attachment.html>


More information about the fpc-pascal mailing list