pascalabcnet/TestSuite/generics44.pas
Ivan Bondarev 2bf21fb8aa #2395
2021-01-10 11:46:11 +01:00

20 lines
323 B
ObjectPascal
Raw Permalink 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.

type
// Не обязательно auto класс, я добавил только ради конструктора
t0 = auto class
f: byte;
end;
procedure p1<T>(o: T); where T: t0;
begin
assert(o.f = 123);
var p := procedure->
begin
var o2 := o;
end;
end;
begin
p1(new t0(123));
end.