Why are TGeneric<Base> and TGeneric<Descendant> incompatible types?
问题 I have started using of generics in Delphi 2010 but I have a problem when compiling this piece of code: TThreadBase = class( TThread ) ... end; TThreadBaseList<T: TThreadBase> = class( TObjectList<T> ) ... end; TDataProviderThread = class( TThreadBase ) ... end; TDataCore = class( TInterfacedObject, IDataCore ) private FProviders: TThreadBaseList<TDataProviderThread>; ... end; Then I have some nested procedure: procedure MakeAllThreadsActive(aThreads: TThreadBaseList<TThreadBase>); begin ...