pascalabcnet/TestSuite/implicitexplicit8.pas

15 lines
247 B
ObjectPascal
Raw Permalink Normal View History

2021-01-07 22:31:51 +03:00
var o: System.Type;
type
t1 = class
static function operator implicit<T>(val: T): t1;
begin
o := typeof(T);
end;
end;
t2<T> = class end;
begin
var a: t1 := new t2<integer>;
assert(o = typeof(t2<integer>));
end.