StefanMaron / BusinessCentral.LinterCop

Community driven code linter for AL (MS Dynamics 365 Business Central)
https://stefanmaron.com
MIT License
77 stars 31 forks source link

LC0044 System.InvalidCastException #533

Closed Arthurvdv closed 8 months ago

Arthurvdv commented 8 months ago

It seems that the new AL Language Extension Pre-Release v13.0.937154 has broken the LC0044 rule.

Analyzer 'BusinessCentral.LinterCop.Design.Rule0044AnalyzeTransferFields' 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 BusinessCentral.LinterCop.Design.Rule0044AnalyzeTransferFields.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'
NAVFreak commented 8 months ago

Notice the same thing here

Arthurvdv commented 8 months ago

The v0.30.13 version of the LinterCop is now released, where I believe this issue is now resolved. If you still encounter issues, feel free to reopen this issue (or create new one).

JohnnyUndercover commented 7 months ago

@Arthurvdv I'am still getting this error with the preview Version. If i switch back to the current Version of AL it is working.

I'am runnung the follwoing Versions: AL Language: v13.0.937154 (pre-release)

LinterCop: v0.1.6 LinterCop DDL: v0.30.13.0