pascalabcnet/TestSuite/where8.pas
Бондарев Иван f1049a2b4e bug fix #2108
2019-10-04 13:37:47 +02:00

28 lines
431 B
ObjectPascal

type
t0 = abstract class
function f0: integer; abstract;
end;
t1 = class(t0)
i: integer;
function f0: integer; override := i;
constructor(i: integer) := self.i := i;
end;
function f1<T>: T;
where T: t0;
begin
Result := T(t0(
new t1(10)
));
assert(Result.f0 = 10); // до #1986 было AccessViolationException
end;
begin
f1&<t1>;
// readln;
end.