consider

consider

TBase = class

public const

Snafu = 1;

public type

TInnerBase = class

Foo:Integer;

end;

public

procedure Bar(const Inner:TInnerBase); virtual; abstract;

end;

TDerived = class(TBase)

public

procedure Bar(const Inner:TBase.TInnerBase); override;

end;

procedure TDerived.Bar(const Inner: TBase.TInnerBase);

begin

Inner.Foo := Snafu;

end;

It nags me that I have to qualify TBase.TInnerBase, while I do NOT have to write TBase.Snafu; I wish I could drop the TBase. qualification part for types as well.

4 thoughts on “consider


  1. Lars Fosdal From what Delphi version can we define class constants? I really need them sometimes but I had in my head that delphi has not this feature. Thanks a lot 🙂