pascalabcnet/TestSuite/generics40.pas

22 lines
274 B
ObjectPascal
Raw Permalink Normal View History

2020-08-16 20:23:58 +03:00
var i: integer;
type
t1<T> = class;
t0 = class
public function f1<T>: t1<T> := nil;
end;
t1<T> = class(t0) end;
procedure p1<T>(q: t1<T>);
begin
Inc(i);
end;
procedure p1(q: t0) := p1(q.f1&<byte>);
begin
p1(new t0);
assert(i = 1);
end.