On 24/12/2021 18:07, Bart via fpc-devel wrote:
On Fri, Dec 24, 2021 at 12:00 PM Adriaan van Os via fpc-devel
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;
On Fri, Dec 24, 2021 at 12:00 PM Adriaan van Os via fpc-devel
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
Michael Van Canneyt via fpc-devel wrote:
I will probably have to rephrase the documentation to 'The compiler will
not allow you to modify the parameter value by assigning something
directly to it."
Neither would the compiler allow (I hope) the const parameter to be passed as a
var parameter.