AL icon indicating copy to clipboard operation
AL copied to clipboard

CodeCop: Rule AA0139 does not trigger for array elements

Open hemisphera opened this issue 3 years ago • 0 comments

1. Describe the bug The rule AA0139 (possible text overflow) does not trigger when the value that exceeds the length is an element of an array.

2. To Reproduce See the code below:

    local procedure ParentFunction()
    var
        ValueOne: Code[20];
        ValueTwo: Code[40];
        Values: array [20] of Text;
    begin
        ChildFunction(ValueOne); // warning AA0139 is not issued - correct
        ChildFunction(ValueTwo); // warning AA0139 is issued - correct
        ChildFunction(Values[1]); // warning AA0139 is NOT issued - NOT correct
    end;

    local procedure ChildFunction(Code: Code[20])
    begin
    end;

3. Expected behavior The rule should trigger if the array elements are of larger size

4. Actual behavior The rule should trigger.

5. Versions:

  • AL Language: v10.0.673593
  • Visual Studio Code: 1.71.2

hemisphera avatar Sep 22 '22 16:09 hemisphera