fpc/tests/tbs/tb0620.pp
2016-06-03 21:45:23 +00:00

28 lines
498 B
ObjectPascal

{ %NORUN }
program tb0620;
type
generic TTest<T, S> = object
procedure Test(aArg: T; aArg2: S);
end;
procedure TTest.Test(aArg: T; aArg2: S);
begin
Delete(aArg, aArg2, 4);
Insert('Test', aArg, aArg2);
Writeln(aArg);
end;
type
TTestShortString = specialize TTest<ShortString, LongInt>;
TTestUnicodeString = specialize TTest<UnicodeString, LongInt>;
var
tss: TTestShortString;
tus: TTestUnicodeString;
begin
tss.Test('Hello World', 3);
tus.Test('Hello World', 4);
end.