On 02.11.2015 20:08, Sven Barth wrote:
It's not a general compiler bug, but only in relationship with helpers
(I can't trigger it if I have a class constructed that way without a
helper).
It is a general compiler bug. Not even related to a for-in or anything else.
See:
*program arraypropbug;**
**
**uses**
** sysutils;**
**
**type**
** TObj = class**
** public**
** function GetS(Index: Integer): string; overload;**
** function GetS(Index1, Index2: Integer): Double; overload;**
** property S[Index: Integer]: string read GetS;**
** end;**
**
**{ TObj }**
**
**function TObj.GetS(Index1, Index2: Integer): Double;**
**begin**
** Result := Index1 / Index2;**
**end;**
**
**function TObj.GetS(Index: Integer): string;**
**begin**
** Result := IntToStr(Index);**
**end;**
**
**var**
** o: TObj;**
** d: Double;**
**begin**
** o := TObj.Create;**
** d := o.S[10, 3]; // !!!**
** Writeln(d);**
**end.**
*
Ondrej
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel