I am trying to compile the next code:
{$mode ObjFPC}{$H+}
function F(constref A): UInt32;
var
D: UInt32 absolute A;
begin
Result:= D;
end;
function F2(constref Arr): Integer;
var
aArr: array [Byte] of Byte absolute Arr;
begin
Result:= F(aArr[0]);
end;
begin
end.
And getting
(14,17) Error: Can't assign values to const variable
When use const instead of constref code compiles.
Is it bug?