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 message in rule 40 #438

Closed
Axarath opened this issue Dec 15, 2023 · 4 comments · Fixed by #440
Closed

Error message in rule 40 #438

Axarath opened this issue Dec 15, 2023 · 4 comments · Fixed by #440
Labels
bug Something isn't working part of upcoming release

Comments

@Axarath
Copy link

Axarath commented Dec 15, 2023

Analyzer 'BusinessCentral.LinterCop.Design.Rule0040ExplicitlySetRunTrigger' threw an exception of type 'System.InvalidCastException' with message 'System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.BoundObjectAccess' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.IFieldAccess'.
at Microsoft.Dynamics.Nav.CodeAnalysis.OperationExtensions.GetSymbol(IOperation operation) in D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Compilation\OperationExtensions.cs:line 37
at BusinessCentral.LinterCop.Design.Rule0040ExplicitlySetRunTrigger.AnalyzeRunTriggerParameters(OperationAnalysisContext ctx)
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass53_1.b__1() in D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 766
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1102'

I have this error message only in one extension. I'm not sure what exactly does it mean.

@Arthurvdv Arthurvdv added the bug Something isn't working label Dec 15, 2023
@Arthurvdv
Copy link
Collaborator

I have no idea what could cause this error, a repo with a small code sample could be of great help.

If I have to take a guess; One of the build-in methods below, is performed on a variable which is not of type Record of RecordRef?

  • Insert
  • Modify
  • ModifyAll
  • Delete
  • DeleteAll

@Arthurvdv Arthurvdv linked a pull request Dec 15, 2023 that will close this issue
@Arthurvdv
Copy link
Collaborator

I've maybe have found a way to mitigate this error message.

Can you try the prelease v0.30.10 version of the LinterCop and see if this makes any difference?

@Axarath
Copy link
Author

Axarath commented Dec 15, 2023

Yes, it helped. Error message disappeared.

@Arthurvdv
Copy link
Collaborator

Awesome, thanks for verifying this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working part of upcoming release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants