Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant MethodKind parameter #58481

Merged
merged 1 commit into from
Dec 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,8 @@ private static SyntaxNode AddGeneratedHandlerMethodToSolution(
var eventHookupExpression = root.GetAnnotatedNodesAndTokens(plusEqualsTokenAnnotation).Single().AsToken().GetAncestor<AssignmentExpressionSyntax>();

var typeDecl = eventHookupExpression.GetAncestor<TypeDeclarationSyntax>();
var methodKind = typeDecl is null
? MethodKind.LocalFunction
: MethodKind.Ordinary;

var generatedMethodSymbol = GetMethodSymbol(document, eventHandlerMethodName, eventHookupExpression, methodKind, cancellationToken);
var generatedMethodSymbol = GetMethodSymbol(document, eventHandlerMethodName, eventHookupExpression, cancellationToken);

if (generatedMethodSymbol == null)
{
Expand All @@ -246,7 +243,6 @@ private static IMethodSymbol GetMethodSymbol(
SemanticDocument semanticDocument,
string eventHandlerMethodName,
AssignmentExpressionSyntax eventHookupExpression,
MethodKind methodKind,
CancellationToken cancellationToken)
{
var semanticModel = semanticDocument.SemanticModel;
Expand Down Expand Up @@ -278,7 +274,6 @@ private static IMethodSymbol GetMethodSymbol(
name: eventHandlerMethodName,
typeParameters: default,
parameters: delegateInvokeMethod.Parameters,
methodKind: methodKind,
statements: ImmutableArray.Create(
CodeGenerationHelpers.GenerateThrowStatement(syntaxFactory, semanticDocument, "System.NotImplementedException")));
}
Expand Down