On Fri, Dec 24, 2021 at 12:00 PM Adriaan van Os via fpc-devel
<fpc-devel@lists.freepascal.org> wrote:

> Neither would the compiler allow (I hope) the const parameter to be passed as 
> a var parameter.

It does not:

{$mode objfpc}
{$h+}

procedure foo(var x: integer);
begin
end;

procedure bar(const y: integer);
begin
  foo(y); //line 10
end;

begin
end.

test.pas(10,8) Error: Can't assign values to const variable

-- 
Bart
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to