AL icon indicating copy to clipboard operation
AL copied to clipboard

Unexpected warning AS0098 when adding an enumextension to an enum within the same AppSource app

Open Jeeve65 opened this issue 1 year ago • 2 comments

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:

  1. Create a new app.

  2. In app.json, define an id range within the AppSource area:
    "idRanges": [ { "from": 74000000, "to": 74000000 } ],

  3. Enable code analysis and the "${AppSourceCop}" analyzer

  4. In the app folder, create a file AppSourceCop.json containing:
    { "mandatoryPrefix":"YYY" }

  5. 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:

  • 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

Jeeve65 avatar Apr 11 '24 07:04 Jeeve65

Looks like a bug

BazookaMusic avatar Apr 11 '24 14:04 BazookaMusic

By the way, BcContainerHelper's Run-ALValidation reports this issue as AS0011

Jeeve65 avatar Apr 12 '24 14:04 Jeeve65