It seems like returning a function result as a
set/
array without making the set a declared type doesn't work? The documentation seems to be a bit cryptic on that "
The result type of a function can be any previously declared type".
In other words this doesn't compile:
function A: set of Byte; // Error: Type identifier expected
neither does this
function B: array of Byte; // Error: Type identifier expected
While this works:
type
TSetOfByte = set of Byte;
function A: TSetOfByte;
type
TArrayOfByte = array of Byte;
function B: TArrayOfByte;
Also this works:
function A: specialize TList<Byte>;
To be more specific about my usecase, I wanted to make a function that does the following:
generic function StringToEnumsSet<T>(const AString: String): set of T;
I don't think I can forward-declare type
set of T, can I?