So I have a pretty simple function

[pascal]function MyPoint(X,Y: Integer): TMyPoint;
begin
Result.X := X;
Result.Y := Y;
end;[/pascal]

I can't see anything wrong with this, but when I test my project all my points ends up with coordinate (0,0). I try and add some breakpoints and can see that delphi can't acces variable X and Y due to optimization :?
Can someone tell me what's going on?

EDIT. Nevermind - it turns out the problem is not there.