Merge pull request #2086 from calumgrant/cs/indexer-detection

C#: Fix an InvalidCastException
This commit is contained in:
Tom Hvitved
2019-10-15 15:33:32 +02:00
committed by GitHub

View File

@@ -111,7 +111,7 @@ namespace Semmle.Extraction.CSharp.Entities
public static Property Create(Context cx, IPropertySymbol prop)
{
bool isIndexer = prop.IsIndexer || prop.ExplicitInterfaceImplementations.Any(e => e.IsIndexer);
bool isIndexer = prop.IsIndexer || prop.Parameters.Any();
return isIndexer ? Indexer.Create(cx, prop) : PropertyFactory.Instance.CreateEntity(cx, prop);
}