Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when publishing a case with type Joker #7832

Open
gatchrat opened this issue Aug 29, 2024 · 1 comment
Open

Error when publishing a case with type Joker #7832

gatchrat opened this issue Aug 29, 2024 · 1 comment
Labels

Comments

@gatchrat
Copy link

gatchrat commented Aug 29, 2024

Please include the following with each issue:

1. Describe the bug
When creating a switch case on a value of the type joker, the compiler will not throw an error, but publishing the App will.

2. To Reproduce
Steps to reproduce the behavior:

  1. Create a case on a value of Type Joker
procedure Example()
    var
        RecordRef: RecordRef;
        newFieldRef: FieldRef;
    begin

        RecordRef.Close();
        RecordRef.Open(77);
        if RecordRef.FindFirst() then begin
            newFieldRef := RecordRef.Field(3);
            case newFieldRef.Value of
                1:
                    Message('Hello');
            end;
        end;

    end;
  1. Publish

3. Expected behavior
Either the compiler throws an error immediatly, or i can successfully publish.

4. Actual behavior
The compiler throws neither Error nor Warning, but on publish i get:

The request for path /BC/dev/apps?tenant=default&SchemaUpdateMode=synchronize&DependencyPublishingOption=default failed with code UnprocessableEntity. Reason: Failure while emitting method. Object:'Codeunit Example' Method:'Example()' (Unexpected value 'Joker' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.NavTypeKind')
Unexpected value 'Joker' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.NavTypeKind'

5. Versions:

  • AL Language: 13.1.1065068
  • Visual Studio Code: 1.92.2
  • Business Central: DE Business Central 24.4 (Plattform 24.0.23374.0 + Anwendung 24.4.22295.23403)
  • List of Visual Studio Code extensions that you have installed:AL Language

Final Checklist

Please remember to do the following:

  • [ X] Search the issue repository to ensure you are reporting a new issue

  • [ X] Reproduce the issue after disabling all extensions except the AL Language extension

  • [ X] Simplify your code around the issue to better isolate the problem

Internal work item: AB#546897

@BazookaMusic
Copy link

Compilation error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants