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

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


Ondrej, if you make it an interface,

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

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.


More information about the fpc-devel mailing list