AL icon indicating copy to clipboard operation
AL copied to clipboard

AddBefore + AddAfter endless loop causes the compiler to become unresponsive

Open tinestaric opened this issue 4 months ago • 0 comments

Please include the following with each issue:

1. Describe the bug When you create an endless loop with two page extensions using AddBefore and AddAfter, the compiler stops responding.

This happened because Base page had two actions Action1 Action2

first developer extracted action1 to a page extension using AddBefore(Action2) { Action1 }

The second developer extracted action2 as

AddAfter(Action1) { Action2 }

When the second solution was merged in, the compiler was no longer responsive and didn't report any issues or was able to compile the solution.

2. To Reproduce

Create two page extensions that cause a loop with AddBefore/AddAfter

pageextension 50000 MyExt1 extends "Posted Purchase Invoice"
{
    actions
    {
        addbefore(Action2)
        {
            action(Action1) { }
        }
    }
}

pageextension 50001 MyExt2 extends "Posted Purchase Invoice"
{
    actions
    {
        addafter(Action1)
        {
            action(Action2) {}
        }
    }
}

Note: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.

3. Expected behavior The compiler should report this as an error instead.

4. Actual behavior a Compiler becomes unresponsive, the workspace never loads in VSC, and a call to alc.exe never finishes.

5. Versions:

  • AL Language: v15.2.1630495
  • Visual Studio Code: 1.103.1
  • Operating System:
    • [x] Windows
    • [ ] Linux
    • [ ] MacOS

Final Checklist

Please remember to do the following:

  • [ ] Search the issue repository to ensure you are reporting a new issue

  • [ ] Reproduce the issue after disabling all extensions except the AL Language extension

  • [ ] Simplify your code around the issue to better isolate the problem

tinestaric avatar Aug 18 '25 10:08 tinestaric