private List<IEntity> GetMatchesByGenericity(ReferenceExpression node, Ambiguous candidates)
{
bool isGenericReference = (node.ParentNode is GenericReferenceExpression);
List<IEntity> matches = new List<IEntity>();
foreach (IEntity candidate in candidates.Entities)
{
IType type = candidate as IType;
bool isGenericType = (type != null && type.GenericInfo != null);
if (isGenericType == isGenericReference)
{
matches.Add(candidate);
}
}
return matches;
}