[fpc-pascal] += property bug?
Ryan Joseph
genericptr at gmail.com
Mon Aug 12 00:33:25 CEST 2019
> On Aug 11, 2019, at 3:59 PM, Alexander Grotewohl <alex at dcclost.com> wrote:
>
> d.x += 10; // makes even more sense
Ok, you win. Here’s more or less the full snippet.
type
TRectHelper = record helper for TVec4
private
procedure SetAxisX(newValue: TScalar); inline;
public
function MinX: TScalar; inline;
function MinX: TScalar; inline;
property AxisX: TScalar read MinX write SetAxisX;
end;
function TRectHelper.MinX: TScalar;
begin
result := v[0];
end;
function TRectHelper.MaxX: TScalar;
begin
result := v[2];
end;
procedure TRectHelper.SetAxisX(newValue: TScalar);
begin
v[0] += newValue;
v[2] += newValue;
end;
==============================
rect.axisX += 10 is a compound statement. See it makes perfect sense. :) I still don’t understand why the compiler and Delphi apparently thinks this is such a crazy idea. It's just normal stuff imo.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list