variable of parameter-less function returning record in FPC requires ()
Original Reporter info from Mantis: alexei
-
Reporter name: Alexei Chipovalov
Original Reporter info from Mantis: alexei
- Reporter name: Alexei Chipovalov
Description:
variable of parameter-less function type that returns record in FPC requires () after the function name. In Delphi it's OK.
Steps to reproduce:
{$APPTYPE CONSOLE}
program TT;
uses
SysUtils;
type
t_R = record
R1:integer;
end;
t_X = function:t_R;
function A:t_R;
begin
Result.R1:=0;
end;
var X:t_X;
begin
X:=A;
writeln(X.R1); // Error: Illegal qualifier
writeln(X().R1); // OK
with X do writeln(R1); //Error: Expression type must be class or record
with X() do writeln(R1); // OK
end.
Mantis conversion info:
- Mantis ID: 15728
- Version: 2.4.0
- Fixed in version: 2.4.2
- Fixed in revision: 15201 (#78e19bdd)
- Target version: 2.4.2