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

The use of "Name" in a trigger gives compiler exception #4346

Closed
hougaard opened this issue Dec 11, 2018 · 5 comments
Closed

The use of "Name" in a trigger gives compiler exception #4346

hougaard opened this issue Dec 11, 2018 · 5 comments
Labels
ships-in-future-update The issue is fixed in our 'master' branch and will ship in the next PREVIEW release
Milestone

Comments

@hougaard
Copy link
Contributor

image

Not sure what "Name" is :)

[Error - 12:32:31 PM] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible.
Processing of message 'al/createPackage' failed with error: 'Unexpected value 'Property' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.SymbolKind''
Details:
System.InvalidOperationException: Unexpected value 'Property' of type 'Microsoft.Dynamics.Nav.CodeAnalysis.SymbolKind'
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindNonMethod(NameSyntax node, Symbol symbol, Boolean isError, BoundExpression receiver) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Expressions.cs:line 1372
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindIdentifier(IdentifierNameSyntax node, Boolean invoked, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Expressions.cs:line 1014
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindArgumentAndName(AnalyzedArguments result, Boolean hadError, ExpressionSyntax argumentExpression) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Expressions.cs:line 1159
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindArgumentsAndNames(SeparatedSyntaxList1 arguments, AnalyzedArguments result) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Expressions.cs:line 1139 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindInvocationExpression(InvocationExpressionSyntax node, DiagnosticBag diagnostics, Boolean isStatement) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Invocation.cs:line 31 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindExpressionStatement(SyntaxNode node, ExpressionSyntax syntax, Boolean allowsAnyExpression, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 521 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 83 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatements(SyntaxList1 syntaxStatements, DiagnosticBag diagnostics, Binder binder) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 53
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindBlock(BlockSyntax node, DiagnosticBag diagnostics, Binder blockBinder) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 33
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 80
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindIfStatement(IfStatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 546
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 92
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatements(SyntaxList1 syntaxStatements, DiagnosticBag diagnostics, Binder binder) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 53 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindBlock(BlockSyntax node, DiagnosticBag diagnostics, Binder blockBinder) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 33 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 80 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindIfStatement(IfStatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 546 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatement(StatementSyntax node, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 92 at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindStatements(SyntaxList1 syntaxStatements, DiagnosticBag diagnostics, Binder binder) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 53
at Microsoft.Dynamics.Nav.CodeAnalysis.Binder.BindBlock(BlockSyntax node, DiagnosticBag diagnostics, Binder blockBinder) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Binder\Binder_Statements.cs:line 33
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.BindMethodBody(MethodSymbol method, DiagnosticBag diagnostics) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 482
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMethod(MethodSymbol methodSymbol) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 404
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMembers(ContainerSymbol containingType) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 328
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileObject(ObjectTypeSymbol containingType) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 218
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.<>c__DisplayClass14_0.b__0() in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 202
at Microsoft.Dynamics.Nav.CodeAnalysis.Utilities.UICultureUtilities.<>c__DisplayClass5_0.b__0() in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Utilities\UICultureUtilities.cs:line 152
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.WaitForWorkers() in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 162
at Microsoft.Dynamics.Nav.CodeAnalysis.MethodCompiler.CompileMethodBodies(Compilation compilation, ModuleBuilder moduleBeingBuiltOpt, Boolean hasDeclarationErrors, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compiler\MethodCompiler.cs:line 146 at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.CompileImpl(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 886
at Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.Compile(ModuleBuilder moduleBuilder, Boolean emittingPdb, DiagnosticBag diagnostics, Predicate1 filterOpt, CancellationToken cancellationToken) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\Compilation.cs:line 861 at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.PackageTheModule(Compilation compilation, CompilerTextWriter consoleOutput, CancellationToken cancellationToken, ErrorLogger errorLogger, AnalyzerDriver analyzerDriver) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 577 at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 435 at Microsoft.Dynamics.Nav.CodeAnalysis.CommandLine.CommonCompiler.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\CommandLine\CommonCompiler.cs:line 313 at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.Extensions.CreatePackageRequestHandler.<HandleAsync>d__4.MoveNext() in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\Extensions\CreatePackageRequestHandler.cs:line 47 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase1.d__10.MoveNext() in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 45
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.d__6.MoveNext() in C:\a\811\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 59

@atoader
Copy link
Contributor

atoader commented Dec 12, 2018

Hi, @hougaard ! What version of the extension are you running? I've tried this scenario on the latest version and this is what I get:
image

@hougaard
Copy link
Contributor Author

microsoft.al-2.0.56865

@atoader
Copy link
Contributor

atoader commented Dec 12, 2018

It works fine in master. We've seen this bug reported a couple of times, but we could never reproduce it. Is that the entire extension? Could you post a sample where this error happens?

@hougaard
Copy link
Contributor Author

hougaard commented Dec 12, 2018

If I create a new extension with AL:Go! and change helloworld.al to this: (Extend Budget page and do the Name := '';

image

That will give the error.

@atoader
Copy link
Contributor

atoader commented Dec 12, 2018

I have the exact same code, but it works as expected. The next release of the AL Language extension should not lead to this crash.

@atoader atoader added ships-in-future-update The issue is fixed in our 'master' branch and will ship in the next PREVIEW release and removed input-needed labels Dec 13, 2018
@atoader atoader added this to the December 2018 milestone Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ships-in-future-update The issue is fixed in our 'master' branch and will ship in the next PREVIEW release
Projects
None yet
Development

No branches or pull requests

3 participants