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;


Comments

  1. Is your unit name "FMX" ? :)
    Add a property to your local TFont class and try to access it from "Foo"

    ReplyDelete
  2. Possibly a bug, because this does not compile:

    unit unit2;

    interface
    implementation

    uses
    FMX.Graphics;

    type
    TFont = class
    end;

    procedure Foo(const Bar: FMX.TFont);
    begin
    Bar.Family := 'Courier New';
    end;

    end.

    ReplyDelete
  3. wait, this is better:
    procedure Foo(const Bar: FMX.Graphics.TFont);

    ReplyDelete
  4. OK, maybe I begin to understand what you mean.
    FMX.TFont does not exist, Ctrl-Click jumps to local TFont, even if TFont has underlined in red. Is FMX the default namespace?

    ReplyDelete
  5. David Berneda If you right click on FMX.TFont and go to find declaration what do you get?

    ReplyDelete
  6. If 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.

    ReplyDelete
  7. Ctrl+click might not be a bug, the that the compiler compiles ok is very suspicious

    ReplyDelete
  8. I 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

Post a Comment