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
744 stars 245 forks source link

CodeCop : AA0008 warning allows use and execution of OnPrem functions in BC sandbox #5114

Closed JuricaB closed 5 years ago

JuricaB commented 5 years ago

Describe the bug Warnings raised by compiler rule AA0008 can hide errors, allowing an app to compile that should not normally compile.

To Reproduce Steps and to reproduce the behavior:

  1. Start a new project, set target Extension, turn on CodeCop
  2. Create page based on T36 Sales Header
  3. Add any trigger/function.
  4. In code call CheckItemAvailabilityInLines;
  5. AA0008 reports warning "You must specify open and close parenthesis..."
  6. Add parentheses
  7. Warning transforms to error AL0296 - function is marked as internal in T36
page 50000 Test
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Administration;
    SourceTable = "Sales Header";

    trigger OnAfterGetCurrRecord()
    begin
        CheckItemAvailabilityInLines;
    end;
}

page 50000 Test
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Administration;
    SourceTable = "Sales Header";

    trigger OnAfterGetCurrRecord()
    begin
        CheckItemAvailabilityInLines();
    end;
}

Expected behavior I expect errors to be raised as higher priority than warnings, warnings should never overrule the errors.

Versions:

atoader commented 5 years ago

Hi @JuricaB ! We will investigate this as soon as possible.

In the last months, we have been hard at work on the next release of the developer tools. You can read Freddy's blog post to find out more https://freddysblog.com/2019/07/31/preview-of-dynamics-365-business-central-2019-release-wave-2/ . Let us know what you think and especially if you still encounter this issue.

JuricaB commented 5 years ago

HI @atoader,

This is still an issue with Wave 2 - replicated on 4.0.182565.

Furthermore, the error is somewhat worse than I thought, as it also allows you to use functions marked as OnPrem in bc sandbox docker. See below, screenshots taken on new 15.0 docker: image image

EDIT: Just realized AA0008 is no longer showing (on 4.0.182565) for this example at all.

qutreson commented 5 years ago

Hi @JuricaB, thank you for reporting this issue. This appears to be a duplicate of #5191. Feel free to contribute on the related issue.