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
Unexpected warning AS0098 when adding an enumextension to an enum within the same AppSource app #7714
1. Describe the bug
In a single AppSource app we have an Enum object and an EnumExtension to that Enum. The enumextension adds a new value. Here we get warning AS0098 The identifier 'HasIssue' must have at least one of the mandatory affixes 'YYY' - which does not pop up for values in the original Enum.
2. To Reproduce
Steps to reproduce the behavior:
Create a new app.
In app.json, define an id range within the AppSource area:
"idRanges": [
{
"from": 74000000,
"to": 74000000
}
],
Enable code analysis and the "${AppSourceCop}" analyzer
In the app folder, create a file AppSourceCop.json containing:
{ "mandatoryPrefix":"YYY" }
Create the following objects:
enum 74000000 "YYY AS0098 issue"
{
Extensible = true;
3. Expected behavior
No warning. Since the extension is within the app, and extending a proprietary object, there is no added value to start values with the app prefix.
4. Actual behavior
A warning pops up: The identifier 'HasIssue' must have at least one of the mandatory affixes 'YYY'. AL(AS0098) [Ln 3, Col 14]
5. Versions:
AL Language: v14.0.983287 (pre-release)
Visual Studio Code: 1.88.0 (system setup)
Business Central: 24
List of Visual Studio Code extensions that you have installed: AL, Insert GUID, Powershell
1. Describe the bug In a single AppSource app we have an Enum object and an EnumExtension to that Enum. The enumextension adds a new value. Here we get warning AS0098 The identifier 'HasIssue' must have at least one of the mandatory affixes 'YYY' - which does not pop up for values in the original Enum.
2. To Reproduce Steps to reproduce the behavior:
"idRanges": [ { "from": 74000000, "to": 74000000 } ],
{ "mandatoryPrefix":"YYY" }
Create the following objects: enum 74000000 "YYY AS0098 issue" { Extensible = true;
value(0; "No Issue") { Caption = 'No Issue'; } } enumextension 74000000 "YYY AS0098 issue extension" extends "YYY AS0098 issue" { value(1; HasIssue) { Caption = 'Has Issue'; } }
3. Expected behavior No warning. Since the extension is within the app, and extending a proprietary object, there is no added value to start values with the app prefix.
4. Actual behavior A warning pops up: The identifier 'HasIssue' must have at least one of the mandatory affixes 'YYY'. AL(AS0098) [Ln 3, Col 14]
5. Versions: