Invalid array property parameters
Original Reporter info from Mantis: ryan_joseph @genericptr
-
Reporter name: Ryan Joseph
Original Reporter info from Mantis: ryan_joseph @genericptr
- Reporter name: Ryan Joseph
Description:
Array properties can be accessed using a wrong number of parameters by leveraging function overloads. This may be desirable for Delphi mode but should be disallowed in ObjFPC mode.
When this behavior is removed it can be replaced with a proper array property overloads patch (which is pending: https://bugs.freepascal.org/view.php?id=35772).
Steps to reproduce:
function GetValue(k0: variant): TJSON; overload;
function GetValue(k0,k1: variant): TJSON; overload;
property Values[key: variant]: TJSON read GetValue; default;
// should work
i := rec[1];
// should not work but currently does
i := rec[1, 2];
Mantis conversion info:
- Mantis ID: 35809
- Version: 3.3.1