AL
AL copied to clipboard
AA0198 is not reported for return variables of procedures
1. Describe the bug The AA0198 warning is not issued for local/internal/public return variables of procedures that have the same name as global variables.
2. To Reproduce Create a (local/internal/public) procedure with a named return variable and a global variable with the same name.
codeunit 50100 MyCodeunit
{
var
result: Boolean;
procedure DoNotUseIdenticalNamesForLocalAndGlobalVariables() result: Boolean
begin
if result = false then
result := true;
end;
}
3. Expected behavior Rule AA0198 should be displayed as a warning.
codeunit 50100 MyCodeunit
{
var
result: Boolean;
procedure DoNotUseIdenticalNamesForLocalAndGlobalVariables() result: Boolean // AA0198: The name of the local variable 'result' is identical to a global variable.
begin
if result = false then
result := true;
end;
}
4. Actual behavior Rule AA0198 is not displayed as a warning.
5. Versions:
- AL Language: v13.0.1007491
- Visual Studio Code: Version: 1.89.0 (user setup) Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd Date: 2024-05-01T02:09:22.859Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631
- Business Central: N/A
- List of Visual Studio Code extensions that you have installed:
- ms-dynamics-smb.al