<div dir="auto"><div><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Thomas Kurz via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mo., 15. Juni 2026, 11:08:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
I'm observing a strange array issue. Please consider this code:<br>
<br>
```<br>
program ArrayTest;<br>
<br>
{$MODESWITCH ARRAYOPERATORS}<br>
<br>
var x, y: packed array of PtrInt; i: Integer;<br>
<br>
begin<br>
x := [0,0];<br>
<br>
y := System.Copy (x, 0, Length(x)-2) + [234, 567] + [0, 0];<br>
// prints [0,0,0,0]<br>
for i := Low(y) to High(y) do writeln (y[i]);<br>
<br>
y := System.Copy (x, 0, Length(x)-2);<br>
y := y + [234, 567];<br>
y := y + [0, 0];<br>
// prints [234,567,0,0]<br>
for i := Low(y) to High(y) do writeln (y[i]);<br>
end.<br>
```<br>
<br>
To me, both assignments to `y` are equal in the end. But the first one results in `y = [0,0,0,0]`, while the second one correctly gives me `y = [234,567,0,0]`.<br>
<br>
I'm on Windows 64, trunk 3.3.1 (Free Pascal Compiler version 3.3.1 [2026/03/11] for x86_64) and would appreciate if anyone could try to reproduce this behavior. Or explain it to me :)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Please report a bug. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>