为什么这不起作用?我得到一个 E2511 类型参数“T”必须是类类型?
type
IBaseProvider<T> = Interface
function GetAll: TObjectList<T>;
end;
type
TCar = class(TInterfacedPersistent, IBaseProvider<TVehicle>)
function GetAll: TObjectList<TVehicle>;
end;
implementation
function TCar.GetAll: TObjectList<TVehicle>;
begin
// do something with Objectlist
Result := ObjectList
end;