From 9506efd3178f92950d0a904f846f412754d66982 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 19 Apr 2023 16:21:45 -0500 Subject: [PATCH] Generate syntax lists with the correct type --- .../CSharpDynamicInterfaceCastableImplementation.Fixer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDynamicInterfaceCastableImplementation.Fixer.cs b/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDynamicInterfaceCastableImplementation.Fixer.cs index a82b96d21a..289f6f8bac 100644 --- a/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDynamicInterfaceCastableImplementation.Fixer.cs +++ b/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/InteropServices/CSharpDynamicInterfaceCastableImplementation.Fixer.cs @@ -163,8 +163,8 @@ private static SyntaxNode GenerateEventImplementation( SyntaxFactory.List( new[] { - generator.WithStatements(generator.GetAccessor(eventDeclaration, DeclarationKind.AddAccessor), defaultMethodBodyStatements), - generator.WithStatements(generator.GetAccessor(eventDeclaration, DeclarationKind.RemoveAccessor), defaultMethodBodyStatements), + (AccessorDeclarationSyntax)generator.WithStatements(generator.GetAccessor(eventDeclaration, DeclarationKind.AddAccessor), defaultMethodBodyStatements), + (AccessorDeclarationSyntax)generator.WithStatements(generator.GetAccessor(eventDeclaration, DeclarationKind.RemoveAccessor), defaultMethodBodyStatements), }))); } @@ -249,7 +249,7 @@ protected override async Task MakeMemberDeclaredOnImplementationTypeSt var currentInvocation = (InvocationExpressionSyntax)node; var newArgList = currentInvocation.ArgumentList.WithArguments( - SyntaxFactory.SingletonSeparatedList(generator.Argument(invocation.target)) + SyntaxFactory.SingletonSeparatedList((ArgumentSyntax)generator.Argument(invocation.target)) .AddRange(currentInvocation.ArgumentList.Arguments)); return currentInvocation.WithArgumentList(newArgList).WithExpression(SyntaxFactory.IdentifierName(symbol.Name)); });