AppSourceCop fails on AS0004 change from __MissingTypeSymbol__ to X
1. Describe the bug AppSource fails when compiling against my version. I suspect it has to do with usage of implicit namespaces with AppSourceCop compiles for the object change type.
2. To Reproduce Steps to reproduce the behavior:
- Create a simple AL-project with AppSourceCop enabled and using a Base-app enum (or other type in the Base-app).
- Compile the version
- Move the compiled version to AppSourceCop folder
- Recompile
3. Expected behavior AppSourceCop to succeed, since I have made no breaking change to the AL-project.
4. Actual behavior Compilation fails with the following error:
MyTable.Table.al(12,18): error AS0004: Field 'Document Type' has changed type from '__MissingTypeSymbol__' to 'Enum Microsoft.Sales.Document."Sales Document Type"'. Type changes are not allowed.
5. Versions:
- AL Language: 14.1.18.1238
- Visual Studio Code: 1.94.0
- Business Central: 24.5
- List of Visual Studio Code extensions that you have installed:
- Operating System:
- [x] Windows
- [ ] Linux
- [ ] MacOS
Final Checklist
Please remember to do the following:
-
[x] Search the issue repository to ensure you are reporting a new issue
-
[x] Reproduce the issue after disabling all extensions except the AL Language extension
-
[x] Simplify your code around the issue to better isolate the problem
Additional information
I have created the following example: https://github.com/joandrsn/AppSourceCop-Example
The example should be able to reproduce the error by simply compiling. I have done step 1-3 of the reproduce steps. The error may be caused by the project not using namespaces and utilizing the base-app objects. I am open to suggestions how to fix the issue, however, this example is rather small. In our actual project, we have 22 warnings and 86 errors.
We have a similar problem when running Run-ALCops for our app, but with a table extension that hasn’t been changed for several releases. The issue only occurs on version 23; it does not occur on higher versions of Business Central.
##[error]./C:/ProgramData/BcContainerHelper/e739898c-0903-4e6c-a952-9c7241ecd6db/src/src/tableextension/XXXSourceCodeSetup.TableExt.al(1,25): error AS0068: The target table of table extension 'XXX Source Code Setup' has changed from 'MissingTypeSymbol' to 'Source Code Setup'. Changing the target of a table extension that has been published is not allowed, because this might break the upgrade of existing installations.