Why casting an open array parameter to an array type causes E2089 Invalid typecast?
问题 I'm using Delphi 2007 (Pre generics) and I've defined many functions who can be used for all arrays of TObject 's descendants, example: function IndexOf(AArray : array of TObject; AItem : TObject) : integer; begin //... end; For passing them dynamic arrays of TObject 's descendants, I've defined an array type TObjectArray = array of TObject . In this way I can cast dynamic arrays and pass them to my functions without any problems: type TChild = class(TObject); ... procedure Test(); var Items