Overloaded default properties
Original Reporter info from Mantis: marco @marcoonthegit
-
Reporter name: Marco van de Voort
Original Reporter info from Mantis: marco @marcoonthegit
- Reporter name: Marco van de Voort
Description:
Since D2005 (D8?) Delphi supports overloading of the default property
Additional information:
program overprop;
{$ifdef fpc}
{$mode delphi}
{$else}
{$apptype console}
{$endif}
type
TTestClass = class
private
function GetInts(index: Integer): Integer;
procedure SetInts(index: Integer; const Value: Integer);
function GetIntsS(Find: string): Integer;
procedure SetIntsS(Find: string; const Value: Integer);
public
property Ints[index: Integer]: Integer read GetInts write SetInts;
default;
property Ints[Find: string]: Integer read GetIntsS write SetIntsS;
default;
end;
function TTestClass.GetInts(index: Integer): Integer;
begin
end;
procedure TTestClass.SetInts(index: Integer; const Value: Integer);
begin
end;
function TTestClass.GetIntsS(Find: string): Integer;
begin
end;
procedure TTestClass.SetIntsS(Find: string; const Value: Integer);
begin
end;
begin
end.
Mantis conversion info:
- Mantis ID: 15384
- Build: r14378
- Version: 2.5.1
- Monitored by: » jcchu (JC Chu), » kazalex (Kazantsev Alexey), » tangentstorm (michal wallace)