I just faced a strange compiler error when trying to define nested generic record.
Nesting works fine with classes and interfaces, but not with records somehow.
type
TRec<T> = record
Value: T;
end;
TCls = class
public
Rec: TRec<TRec<Integer>>;
end;
This is not compiled on Delphi Berlin 10.1.2 and also no luck on Tokyo 10.2.3. Is this a limitation of language or a compiler issue?
The error message is:
[dcc32 Error] Project1.dpr(22): E2564 Undefined type 'TRec<T>'
I just wanted once to nest the Spring.Nullable<>
types and that did not work. After that I quickly reproduced that with a simple generic record.