dotnet/roslyn
Voir sur GitHubNRE from VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer when working in Roslyn.sln
Open
#77 134 ouverte le 10 févr. 2025
Area-AnalyzersFeature - IDE0004help wanted
Métriques du dépôt
- Stars
- (20 414 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (256 PRs mergées en 30 j)
Description
Analyzer 'Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast.VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
Exception occurred with following context:
Compilation: Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests
SyntaxTree: C:\R1\src\Compilers\VisualBasic\Test\Emit\ExpressionTrees\Sources\QueryHelper.vb
SyntaxNode: DirectCast(Nothing, QueryHelper ... [DirectCastExpressionSyntax]@[1442..1480) (29,67)-(29,105)
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.CodeAnalysis.VisualBasic.Extensions.CastAnalyzer.CastPassedToParamArrayDefinitelyCantBeRemoved(ITypeSymbol castType)
at Microsoft.CodeAnalysis.VisualBasic.Extensions.CastAnalyzer.IsUnnecessary()
at Microsoft.CodeAnalysis.VisualBasic.RemoveUnnecessaryCast.VisualBasicRemoveUnnecessaryCastDiagnosticAnalyzer.IsUnnecessaryCast(SemanticModel model, ExpressionSyntax node, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.RemoveUnnecessaryCast.AbstractRemoveUnnecessaryCastDiagnosticAnalyzer`2.TryRemoveCastExpression(SemanticModel model, TCastExpression node, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.RemoveUnnecessaryCast.AbstractRemoveUnnecessaryCastDiagnosticAnalyzer`2.AnalyzeSyntax(SyntaxNodeAnalysisContext context)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
-----
Suppress the following diagnostics to disable this analyzer: IDE0004