那么如何使用泛型进行正确的声明?
type
TGenericCollectionItem = class;
TGenericCollection<T: TGenericCollectionItem> = class(TObjectList<T>) // line 14
protected
procedure Notify(const Value: T; Action: TCollectionNotification); override;
end;
TGenericCollectionItem = class
public
Owner: TGenericCollection<TGenericCollectionItem>;
end;
[dcc32错误] Project1.dpr(14):E2086类型'TGenericCollectionItem'尚未完全定义