以下に基本クラスのテスト定義があります
type
Tinfo = procedure of object;
Test = class(TObject)
public
procedure Add ( const a : Tinfo ); reintroduce ;
end;
procedure Test.Add(const a: Tinfo);
begin
Writeln('base class add function');
// dosomething more
end;
そして、この基本クラスから派生したジェネリック クラスがあります。
TTesting<T> = class(Test)
public
procedure Add ( const a : T ); reintroduce ;
end;
型キャストT
してTinfo
いますが、エラーが発生します
procedure TTesting<T>.Add(const a : T );
begin
inherited Add(Tinfo(a) ); // gives me error here
end;
これを実装する方法はありますか?