unit vectors; {$MODE OBJFPC} interface type generic TVector = class var public X : T; Y : T; constructor Create(aX, aY : T); end; TIntegerVector = specialize TVector; implementation constructor TVector.Create(aX, aY : T); begin Self.X := aX; Self.Y := aY; end; procedure Test; var v : TIntegerVector; begin v := TIntegerVector.Create(1, 2); end; initialization end.