Wrong reporting of AL0757 and AL0758
1. Describe the bug When a global variable and a procedure named _operator and Operator both exist in the same codeunit, error AL0757 and warning AL0758 are reported because the two members are detected as having the same name, even though it is different. Does not happen with other names from my limited testing.
2. To Reproduce Steps to reproduce the behavior:
1 - Create a new project and add a codeunit containing the following code:
codeunit 50136 Example
{
procedure NotOperator(): Integer
begin
exit(this._notOperator);
end;
procedure Operator(): Integer
begin
exit(this._operator);
end;
var
_operator: Integer;
_notOperator: Integer;
}
2 - Try to compile the project
3. Expected behavior The codeunit compiles without issues
4. Actual behavior Error AL0757 is reported at the _operator variable declaration, and warning AL0758 is reported at the Operator procedure declaration. The same happens if names are inverted (procedure name is prepended with underscore and variable name is not), but does not seem to happen with other names (see the NotOperator and _notOperator example in the snippet).
5. Versions:
- AL Language: 16.0.1826476
- Visual Studio Code: 1.104.3
- Business Central: 26.4.37194.37992
- List of Visual Studio Code extensions that you have installed:
- Operating System:
- [x] Windows
- [ ] Linux
- [ ] MacOS
Internal work item: AB#610053