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

Ondrej Pokorny lazarus at kluug.net
Thu Jan 28 13:05:37 CET 2016


To continue from http://bugs.freepascal.org/view.php?id=28820#bugnotes

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

@Maciej >> But what for "write"? ;d

Your problem... I don't see the point.

Btw. if the compiler should support property overloading then the 
enumerator keyword doesn't make much sense because of ambiguous code.

   TTest = class
   public
     property Objects[Index: Integer]: TObject read GetObject enumerator 
GetObjectEnumerator1;
     property Objects: TTestObjectEnumerator read GetObjectEnumerator2;
   end;

What should then be picked up by:
   for Object in Test.Objects do

GetObjectEnumerator1 or GetObjectEnumerator2?

Ondrej



More information about the fpc-devel mailing list