Why can't I return arbitrary array of string?
问题 The compiler allows me to do the following: procedure MyProc(const ADynData: array of string); or procedure MyProc(const ADynData: TStringDynArray); and pass arbitrary data like so: MyProc(['Data1', 'Data2']); However, won't allow function MyFunc: TStringDynArray; .... function MyFunc: TStringDynArray; begin Result := ['Data1', 'Data2']; end; or function MyFunc: TStringDynArray; const CDynData: array[0..1] of string = ('Data1', 'Data2'); begin Result := CDynData; end; Why is this? Isn't this