pascalabcnet/TestSuite/generics56.pas
2021-08-29 12:22:33 +02:00

20 lines
279 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var i: integer;
type
t1 = class
// Обязательно НЕ виртуальный метод
procedure p1(x: integer);
begin
i := x;
end;
end;
procedure p0<T>(a: T);
where T: t1;
begin
a.p1(1);
end;
begin
p0(new t1);
assert(i = 1);
end.