microsoft / microsoft/AL

AL0885 false positive with table and table extension in another repo

Open
#8,253 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
881
Forks
285
Avg merge
3d 36m
Merged PRs (30d)
1

Description

1. Describe the bug
AL0885 shows a false positive with table (here Purchase Line) and table extension (here "Mfg. Purchase Line") are both in another repo and in fact are one table.

The field '"Prod. Order No."' cannot be referenced in this context. You can only reference symbols from the base object 'Purchase Line' and the current extension. This warning will become an error when targeting a runtime with version '18.0' or higher.

2. To Reproduce
Create a new app and add the following object. Review generated diagnostic/problems.

tableextension 50000 "XXX YYY Purchase Line" extends "Purchase Line"
{
    keys
    {
        key(XXXProductionOrder; "Prod. Order No.", "Prod. Order Line No.", "Operation No.")
        {
        }
    }
}

3. Expected behavior
All mentioned key fields reside in Base Application and form the base table Purchase Line. No Warning or future error should be raised.

4. Actual behavior
All mentioned key fields reside in Base Application but are placed in a table and a table extension object, causing the false positive which is wrong.

5. Versions:

  • AL Language: 18.0.2293710
  • Visual Studio Code: 1.118.1
  • Business Central: 27.5
  • Operating System:
    • Windows
    • Linux
    • MacOS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing AL0885 in a new app using the tableextension example and inspect the generated diagnostic in Visual Studio Code. Trace how fields from a base table and its extension in another repo are resolved; done means the listed key fields no longer produce a warning or future error.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.