Wrong hint for indexed properties
Original Reporter info from Mantis: eugeneloza @EugeneLoza
-
Reporter name:
Original Reporter info from Mantis: eugeneloza @EugeneLoza
- Reporter name:
Description:
When we have some indexed property like property V[Index: Integer]: TObject read GetV;
then typing V.
shows hint for TObject, while this is a error. E.g. Code Tools sees V.ClassName
as valid syntax (both hints such syntax with code completion and allows "ctrl+click" to jump to the definition), but the FreePascal compiler returns an error Error: Wrong number of parameters specified for call to "GetV"
. See "SimpleCase" example attached.
While this is a minor issue, it becomes more confusing when the name is overloaded in the children classes. See "ComplexCase" example attached. E.g. in case we have a function V: TSomeValue;
in a child class, we receive the wrong hint for the indexed property in the parent class instead of a valid hint for the function in child class. On the other hand FreePascal compiler handles this issue correctly and calling TChildClass.V
unambiguously calls function V
.
Steps to reproduce:
Create a simple program and a class TA with an indexed property V. Start typing TA.V. in the code and receive an invalid hint/completion.
You may also use the attached SimpleCase and ComplexCase examples. Address the line WriteLn(C.V.ClassName); which is seen as valid in Lazarus but returns an error when compiled or try to type C.V. to see the wrong hint / completion suggestion.
Additional information:
Free Pascal Compiler version 3.3.1-r43151 [2019/10/08] for x86_64
Mantis conversion info:
- Mantis ID: 36189
- OS: Debian Linux
- OS Build: 10.1
- Build: 62005M
- Platform: AMD 64 bit
- Version: 2.1 (SVN)
- Monitored by: » @EugeneLoza (eugeneloza)