Did I find a bug? IsEmpty is a StringHelper and the result of Edit1.Text is a string.
As already said .Text references a getter.
But that shouldn't be a problem because this works too:
function Foo: String;
begin
Result := 'Foo';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Foo.IsEmpty then Exit;
end;
It's the fact the .Text is TCaption which is defined as "
type String" (via TTranslateString).
This also doesn't work:
type
Foo = type String;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Foo.IsEmpty then Exit;
end;
But this works:
type
Foo = String;
procedure TForm1.Button1Click(Sender: TObject);
begin
if Foo.IsEmpty then Exit;
end;
So the fact TCaption is defined as "
type String" (via TTranslateString) is the problem.
If it was defined just "String" it could work.
Question is, why does it have "type" before String ??