{$Mode ObjFPC}{$H+} type TBase = class public function Foo:Integer;virtual;abstract; end; generic TTest = class(T) public end; generic TTest2 = class(specialize TTest) public function Foo:Integer;override; end; function TTest2.Foo:Integer; begin Result:=42; end; var b: TBase; begin b:=specialize TTest2.Create; if b.Foo<>42 then Halt(1); WriteLn('Ok'); end.