fpc/tests/webtbs/tw23667.pp
Jonas Maebe 1601f6bea8 * treat methods called via records the same as records called via objects
without virtual methods: they may initialise the instance (mantis #23667)

git-svn-id: trunk@23976 -
2013-03-24 16:27:02 +00:00

27 lines
421 B
ObjectPascal

{ %opt=-vw -Sew }
{ %norun }
{$mode objfpc}
{$modeswitch advancedrecords}
type
tpoint = record
x,y: longint;
function add(const aPoint:Tpoint):TPoint;
procedure setlocation(xx,yy: longint);
end;
procedure tpoint.setlocation(xx,yy: longint);
begin
x:=xx;
y:=yy;
end;
function TPoint.Add(const aPoint:Tpoint):TPoint;
begin
Result.SetLocation(self.x+aPoint.X, self.Y+aPoint.Y);
end;
begin
end.