当前位置: 首页>>代码示例>>C#>>正文


C# IEntity.IsAmbiguous方法代码示例

本文整理汇总了C#中IEntity.IsAmbiguous方法的典型用法代码示例。如果您正苦于以下问题:C# IEntity.IsAmbiguous方法的具体用法?C# IEntity.IsAmbiguous怎么用?C# IEntity.IsAmbiguous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEntity的用法示例。


在下文中一共展示了IEntity.IsAmbiguous方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConstructEntity

		/// <summary>
		/// Constructs an entity from a generic definition and arguments, after ensuring the construction is valid.
		/// </summary>
		/// <param name="definition">The generic definition entity.</param>
		/// <param name="constructionNode">The node in which construction occurs.</param>
		/// <param name="typeArguments">The generic type arguments to substitute for generic parameters.</param>
		/// <returns>The constructed entity.</returns>
		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);
		}
开发者ID:hmah,项目名称:boo,代码行数:29,代码来源:GenericsServices.cs

示例2: SliceMember

        void SliceMember(SlicingExpression node, IEntity member)
        {
            EnsureRelatedNodeWasVisited(node, member);
            if (node.IsTargetOfAssignment())
            {
                // leave it to LeaveBinaryExpression to resolve
                Bind(node, member);
                return;
            }

            MethodInvocationExpression mie = new MethodInvocationExpression(node.LexicalInfo);
            foreach (Slice index in node.Indices)
            {
                mie.Arguments.Add(index.Begin);
            }

            IMethod getter = null;
            if (member.IsAmbiguous())
            {
                IEntity result = ResolveAmbiguousPropertyReference((ReferenceExpression)node.Target, (Ambiguous)member, mie.Arguments);
                IProperty found = result as IProperty;
                if (null != found)
                {
                    getter = found.GetGetMethod();
                }
                else if (result.IsAmbiguous())
                {
                    Error(node);
                    return;
                }
            }
            else if (EntityType.Property == member.EntityType)
            {
                getter = ((IProperty)member).GetGetMethod();
            }

            if (null != getter)
            {
                if (AssertParameters(node, getter, mie.Arguments))
                {
                    Expression target = GetIndexedPropertySlicingTarget(node);

                    mie.Target = CodeBuilder.CreateMemberReference(target, getter);
                    BindExpressionType(mie, getter.ReturnType);

                    node.ParentNode.Replace(node, mie);
                }
                else
                {
                    Error(node);
                }
            }
            else
            {
                NotImplemented(node, "slice for anything but arrays and default properties");
            }
        }
开发者ID:boo-lang,项目名称:boo,代码行数:57,代码来源:ProcessMethodBodies.cs

示例3: FindMethodOverridenBy

        private static IMethod FindMethodOverridenBy(InternalMethod entity, IEntity candidates)
        {
            if (EntityType.Method == candidates.EntityType)
            {
                var candidate = (IMethod)candidates;
                if (TypeSystemServices.CheckOverrideSignature(entity, candidate))
                    return candidate;
            }

            if (candidates.IsAmbiguous())
                foreach (IMethod candidate in ((Ambiguous) candidates).Entities)
                    if (TypeSystemServices.CheckOverrideSignature(entity, candidate))
                        return candidate;

            return null;
        }
开发者ID:boo-lang,项目名称:boo,代码行数:16,代码来源:ProcessMethodBodies.cs

示例4: ResolveOperatorEntity

        private IMethod ResolveOperatorEntity(IEntity op, ExpressionCollection args)
        {
            if (op.IsAmbiguous())
                return ResolveAmbiguousOperator(((Ambiguous)op).Entities, args);

            if (EntityType.Method == op.EntityType)
            {
                IMethod candidate = (IMethod)op;
                if (HasOperatorSignature(candidate, args))
                    return candidate;
            }
            return null;
        }
开发者ID:boo-lang,项目名称:boo,代码行数:13,代码来源:ProcessMethodBodies.cs

示例5: FindConflictingMember

        private IMethod FindConflictingMember(IMethod extension, IEntity entity)
        {
            if (entity.IsAmbiguous())
                return FindConflictingMember(extension, ((Ambiguous)entity).Entities);

            var method = (IMethod)entity;
            return IsConflictingMember(extension, method) ? method : null;
        }
开发者ID:0xb1dd1e,项目名称:boo,代码行数:8,代码来源:StricterErrorChecking.cs


注:本文中的IEntity.IsAmbiguous方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。