Closed marinasundstrom closed 6 days ago
ArgumentNullException should not be reported.
ArgumentNullException
It is in the filter logic - only being on exception types from XML doc.
/// <summary> /// Analyzes exceptions thrown by a method, constructor, or other member. /// </summary> private void AnalyzeMemberExceptions(SyntaxNodeAnalysisContext context, SyntaxNode node, IMethodSymbol methodSymbol, AnalyzerConfig options) { if (methodSymbol == null) return; List<INamedTypeSymbol?> exceptionTypes = GetExceptionTypes(methodSymbol); // Get exceptions from XML documentation var xmlExceptionTypes = GetExceptionTypesFromDocumentationCommentXml(context.Compilation, methodSymbol); xmlExceptionTypes = ProcessNullable(context, node, methodSymbol, xmlExceptionTypes); if (xmlExceptionTypes.Any()) { exceptionTypes.AddRange(xmlExceptionTypes.Select(x => x.ExceptionType)); } foreach (var exceptionType in exceptionTypes.Distinct(SymbolEqualityComparer.Default).OfType<INamedTypeSymbol>()) { AnalyzeExceptionThrowingNode(context, node, exceptionType, options); } }
We will have to revisit this filter logic in the future.
ArgumentNullException
should not be reported.It is in the filter logic - only being on exception types from XML doc.