[Lazarus] int64 assignment fails

Flávio Etrusco flavio.etrusco at gmail.com
Sun May 11 05:04:21 CEST 2014


On Sat, May 10, 2014 at 8:40 PM, Tom Lisjac <zikon770 at gmail.com> wrote:
> fpc-2.6.4-1.x86_64. says "Argument can't be assigned to" when trying to
> compile the following:
>
> type
>   TickType = Int64;
>
>   TimebaseData = record
>     TicksFrequency: TickType;
>   end;
>
>   TEpikTimer= class(TComponent)
>     private
>       FHWTicks:TimeBaseData;
>     Public
>       property HWTimebase: TimeBaseData read FHWTicks write FHWTicks;
>
>   TForm1 = class(TForm);
>     public
>       ET:TEpikTimer;
>
>   procedure TForm1.Button8CLICK(Sender: TObject);
>    begin
>       ET.HWTimebase.TicksFrequency:=10; // Fails
>
> This used to compile and seems like a straightforward int64 assignment. Has
> something changed where this is no longer allowed?
>
> Thanks,
>
> -Tom

Yes, this used to compile, but was changed/fixed in FPC 2.2 or
something - I guess because of the "property contract": code shouldn't
break if you change your property to have a getter instead of direct
field access.

Best regards,
Flávio




More information about the Lazarus mailing list