Companial / CompanialCop

Custom code analyzer for AL projects.
MIT License
11 stars 3 forks source link

Analyzer 'CompanialCopAnalyzer.Design.Rule0027AnalyzeTransferField' threw an exception #2

Closed finnpedersenkazes closed 1 day ago

finnpedersenkazes commented 4 months ago

I am getting the following error message

Analyzer 'CompanialCopAnalyzer.Design.Rule0027AnalyzeTransferField' threw an exception of type 'System.InvalidCastException' with message 'System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Syntax.CodeunitSyntax' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.Syntax.TableExtensionSyntax'.
   at CompanialCopAnalyzer.Design.Rule0027AnalyzeTransferField.AnalyzeTableExtension(SyntaxNodeAnalysisContext ctx)
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass53_1.<ExecuteSyntaxNodeAction>b__1() in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 752
   at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1088'
Screenshot 2024-04-14 141037

The below warnings about the argument not being user is not correct as illustrated in the image.

Screenshot 2024-04-14 141206

This has worked before. I am not sure what is new. I have downloaded the latest symbols.

Hope it helps. Finn

tinestaric commented 4 months ago

Hey, thanks for reporting this. I've just published a new release. Can you check if it works okay with that one?