pascalabcnet/TestSuite/implicitInInit.pas

16 lines
263 B
ObjectPascal
Raw Normal View History

2020-03-31 11:05:32 +03:00
type
MyString = class
public
d: string;
static function operator implicit(s: string): MyString;
begin
Result := new MyString;
Result.d := s;
end;
end;
begin
var s: MyString := 'abcde';
Assert(s.d = 'abcde');
end.