in ClrHeapAllocationsAnalyzer/AvoidAllocationWithArrayEmptyCodeFix.cs [191:206]
private bool IsCopyConstructor(SemanticModel semanticModel, ObjectCreationExpressionSyntax objectCreation)
{
if (objectCreation.ArgumentList == null || objectCreation.ArgumentList.Arguments.Count == 0)
{
return false;
}
if (semanticModel.GetSymbolInfo(objectCreation).Symbol is IMethodSymbol methodSymbol)
{
if (methodSymbol.Parameters.Any(x=> x.Type is INamedTypeSymbol namedType && IsCollectionType(namedType)))
{
return true;
}
}
return false;
}