Skip to content

Commit

Permalink
Fix EC87 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Djoums authored May 13, 2024
1 parent 87857e1 commit 200e024
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/EcoCode.Core/Analyzers/EC87.UseListIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ public override void Initialize(AnalysisContext context)
private static void AnalyzeInvocationExpression(SyntaxNodeAnalysisContext context)
{
var invocationExpr = (InvocationExpressionSyntax)context.Node;
var memberAccess = (MemberAccessExpressionSyntax)invocationExpr.Expression;

if (context.SemanticModel.GetSymbolInfo(invocationExpr).Symbol is not IMethodSymbol method ||
if (invocationExpr.Expression is not MemberAccessExpressionSyntax memberAccess ||
context.SemanticModel.GetSymbolInfo(invocationExpr).Symbol is not IMethodSymbol method ||
!method.IsExtensionMethod ||
!SymbolEqualityComparer.Default.Equals(method.ContainingType, context.Compilation.GetTypeByMetadataName(typeof(Enumerable).FullName)))
{
Expand Down

0 comments on commit 200e024

Please sign in to comment.