On 01.07.2019 19:38, Michael Van Canneyt wrote:
On Mon, 1 Jul 2019, Ondrej Pokorny wrote:
On 01.07.2019 18:21, Michael Van Canneyt wrote:
On Mon, 1 Jul 2019, Ondrej Pokorny wrote:
On 01.07.2019 15:57, Ryan Joseph wrote:
  TTest = class
  public
    // ...
    property StringArray[Index: Integer]: string read GetString;
    property StringArray: TTestObjectEnumerator read GetString;
  end;
From the above example "Mytest.StringArray" can only evaluate to TTestObjectEnumerator. Nothing else.

Well, this is IMHO not correct. The array is also a possibility.

The compiler encounters Mytest.StringArray - at that point he has 2
possibilities. It's an array (and an index must expected) or it is an
enumerator (and nothing must be expected), but at this point the compiler
cannot decide without looking at the context.

There is no array. "property StringArray[Index: Integer]" is not an array and cannot be evaluated as an array.

If the compiler encounters "Mytest.StringArray" it can be evaluated only as the non-indexed overload.

Ondrej

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to