The definition of what I have in the FPC 3.2.2 is this
generic TCreateChildList<T: TObject> = class(specialize TFPGObjectList<T>)
^^^^^^^^^
AS you can see, it does not work correctly this way. Doing so hides the field and I can only assume is due to the fact that
the Class that is being introduced as the type is a CLASS and here we have a TOBJECT for which the version compiler I am using does not seem to understand.
Hides what field? Please don't do code snippets when asking about problems, but please provide complete, self contained examples that I can simply stuff into the compiler or understand completely by looking at it.
generic TCreateChildList<T: TObject> = class(specialize TFPGObjectList<T>)
When and in what combinations can the keywords generic and specialize be used together, and when should they be used separately? Is there documentation detailing the use/application of these keywords when defining and using generic types in your code? So far, I have used the Delphi mode (most often) or, to a limited extent, the ObjFpc mode with the above-mentioned keywords. I have the impression that at this point the readability and clarity of Object Pascal is approaching the proverbial "readability and clarity" of some C++ mechanisms (that is, the mechanisms are useful, but their writing in the code is unclear and ill-considered, resulting in the impression of gibberish <- note in brackets applies to C++).
The
generic keyword is required when you declare a generic type or function/method (in the later case in front of the
function/
procedure).
The
specialize keyword is required when you do a specialization of a generic type (be it as part of a
type-declaration or inline). The keyword is always part of the type name itself, so if you have other types or units they are
before the
specialize keyword.