fpc/tests/webtbs/tw15728.pp
Jonas Maebe d60e1f674c * automatically try to call procvars that are subscripted or used in a
with-statement, both in FPC and TP/Delphi modes (mantis #15728)

git-svn-id: trunk@14881 -
2010-02-10 16:12:18 +00:00

36 lines
469 B
ObjectPascal

program TT;
{$mode delphi}
uses
SysUtils;
type
t_R = record
R1:integer;
end;
t_X = function:t_R;
function A:t_R;
begin
Result.R1:=123;
end;
var X:t_X;
begin
X:=A;
if x.r1<>123 then
halt(1);
writeln(X.R1); // Error: Illegal qualifier
writeln(X().R1); // OK
with X do
begin
if r1<>123 then
halt(2);
writeln(R1); //Error: Expression type must be class or record
end;
with X() do writeln(R1); // OK
end.