Is there a way to distinguish between array and indexer calls ?

Topics: C# Language Design
Jan 6, 2015 at 8:42 PM

I am working on some analyzers and I need to check indexers calls. To do that, I analyze ElementAccessExpressionSyntax but this type of node can be found for both arrays and indexers calls. Is there a way to check if the call is an indexer call ?
I prepared a lame solution where I get the symbol of ElementAccessExpressionSyntax's Expression and then I check if the Type.TypeKind != TypeKind.Array. It works, but I think it's not an elegant solution...