Interesting bug in IDE (2009+)

Interesting bug in IDE (2009+)
Type length)( in editor

Comments

  1. Jacek Laskowski indeed. That has been the Delphi build path since about 20 years.

    ReplyDelete
  2. No ,it's not a bug , because length is used as a macro for constant , and as a pure function for variable.

    The same applies for "sizeof",except its a pure macro.

    eg:
    var
      Str: string;
      L, sz: Integer;
    begin
      Str := '123';
      L := Length(Str);
      L := Length('123');
      Length('123'); // Error.
      sz := sizeof(Str);
      sizeof(Str); // Error.
    end;

    ReplyDelete
  3. This works fine too, so the context must be more confined:

    unit Unit1;

    interface

    implementation

    procedure Foo();
    begin
      length)(
    end;

    end.

    ReplyDelete

Post a Comment