Am 12.08.2016 16:52 schrieb "Luca Olivetti" <l...@ventoso.org>:
>
> I'm still using fpc 2.6.4 (but I tested what I'm saying below with fpc
3.0.0 too).
>
> I need to overload the type of the index of an indexed property, e.g.
>
> function GetMyProp(index:integer):TMyPropType;
> function GetMyProp(index:TMyType):TMyPropType;
> ....
> property MyProp[index:integer]:TMyPropType read GetMyProp;
> property MyProp[index:TMyType]:TMyPropType read GetMyProp;
>
>
> this gives a "Duplicate identifier" error.
>
> I found previous discussions about this error and
http://bugs.freepascal.org/view.php?id=29056
>
> *but* if I omit the second property declaration, the code compiles fine
and I can use MyProp indexed either by an integer or by TMyType.
>
> Is this by design or is it just an accident?

Accident.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to