Error with constref
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.Summary
Given code not compile with error:
(14,18) Error: Can't assign values to const variable When replace constref with const compilation works.
Compiler
Tested with trunk