pascalabcnet/TestSuite/implicitexplicit11.pas
Ivan Bondarev 12b365650f #2398
#2396
2021-01-08 19:00:40 +01:00

25 lines
345 B
ObjectPascal

var i: integer;
type
t0 = class end;
t1 = class
static function operator implicit<T>(o: T): t1;
where T: record;
begin
i := 1;
end;
static function operator implicit(o: t0): t1;
begin
i := 2;
end;
end;
procedure p1(q: t1) := exit;
begin
p1(new t0);
assert(i = 2);
end.