Is this a bug? Compiles ok, Bar is my local TFont class
Is this a bug? Compiles ok, Bar is my local TFont class
uses FMX.Graphics;
type
TFont=class
end;
procedure Foo(const Bar:FMX.TFont); // <-- My local font? FMX.Graphics.TFont?
begin
end;
uses FMX.Graphics;
type
TFont=class
end;
procedure Foo(const Bar:FMX.TFont); // <-- My local font? FMX.Graphics.TFont?
begin
end;
Is your unit name "FMX" ? :)
ReplyDeleteAdd a property to your local TFont class and try to access it from "Foo"
Possibly a bug, because this does not compile:
ReplyDeleteunit unit2;
interface
implementation
uses
FMX.Graphics;
type
TFont = class
end;
procedure Foo(const Bar: FMX.TFont);
begin
Bar.Family := 'Courier New';
end;
end.
wait, this is better:
ReplyDeleteprocedure Foo(const Bar: FMX.Graphics.TFont);
OK, maybe I begin to understand what you mean.
ReplyDeleteFMX.TFont does not exist, Ctrl-Click jumps to local TFont, even if TFont has underlined in red. Is FMX the default namespace?
Gustav Schubert no, just a unit1
ReplyDeleteDavid Berneda If you right click on FMX.TFont and go to find declaration what do you get?
ReplyDeleteIf you comment out the declaration of the local TFont, then a Control-Click on the TFont part of FMX.TFont goes to FMX.Graphics.TFont. The Control-Click tries to be clever when it should help you. This is an old feature, not a bug. A new feature could override the old feature, but I don' think it is on the roadmap. First, they will get rid of the red underline, because it was requested here earlier.
ReplyDeleteCtrl+click might not be a bug, the that the compiler compiles ok is very suspicious
ReplyDeleteI get TFont listed as the first code completion suggestion when I enter a dot after FMX in the paramter list of the procedure. In the body of the method I get Graphics as a suggestion. It is a bug. Code completion should not suggest TFont, compiler should not compile FMX.TFont. Ctrl-Click should not jump anywhere. And I should not try to make hidden jokes about it. But the red underline is ok! :)
ReplyDelete