You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using LinterCop for AL with the following versions:
v15.0.1177813 (pre-release)
v14.1.1180850 (release)
I encounter the following errors:
Error in Rule0051SetFilterPossibleOverflow:
Analyzer 'BusinessCentral.LinterCop.Design.Rule0051SetFilterPossibleOverflow' threw an exception of type 'System.InvalidCastException' with message 'System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.BoundCall' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.IConversionExpression'.
at BusinessCentral.LinterCop.Design.Rule0051SetFilterPossibleOverflow.AnalyzeInvocation(OperationAnalysisContext ctx)
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass54_1.<ExecuteOperationAction>b__1() in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 773
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'AL(AD0001)
Error in Rule0059SingleQuoteEscaping:
Analyzer 'BusinessCentral.LinterCop.Design.Rule0059SingleQuoteEscaping' threw an exception of type 'System.NullReferenceException' with message 'System.NullReferenceException: Object reference not set to an instance of an object.
at BusinessCentral.LinterCop.Design.Rule0059SingleQuoteEscaping.AnalyzeCalcFormula(SymbolAnalysisContext ctx)
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass50_2.<ExecuteSymbolActionsCore>b__0() in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 665
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'AL(AD0001)
Steps to Reproduce:
Use correct LinterCop with AL in either of the versions:
v15.0.1177813 (pre-release)
v14.1.1180850 (release)
Open app.json.
Expected Result:
The analyzers should execute without throwing exceptions.
Actual Result:
The analyzers throw exceptions:
System.InvalidCastException for Rule0051SetFilterPossibleOverflow.
System.NullReferenceException for Rule0059SingleQuoteEscaping.
Additional Information:
Reinstalling LinterCop and AL does not resolve the issue.
I've created an updated version v0.31.3 of the LinterCop) to investigate what's causing this.
Normally closing (all) VS Code windows and opening again an AL project should be enough to automatically retrieve this updated version. Please make sure you have the "pre-release" option on the LinterCop extensions itself activated.
You should now have a LC0000 diagnostic instead of these exceptions. Would be great if you could share a small code example which causes one or both of these exceptions.
For some reason, the .dll file is not updating automatically, even when using the Download Linter Cop action. I had to manually delete the existing file, and only then was it successfully downloaded.
Regarding Rule0059SingleQuoteEscaping, the issue disappeared as soon as I tried to open it. The error initially appeared for this field:
As for Rule0051SetFilterPossibleOverflow, the error is triggered by the following code:
When using LinterCop for AL with the following versions:
I encounter the following errors:
Error in Rule0051SetFilterPossibleOverflow:
Error in Rule0059SingleQuoteEscaping:
Steps to Reproduce:
Expected Result:
The analyzers should execute without throwing exceptions.
Actual Result:
The analyzers throw exceptions:
System.InvalidCastException
for Rule0051SetFilterPossibleOverflow.System.NullReferenceException
for Rule0059SingleQuoteEscaping.Additional Information:
Environment:
The text was updated successfully, but these errors were encountered: