+ check for record operator overloading

This commit is contained in:
pierre 2002-10-29 11:36:30 +00:00
parent abbb7ed41c
commit ca424bbc32

28
tests/webtbs/tw1223.pp Normal file
View File

@ -0,0 +1,28 @@
{ Source provided for Free Pascal Bug Report 1223 }
{ Submitted by "Denis Yarkovoy" on 2000-11-03 }
{ e-mail: gunky9@geocities.com }
Type
TPoint = record
X, Y : integer;
end;
operator + (const p1, p2:TPoint) p : TPoint;
begin
p.X:=p1.X+p2.X;
p.Y:=p1.Y+p2.Y;
end;
var d,d1:TPoint;
begin
d.x:=5;d.y:=34;
d1.x:=6;d1.y:=-50;
d:=d+d1;
if (d.x<>11) or (d.y<>-16) then
begin
Writeln('Error is operator overloading');
Halt(1);
end
else
Writeln('Operator overloading works correctly');
end.