Hi.
The docs for 3.0 does not directly mention generics and inheriting from another generic class, but I tried out with the code below. It compiled, ran and worked fine but since the docs do not explicit mention it as a posibility I am a little reluctant to go forward using this strategy if is not meant to work...
(ps. i know this is incomplete code, but it should illustrate my point)type
type
{ TMyType }
generic TMyType<T> = class
private
Item: T;
public
constructor Create; virtual;
end;
{ TMyDerivedType }
generic TMyDerivedType<T> = class(specialize TMyType<T>)
private
Count: Integer;
public
constructor Create; override;
end;
TMyIntClass = specialize TMyDerivedType<Integer>;[...snipped both Create implementations...]
var
IC: TMyIntClass;
begin
M := TMyIntClass.Create();
M.Item := 20;
M.Count := 2;
M.Free;
end;