pascalabcnet/TestSuite/opImplicit.pas
Ivan Bondarev 22f46b4a01 #1981
2021-01-06 20:47:39 +01:00

14 lines
243 B
ObjectPascal

type
t1<T> = class
o: T;
constructor(o: T);
begin
self.o := o;
end;
static function operator implicit(o: T): t1<T> := new t1<T>(o);
end;
begin
var a: t1<string> := 'abcde';
Assert(a.o = 'abcde');
end.