I try to learn to use generics properly.<br>First, this is a class definition without generics:<br><br> TMyDerived = class(TObjectList)<br> private<br> MyInt: integer;<br> public<br> constructor Create(FreeObjects: Boolean=True);<br>
end;<br><br>It works. Now I try to derive a class with generics:<br><br> TMyGen = specialize TFPGObjectList<TControl>;<br><br> TMyDerived = class(TMyGen)<br> private<br> MyInt: integer;<br> public<br> constructor Create(FreeObjects: Boolean=True);<br>
end;<br><br>It says:<br> unit1.pas(40,24) Error: Duplicate identifier "FreeObjects"<br><br>Why? If I change "FreeObjects" to "aFreeObjects" then it works. Again why?<br><br>Is it even ok to derive classes from specialized classes like that?<br>
<br>Juha<br><br>