[lazarus] Strange compiler behaviour

Marc Weustink weus at quicknet.nl
Wed Oct 27 19:36:28 EDT 1999


I get the following messages

  Compiling ./lcl/menus.pp
  menus.pp(73,47) Error: Identifier not found TMENUITEM
  menus.pp(73,47) Error: Type identifier expected
  menus.pp(73,59) Error: Illegal symbol for property access
  menus.pp(74,32) Error: Identifier not found TMENUITEM
  menus.pp(74,32) Error: Type identifier expected
  menus.pp(74,46) Error: Illegal symbol for property access

when compiling:

  TMenuItem = class(TWinControl) //TComponent
  private
    FItems: TList;
    FShortCut: TShortCut;	
    FOnClick: TNotifyEvent;
    function GetCount: Integer;
    function GetItem(Index: Integer): TMenuItem;   <-- OK
    function GetParent: TMenuItem;   <-- OK
  protected
  public
    procedure Add(Item: TMenuItem);
    constructor Create(AOwner: TComponent); override;
    procedure Delete(Index: Integer);
    procedure Insert(Index: Integer; Item: TMenuItem);   <-- OK
    procedure Remove(Item: TMenuItem);   <-- OK
    procedure Show; override;
    property Count: Integer read GetCount;
    property Handle: HMenu read GetHandle;
    property Items[Index: Integer]: TMenuItem read GetItem; default; <--
NOT OK  
    property Parent: TMenuItem read GetParent;  <-- NOT OK !!
  end;

It seems that TMenuItem is ok for vars and functions, but not for
properties ???
adding the line 
  TMenuItem = class; 
before the definition wil solve the problem, but it shouldn't be needed.

Marc 






More information about the Lazarus mailing list