[fpc-devel] Property overloading vs. property array enumerators

Ondrej Pokorny lazarus at kluug.net
Thu Jan 28 13:17:08 CET 2016


@Michael:

Ondrej, if you make it an interface,

   TTest = class
   public
     property Objects[Index: Integer]: TObject read GetObject;
   published
     property Objects: IEnumerator read GetObjectEnumerator;
   end;

Then the compiler will know how to free it.


--

Yes, true. The same is for enumerators defined as records. I forgot that 
it's the programmer's responsibility to use the correct scenario. So 
using an interface/record in case of property overload is valid. Thanks 
for emphasizing it.

Ondrej



More information about the fpc-devel mailing list