type
generic gTestGeneric < T > = class ( TObject )
SomeField: T;
procedure CreateField;
end;
TTestObj1 = class( TObject )
constructor Create( abc: String );
end;
TTestObj2 = class( TObject )
constructor Craete( abc: String ); // Some typo
end;
TTestGeneric1 = specialize gTestGeneric <TTestObj1>;
TTestGeneric2 = specialize gTestGeneric <TTestObj2>;
implementation
procedure gTestGeneric.CreateField;
begin
SomeField:= T.Create( 'abc' ); // Error here without telling which specialization caused the problem (In this case TTestObj2)
end;
...