public IEntity ConstructEntity(Node constructionNode, IEntity definition, IType[] typeArguments)
{
// Ensure definition is a valid entity
if (definition == null || TypeSystemServices.IsError(definition))
{
return TypeSystemServices.ErrorEntity;
}
// Ambiguous generic constructions are handled separately
if (definition.IsAmbiguous())
{
return ConstructAmbiguousEntity(constructionNode, (Ambiguous)definition, typeArguments);
}
// Check that the construction is valid
if (!CheckGenericConstruction(constructionNode, definition, typeArguments, true))
{
return TypeSystemServices.ErrorEntity;
}
return MakeGenericEntity(definition, typeArguments);
}