AL icon indicating copy to clipboard operation
AL copied to clipboard

MissingTypeSymbol in Test Libraries

Open achim-t opened this issue 6 years ago • 16 comments

Describe the bug Test Libraries apparently don't include necessary symbols anymore. As far as I can see all procedures with a record as parameter are affected.

To Reproduce

  1. Create a docker container from "mcr.microsoft.com/businesscentral/sandbox:us" using NavContainerHelper with -includeTestToolkit and -includeTestLibrariesOnly.
  2. Create new project (code see below).
  3. Compile
  4. error AL0133: Argument 1: cannot convert from 'Record "Sales Header"' to 'var __MissingTypeSymbol__'
pageextension 50100 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    var 
        LibrarySales: Codeunit "Library - Sales";
        SalesHeader: Record "Sales Header";
    begin
        LibrarySales.CreateSalesInvoice(SalesHeader);
    end;
}

Expected behavior Should compile without error.

5. Versions:

  • AL Language: 4.0.209944
  • Business Central: 15.3 (Platform 15.0.39447.0 + Application 15.3.39470.0)

The last version where this worked was 15.3.39275.0-us.

achim-t avatar Jan 02 '20 13:01 achim-t

We are running into the same issue when trying to compile apps that use the test libraries on the next minor and next major version of BC.

rvanbekkum avatar Jan 06 '20 09:01 rvanbekkum

Hi! It looks like you are using a preview version of the platform 15.3 with the version of the VSIX that is available from the marketplace. You should be using the version of the VSIX that comes on the Docker image. Could you try using that one and let us know if you are still facing the problem?

atoader avatar Jan 07 '20 05:01 atoader

The VSIX from that docker image has the same version number, the error persists.

I am seeing the error in my build pipelines as well, the compiler used there is extracted from the respective image.

achim-t avatar Jan 07 '20 07:01 achim-t

In the latest minor/major releases the issue is no longer present.

achim-t avatar Jan 14 '20 14:01 achim-t

In the latest minor/major releases the issue is no longer present.

Which versions? We're still experiencing this problem in both bcinsider.azurecr.io/bcsandbox and bcsandbox-master

AL Compiler version 4.0.3.24415 (although the in the container is al-4.0.221017) for bcsandbox AL Compiler version 5.0.3.22698 for bcsandox-master

jimmymcp avatar Jan 20 '20 14:01 jimmymcp

AL Compiler version 4.0.3.24415 (although the in the container is al-4.0.221017) for bcsandbox AL Compiler version 5.0.3.22698 for bcsandox-master

Those exact versions worked for me.

achim-t avatar Jan 20 '20 14:01 achim-t

We are also running into the issue with the following AL compiler version (4.0.3.25368):

buildExample

Results in:

error AL0133: Argument 1: cannot convert from 'Record "Sales Line Discount"' to 'var __MissingTypeSymbol__'

rvanbekkum avatar Jan 21 '20 09:01 rvanbekkum

It looks like it might be standard methods that take a var record parameter (which of course a lot of the test library methods are). Calling var record parameters in our own app compiles as expected.

jimmymcp avatar Jan 22 '20 10:01 jimmymcp

Hello!

Any news regarding this issue? We are also running into it on latest bcsandbox-master container (16.0.10855.0).

Download symbols: image

Compiling with AL Compiler version 5.0.3.22698 results in: image

MatjazSega avatar Jan 30 '20 11:01 MatjazSega

As far as we know, the issue has been fixed. Can you please provide a full repro?

atoader avatar Feb 01 '20 14:02 atoader

I had several repos build overnight which:

  • failed against bcinsider.azurecr.io/bcsandbox - with the same errors that we've been discussing
  • passed against bcinsider.azurecr.io/bcsandbox-master

Don't know if you're seeing the same results @MatjazSega?

@atoader what more info would you need for a repro? Can you compile code which calls a function with a var Record parameter in a container built from bcinsider.azurecr.io/bcsandbox?

jimmymcp avatar Feb 03 '20 09:02 jimmymcp

@atoader I have created a new container from bcinsider.azurecr.io/bcsandbox-master (16.0.10961.0) and with compiler version 5.0.3.31592 our project builds successfully. It seems that new master version solved the issue. Thanks!

@jimmymcp I have also created a new container from bcinsider.azurecr.io/bcsandbox:latest (15.4.40515.0) and with compiler version 4.0.3.29696 successfully built our project. I am not sure if this changed recently, because we have been using 15.2 version and had no issues.

MatjazSega avatar Feb 03 '20 13:02 MatjazSega

Hi, we are still struggling with this problem. This is the output from a build that I've just done against mcr.microsoft.com/businesscentral/sandbox.

Our main app compiles OK, but compiling the test app fails on test library functions that take var Record parameters. The same

Microsoft (R) AL Compiler version 4.0.3.34752 Copyright (C) Microsoft Corporation. All rights reserved

Compilation started for project 'Clever Handheld for Warehousing Tests' containing '22' files at '12:58:18.769'.

C:\ProgramData\NavContainerHelper\9d975bb3-9517-4671-a3f1-7023fec2eb7c\Tests\Cod9059379.SetupSubscriberCHHWTMN.al(6,48): error AL0284: The type of the parameter 'Customer' on the event subscriber 'OnAfterCreatedCustomer' does not match the expected type 'MissingTypeSymbol'. C:\ProgramData\NavContainerHelper\9d975bb3-9517-4671-a3f1-7023fec2eb7c\Tests\Cod9059379.SetupSubscriberCHHWTMN.al(21,45) : error AL0284: The type of the parameter 'Vendor' on the event subscriber 'OnAfterCreateVendor' does not match the expe cted type 'MissingTypeSymbol'. C:\ProgramData\NavContainerHelper\9d975bb3-9517-4671-a3f1-7023fec2eb7c\Tests\Cod9059379.SetupSubscriberCHHWTMN.al(35,43) : error AL0284: The type of the parameter 'Item' on the event subscriber 'OnAfterCreateItem' does not match the expected type 'MissingTypeSymbol'. C:\ProgramData\NavContainerHelper\9d975bb3-9517-4671-a3f1-7023fec2eb7c\Tests\Cod9059379.SetupSubscriberCHHWTMN.al(41,56) : error AL0284: The type of the parameter 'Item' on the event subscriber 'OnAfterCreateItemManufacturing' does not match the expected type 'MissingTypeSymbol'.

Compilation ended at '12:59:10.147'.

Am I doing something wrong?

jimmymcp avatar Mar 03 '20 14:03 jimmymcp

Update: rebuilding the same code against mcr.microsoft.com/businesscentral/sandbox:15.2.39558.39825-w1-ltsc2016 works.

Building against bcinsider.azurecr.io/bcsandbox-master:latest-ltsc2016 also works.

Building against these current images does not work

  • mcr.microsoft.com/businesscentral/sandbox
  • bcinsider.azurecr.io/bcsandbox

😟

jimmymcp avatar Mar 05 '20 09:03 jimmymcp

Hi @jimmymcp! I think the issue is resolved, but there might still be a problem with your build system. Are you downloading the following packages when building on 15.3 and later?

  • "System"
  • "System Application"
  • "Base Application"
  • "Application"

atoader avatar Apr 02 '20 09:04 atoader

Hi @atoader,

Yes that was the resolution, thanks for your help. Now that we are downloading the Application symbols the builds are working again 👍

jimmymcp avatar Apr 02 '20 09:04 jimmymcp