[fpc-pascal] FPC 3.0.0 and constref default param

Krzysztof dibo20 at wp.pl
Mon Mar 28 17:49:20 CEST 2016


Hi,

This code worked fine on FPC 2.6.4:

procedure Test(constref AParam: String = 'def_param');
begin
  writeln(AParam);
end;

But on FPC 3.0.0 I get error:

unit1.pas(30,42) Error: Default values can only be specified for
value, const and constref parameters

Had to change constref to const but why? Even error message is saying
that constref is ok

Tested on:
Linux Xubuntu 14.04 32bit
Lazarus 1.6 from i386 deb package
FPC 3.0.0 from i386 dep package

Regards



More information about the fpc-pascal mailing list