This is the problem of the lack of support for Co- and Contravariance in Delphi. However, if you know that you are performing operations that are covariant (i.e., repeating items in a list), you can simply drag and drop TList<MyType> to TList<TObject> , given that MyType inherits from TObject .
Taking the example from the Wikipedia article, you can treat the list of cats as a list of animals, when you just go in cycles and read their names or something like that.
But you have to be careful with actions that require contravariance (i.e. adding elements).
Again, an example, you cannot put a dog in the list of animals, because in fact the list is a list of cats.
Stefan glienke
source share