From 1a8d544342611a72c3b6e512b8c57c2165f60836 Mon Sep 17 00:00:00 2001 From: Josef Pihrt Date: Fri, 21 Oct 2022 14:23:11 +0200 Subject: [PATCH] Ignore implicit object creation inside parameter --- .../Analysis/UseImplicitOrExplicitObjectCreationAnalyzer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Analyzers/CSharp/Analysis/UseImplicitOrExplicitObjectCreationAnalyzer.cs b/src/Analyzers/CSharp/Analysis/UseImplicitOrExplicitObjectCreationAnalyzer.cs index 59e8794084..baedc485bc 100644 --- a/src/Analyzers/CSharp/Analysis/UseImplicitOrExplicitObjectCreationAnalyzer.cs +++ b/src/Analyzers/CSharp/Analysis/UseImplicitOrExplicitObjectCreationAnalyzer.cs @@ -295,7 +295,7 @@ private void AnalyzeImplicitObjectCreationExpression(SyntaxNodeAnalysisContext c { parent = parent.Parent; - SyntaxDebug.Assert(parent.IsKind(SyntaxKind.VariableDeclarator, SyntaxKind.PropertyDeclaration), parent); + SyntaxDebug.Assert(parent.IsKind(SyntaxKind.VariableDeclarator, SyntaxKind.PropertyDeclaration, SyntaxKind.Parameter), parent); if (parent.IsKind(SyntaxKind.VariableDeclarator)) {