I was trying to compile code with overloaded properties:

MyClass = class
  function GetX(idx: integer): integer;
  function GetX(idxStr: string): integer;
public
  property X[ id : integer] : integer read GetX;
  property X[ id : string] : integer read GetX;
end;

I got the 'duplicate X' error. I googled and found that previously this should compile with {$mode delphi} (a google hit from before 2011). However setting mode delphi resulted in the same error.

Digging around in the compiler code and the repository I found SVN rev 19564 which was responding to Mantis 20580. I verified that the lines removed from symtable.pas:tObjectSymtable.checkduplicate lines 1298 - 1301 seem to have been the same code that allowed overloaded properties in Delphi mode (I stuck them back in and I was able to compile my overloaded properties code).

So the question is:

Mantis 20580 & SVN 19564 are about duplicate symbols but not overloaded properties in particular. However overloaded properties in mode Delphi appear to have gone away with that change. Was this intentional? (I tried to find discussion on this and couldn't).

I guess the other question would be if I am right that overloaded properties in mode delphi don't work since that change.

This is not critical to my work just something I ran across and wanted to get some clarification. I saw several discussions that indicated that overloaded properties are not available for objfpc (and not intended to be available). But I couldn't find anything recent about whether it was still intended to be available for mode delphi.

Thanks
David Jenkins



_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to