title: Delphi: RTTI for indexed properties in 2010?
body: <p>Please forgive the verbosity of the following code example. Using Delphi 2009, I created the two classes TOtherClass and TMyClass:</p>
  
  <pre><code>TOtherClass = class(TObject)
  public
      FData: string;
  end;
  
  TMyClass = class(TObject)
  private
      FIndxPropList: Array of TOtherClass;
      function GetIndxProp(Index: Integer): TOtherClass;
      procedure SetIndxProp(Index: Integer; Value: TOtherClass);
  public
      property IndxProp[Index: Integer]: TOtherClass read GetIndxProp write SetIndxProp;
  end;
  </code></pre>
  
  <p>with access specifiers implemented as</p>
  
  <pre><code>function TMyClass.GetIndxProp(Index: Integer): TOtherClass;
  begin
      Result := self.FIndxPropList[Index];
  end;
  
  procedure TMyClass.SetIndxProp(Index: Integer; Value: TOtherClass);
  begin
      SetLength(self.FIndxPropList, Length(self.FIndxPropList) + 1);
      self.FIndxPropList[Length(self.FIndxPropList) - 1] := Value;
  end;
  </code></pre>
  
  <p>It's use can be illustrated as follows:</p>
  
  <pre><code>procedure Test();
  var
      MyClass: TMyClass;
  begin
      MyClass := TMyClass.Create;
      MyClass.IndxProp[0] := TOtherClass.Create;
      MyClass.IndxProp[0].FData := 'First instance.';
      MyClass.IndxProp[1] := TOtherClass.Create;
      MyClass.IndxProp[1].FData := 'Second instance.';
      MessageDlg(MyClass.IndxProp[0].FData, mtInformation, [mbOk], 0);
      MessageDlg(MyClass.IndxProp[1].FData, mtInformation, [mbOk], 0);
      MyClass.IndxProp[0].Free;
      MyClass.IndxProp[1].Free;
      MyClass.Free;
  end;
  </code></pre>
  
  <p>Never mind the obvious flaws of this "design". I realized that I'd like to be able to access the property IndxProp via RTTI, and subsequently moved the IndxProp to the published section. Much to my disappointment, I found that indexed properties are not allowed in the published section. As far as I understand (see Barry Kellys comment at <a href="https://stackoverflow.com/questions/1190548/how-do-i-access-delphi-array-properties-using-rtti">How do I access Delphi Array Properties using RTTI</a>), moving to D2010 won't enable me to do this.</p>
  
  <p>On the other hand, the following is a quote from <a href="http://robstechcorner.blogspot.com/2009/09/delphi-2010-rtti-basics.html" rel="nofollow noreferrer">Robert Loves blog</a>: "... properties and methods are now available via RTTI in both public and published sections, and Fields are available in <em>all of the sections</em>." (My italics.)</p>
  
  <p>My question is this: if it's true that it is possible to get RTTI for public fields in D2010, shouldn't my original example (as shown above) work in D2010 (with RTTI)? Thanks in advance!</p>