mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Merge pull request #2086 from calumgrant/cs/indexer-detection
C#: Fix an InvalidCastException
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user