Skip to content

Commit ccf20b3

Browse files
committed
Use GetMethod.Match
1 parent 2bf1300 commit ccf20b3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

ReflectionAnalyzers/Helpers/Reflection/MethodInfo.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ internal MethodInfo(INamedTypeSymbol reflectedType, IMethodSymbol method)
2323
return expression switch
2424
{
2525
InvocationExpressionSyntax invocation
26-
when GetX.TryMatchGetMethod(invocation, semanticModel, cancellationToken, out var member, out _, out _, out _) &&
27-
member is { ReflectedType: { }, Symbol: IMethodSymbol method }
28-
=> new MethodInfo(member.ReflectedType, method),
26+
when GetMethod.Match(invocation, semanticModel, cancellationToken) is { Member: { ReflectedType: { } reflectedType, Symbol: IMethodSymbol method } }
27+
=> new MethodInfo(reflectedType, method),
2928

3029
InvocationExpressionSyntax { Expression: MemberAccessExpressionSyntax memberAccess } invocation
3130
when semanticModel.TryGetSymbol(invocation, KnownSymbol.PropertyInfo.GetGetMethod, cancellationToken, out _) &&

0 commit comments

Comments
 (0)