Hello and first of all, thanks for your answers.
Change to delphi-mode
@bytebites In Delphi mode works correctly. The question is exactly that. Why works correctly in Delphi Mode and fails in FPC mode? What's the difference between both modes?
That means you WILL have a duplicate identifier. You could put EntityList in "private" then they can't see eachother, but if it's a solution for you, I dunno...
edit: in different units they can't see eachother...
Regards Benny
@cdbc I've made this change
TSubject = class
strict private
FEntityList: TEntityList;
procedure SetEntityList(AValue: TEntityList);
public
property EntityList:TEntityList read FEntityList write SetEntityList;
end;
Now theres is no problem at the moment of declare the variables, but now I get the error 'Incompatible type for arg no. 1: Got "TFPGObjectList<project1.TInheritedEntity>", expected "TFPGObjectList<project1.TEntity>".
So I think it is not an issue of visibility but of type assigning.
@marcov, this is only an exercice about Generics writen in Delphi that I wanted to translate to Lazarus to try to aplicate this technique in order to solve a problem in an aplication. I'm not an expert in lazarus, so I'm sure that there will be better solutions to my problem, but that is not the case. What I really want to know is, like I've told before, why the code in Delphi mode works correctly and fails in FPC mode?
Anyway, thanks again to all for your interest