Hey, I was writing a simple generic function that should return a pointer to it's generic parameter type:
generic function foo<T>(): ^T;
The usual way of defining the pointer as it's own type is of course not possible in this situation. Is there another way except using untyped pointers?
I've already tried out defining a generic pointer type
generic TPointer<T> = ^T;
TFoo = class
generic function Foo<T>(): TPointer<T>;
end;
But this seems to also be pretty broken because this gives me my favourite error regarding generics, internal error 2012101001:
project1.lpr(16,3) Error: This type cannot be a generic
project1.lpr(17,54) Error: Internal error 2012101001
Mode Delphi: the same effect
Note line 16 is TFoo = class line