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.

Comments

  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 :)

    ReplyDelete
  2. Alex Matveev I'm not sure, but I think they've been in there for a while. XE2 perhaps?

    ReplyDelete
  3. Nice, I will use them. Thanks again.

    ReplyDelete

Post a Comment