AL icon indicating copy to clipboard operation
AL copied to clipboard

AA0205 should fire when not initialized Text and Boolean variables are accessed

Open dannoe opened this issue 2 years ago • 0 comments

1. Describe the bug A compare statement with Text or Boolean variables should trigger the warning AA0205

2. To Reproduce Steps to reproduce the behavior:

var
    MyText: Text; // same for Boolean
    MyTable: Record "Sales Line";
begin
    if MyTable.FindSet() then begin
        repeat
            if MyText = '' then begin // no AA0205 warning, same for Boolean
                MyText:= 'Foo';
            end else begin
                Magic();
                MyText:= 'Bar';
            end;
        until MyTable.Next() = 0;
    end;
end;

3. Expected behavior We should get a warning if we are comparing without initializing the variable. If the variable is of Type Code everything is working as expected an a warning is shown.

4. Actual behavior We do not get the warning AA0205

5. Versions:

* AL Language: v11.0.810452

somewhat related: #7440

dannoe avatar Jun 26 '23 07:06 dannoe