Generic arrays

Should I be able to do this in Oxygene (Prism)?

TArray = array of T;

or

TArray = Array;

If not, is there a way to define TArray ?

Regards
Keith

I see the forum eats the < it should say:

TArray<T> = array of T

and

TArray<T> = Array<T>

TArray would be a type alias. Oxygene doesn’t do generic type aliases. What are you trying to accomplish?

I share a library codebase between Delphi, and Prism.

As an example in Delphi I define T2DArray<T> as an array of TArray<T>, and a T3DArray<T> as array of T2DArray<T> (I have a variety of 2D and 3D arrays with generic code to process them).

so to process a T2DArray I might then have a method that returns an instance:

function GetInstance : T2DArray<T>;

and a field in my class:

fInstance : T2DArray<T>

and the method body returns fInstance.

Regards
Keith

Hello Keith,

I added a feature request (#56644) but currently we do not support generic aliases.

Best regards.