AL icon indicating copy to clipboard operation
AL copied to clipboard

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

Open JuricaB opened this issue 7 years ago • 3 comments

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:

  • AL Language: 3.0.145991
  • Business Central: Microsoft_Application_14.1.33107.0 ; Microsoft_System_14.0.32600.33003

JuricaB avatar Jul 08 '19 02:07 JuricaB

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.

atoader avatar Aug 02 '19 14:08 atoader

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.

JuricaB avatar Oct 02 '19 04:10 JuricaB

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

qutreson avatar Oct 18 '19 09:10 qutreson