Boo.Lang.Compiler.TypeSystem.Generics.GenericsServices.ConstructEntity C# (CSharp) Метод

ConstructEntity() публичный Метод

Constructs an entity from a generic definition and arguments, after ensuring the construction is valid.
public ConstructEntity ( Node constructionNode, IEntity definition, IType typeArguments ) : IEntity
constructionNode Node The node in which construction occurs.
definition IEntity The generic definition entity.
typeArguments IType The generic type arguments to substitute for generic parameters.
Результат IEntity
        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);
        }