Property overload
Issue #120
new
Does DWScript support property overload? I just can not find a way to overcame this issue in SmartMobileStudio, the compiler will emit 'There is already a property with name "Column" ' Any idea?
TDataColumns = class(TCollection)
private
FDataSet: TDataSet;
function GetColumn(Index: Integer): TDataColumn; overload;
function GetColumn(const Name: String): TDataColumn; overload;
protected
property DataSet: TDataSet read FDataSet;
procedure DoChanging; override;
public
constructor Create(ADataSet: TDataSet); virtual;
property Column[Index: Integer]: TDataColumn read GetColumn; default;
property Column[const Name: String]: TDataColumn read GetColumn; default;
function Add: TDataColumn;
end;
Comments (1)
-
repo owner - Log in to comment
At the moment it is not supported.
Internal notes: - internally this could probably just be mapped to the regular method overload resolution, and generalized (with overload qualifier). - to validate property declaration, the metric of declaration/implementation should be used (ie. strict type match, no inference). - should probably be treated as an error for published properties. - many new tests required.