microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
719 stars 242 forks source link

AS0022 raises errors for obsolete objects/procedures #7718

Open nicolassaleron opened 2 months ago

nicolassaleron commented 2 months ago

1. Describe the bug

AS0022 raises an error when the scope of an object or a procedure changes, even if the element as been marked as obsolete in the previous version.

The exact error is: error AS0022: The external scope in '***' cannot be removed or changed to 'internal' because it will break dependent extensions. Note that adding an access modifier ('local', 'protected', or 'internal') overrides the argument in 'Scope'.

To bypass the error, you just have to change the name of the procedure or the name+id of the object. It is not really consistant. This is a revival of a previous bug: https://github.com/microsoft/AL/issues/5870

2. To Reproduce See: https://github.com/microsoft/AL/issues/5870

3. Expected behavior We should be able to change the scope of something marked obsolete. Of course it can break extensions, but as we are allowed to remove the element, the point is not relevant.

4. Actual behavior AS0022 seems to ignore obsolete attributes.

5. Versions:

NKarolak commented 2 months ago

Related open issue, but about setting enums to internal: #7700.