[fpc-devel] Is that supposed to work: property with "[var index: TFoo]" ?

Martin Frb lazarus at mfriebe.de
Fri Jun 28 10:39:17 CEST 2019


On 28/06/2019 07:39, Sven Barth via fpc-devel wrote:
> Am 27.06.2019 um 21:09 schrieb Martin:
>>
>>   { TFoo }
>>
>>   TFoo = class
>>   private
>>     function GetFoo(var AIndex: Integer): Integer;
>>   public
>>     property Foo[var AIndex: Integer]: Integer read GetFoo;
>>   end;
>>
>>
> I just tested with Delphi and it works there as well. So contrary to 
> what we thought this does not seem to be a bug...

What does Delphi do with

     property Foo[AIndex: Integer; BIndex: Integer = 0]: Integer read 
GetFoo;
Because FPC rejects this one. (And IMHO rightfully so)


More information about the fpc-devel mailing list