Browse Source

* Add TList<T>.list property for Delphi compatibility. Fixes #40642

Michaël Van Canneyt 1 year ago
parent
commit
aa4136ce52
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/rtl-generics/src/generics.collections.pas

+ 3 - 1
packages/rtl-generics/src/generics.collections.pas

@@ -186,12 +186,13 @@ type
   protected
     type // bug #24282
       TArrayHelperBugHack = TArrayHelper<T>;
+      TArrayOfT = array of T;
   private
     FOnNotify: TCollectionNotifyEvent<T>;
     function GetCapacity: SizeInt; inline;
   protected
     FLength: SizeInt;
-    FItems: array of T;
+    FItems: TArrayOfT;
 
     function PrepareAddingItem: SizeInt; virtual;
     function PrepareAddingRange(ACount: SizeInt): SizeInt; virtual;
@@ -204,6 +205,7 @@ type
 
     property Count: SizeInt read GetCount;
     property Capacity: SizeInt read GetCapacity write SetCapacity;
+    property List: TArrayOfT read FItems;
     property OnNotify: TCollectionNotifyEvent<T> read FOnNotify write FOnNotify;
 
     procedure TrimExcess; virtual; abstract;