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


C# Semantics.AggregateType类代码示例

本文整理汇总了C#中Microsoft.CSharp.RuntimeBinder.Semantics.AggregateType的典型用法代码示例。如果您正苦于以下问题:C# AggregateType类的具体用法?C# AggregateType怎么用?C# AggregateType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AggregateType类属于Microsoft.CSharp.RuntimeBinder.Semantics命名空间,在下文中一共展示了AggregateType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GroupToArgsBinder

            public GroupToArgsBinder(ExpressionBinder exprBinder, BindingFlag bindFlags, EXPRMEMGRP grp, ArgInfos args, ArgInfos originalArgs, bool bHasNamedArguments, AggregateType atsDelegate)
            {
                Debug.Assert(grp != null);
                Debug.Assert(exprBinder != null);
                Debug.Assert(args != null);

                _pExprBinder = exprBinder;
                _fCandidatesUnsupported = false;
                _fBindFlags = bindFlags;
                _pGroup = grp;
                _pArguments = args;
                _pOriginalArguments = originalArgs;
                _bHasNamedArguments = bHasNamedArguments;
                _pDelegate = atsDelegate;
                _pCurrentType = null;
                _pCurrentSym = null;
                _pCurrentTypeArgs = null;
                _pCurrentParameters = null;
                _pBestParameters = null;
                _nArgBest = -1;
                _nWrongCount = 0;
                _bIterateToEndOfNsList = false;
                _bBindingCollectionAddArgs = false;
                _results = new GroupToArgsBinderResult();
                _methList = new List<CandidateFunctionMember>();
                _mpwiParamTypeConstraints = new MethPropWithInst();
                _mpwiBogus = new MethPropWithInst();
                _mpwiCantInferInstArg = new MethPropWithInst();
                _mwtBadArity = new MethWithType();
                _HiddenTypes = new List<CType>();
            }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:31,代码来源:GroupToArgsBinder.cs

示例2: CheckAccess2

        public virtual ACCESSERROR CheckAccess2(Symbol symCheck, AggregateType atsCheck, Symbol symWhere, CType typeThru)
        {
            Debug.Assert(symCheck != null);
            Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.getAggregate());
            Debug.Assert(typeThru == null ||
                   typeThru.IsAggregateType() ||
                   typeThru.IsTypeParameterType() ||
                   typeThru.IsArrayType() ||
                   typeThru.IsNullableType() ||
                   typeThru.IsErrorType());

#if DEBUG

            switch (symCheck.getKind())
            {
                default:
                    break;
                case SYMKIND.SK_MethodSymbol:
                case SYMKIND.SK_PropertySymbol:
                case SYMKIND.SK_FieldSymbol:
                case SYMKIND.SK_EventSymbol:
                    Debug.Assert(atsCheck != null);
                    break;
            }

#endif // DEBUG

            ACCESSERROR error = CheckAccessCore(symCheck, atsCheck, symWhere, typeThru);
            if (ACCESSERROR.ACCESSERROR_NOERROR != error)
            {
                return error;
            }

            // Check the accessibility of the return CType.
            CType CType = symCheck.getType();
            if (CType == null)
            {
                return ACCESSERROR.ACCESSERROR_NOERROR;
            }

            // For members of AGGSYMs, atsCheck should always be specified!
            Debug.Assert(atsCheck != null);

            if (atsCheck.getAggregate().IsSource())
            {
                // We already check the "at least as accessible as" rules.
                // Does this always work for generics?
                // Could we get a bad CType argument in typeThru?
                // Maybe call CheckTypeAccess on typeThru?
                return ACCESSERROR.ACCESSERROR_NOERROR;
            }

            // Substitute on the CType.
            if (atsCheck.GetTypeArgsAll().size > 0)
            {
                CType = SymbolLoader.GetTypeManager().SubstType(CType, atsCheck);
            }

            return CheckTypeAccess(CType, symWhere) ? ACCESSERROR.ACCESSERROR_NOERROR : ACCESSERROR.ACCESSERROR_NOACCESS;
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:60,代码来源:SemanticChecker.cs

示例3: AddInconvertibleResult

            /////////////////////////////////////////////////////////////////////////////////

            public void AddInconvertibleResult(
                MethodSymbol method,
                AggregateType currentType,
                TypeArray currentTypeArgs)
            {
                if (InconvertibleResult.Sym == null)
                {
                    // This is the first one, so set it for error reporting usage.
                    InconvertibleResult.Set(method, currentType, currentTypeArgs);
                }
                _inconvertibleResults.Add(new MethPropWithInst(method, currentType, currentTypeArgs));
            }
开发者ID:noahfalk,项目名称:corefx,代码行数:14,代码来源:GroupToArgsBinderResult.cs

示例4: CreateAggregateType

        // Aggregate
        public AggregateType CreateAggregateType(
            Name name,
            AggregateSymbol parent,
            TypeArray typeArgsThis,
            AggregateType outerType)
        {
            AggregateType type = new AggregateType();

            type.outerType = outerType;
            type.SetOwningAggregate(parent);
            type.SetTypeArgsThis(typeArgsThis);
            type.SetName(name);

            type.SetTypeKind(TypeKind.TK_AggregateType);
            return type;
        }
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:17,代码来源:TypeFactory.cs

示例5: GetAts

        public AggregateType GetAts(ErrorHandling errorContext)
        {
            AggregateSymbol aggNullable = typeManager.GetNullable();
            if (aggNullable == null)
            {
                throw Error.InternalCompilerError();
            }

            if (ats == null)
            {
                CType typePar = GetUnderlyingType();
                CType[] typeParArray = new CType[] { typePar };
                TypeArray ta = symmgr.AllocParams(1, typeParArray);
                ats = typeManager.GetAggregate(aggNullable, ta);
            }
            return ats;
        }
开发者ID:dotnet,项目名称:corefx,代码行数:17,代码来源:NullableType.cs

示例6: GetBaseClass

        public AggregateType GetBaseClass()
        {
#if CSEE
            AggregateType atsBase = getAggregate().GetBaseClass();
            if (!atsBase || GetTypeArgsAll().size == 0 || atsBase.GetTypeArgsAll().size == 0)
                return atsBase;

            return getAggregate().GetTypeManager().SubstType(atsBase, GetTypeArgsAll()).AsAggregateType();
#else // !CSEE

            if (_baseType == null)
            {
                _baseType = getAggregate().GetTypeManager().SubstType(getAggregate().GetBaseClass(), GetTypeArgsAll()) as AggregateType;
            }

            return _baseType;
#endif // !CSEE
        }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:18,代码来源:AggregateType.cs

示例7: GetAts

        public AggregateType GetAts(ErrorHandling errorContext)
        {
            AggregateSymbol aggNullable = typeManager.GetNullable();
            if (aggNullable == null)
            {
                throw Error.InternalCompilerError();
            }

            if (ats == null)
            {
                if (aggNullable == null)
                {
                    typeManager.ReportMissingPredefTypeError(errorContext, PredefinedType.PT_G_OPTIONAL);
                    return null;
                }

                CType typePar = GetUnderlyingType();
                CType[] typeParArray = new CType[] { typePar };
                TypeArray ta = symmgr.AllocParams(1, typeParArray);
                ats = typeManager.GetAggregate(aggNullable, ta);
            }
            return ats;
        }
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:23,代码来源:NullableType.cs

示例8: FieldWithType

 public FieldWithType(FieldSymbol field, AggregateType ats)
 {
     Set(field, ats);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例9: MethPropWithInst

 public MethPropWithInst(MethodOrPropertySymbol mps, AggregateType ats)
     : this(mps, ats, null)
 {
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例10: PropWithType

 public PropWithType(PropertySymbol prop, AggregateType ats)
 {
     Set(prop, ats);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例11: EventWithType

 public EventWithType(EventSymbol @event, AggregateType ats)
 {
     Set(@event, ats);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例12: MethPropWithType

 public MethPropWithType(MethodOrPropertySymbol mps, AggregateType ats)
 {
     Set(mps, ats);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例13: MethWithType

 public MethWithType(MethodSymbol meth, AggregateType ats)
 {
     Set(meth, ats);
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例14: MethWithInst

 public MethWithInst(MethodSymbol meth, AggregateType ats)
     : this(meth, ats, null)
 {
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:4,代码来源:WithType.cs

示例15: LowerBoundInterfaceInference

        ////////////////////////////////////////////////////////////////////////////////

        private bool LowerBoundInterfaceInference(CType pSource, AggregateType pDest)
        {
            if (!pDest.isInterfaceType())
            {
                return false;
            }

            // SPEC:  Otherwise, if V is an interface CType C<V1...Vk> and U is a class CType
            // SPEC:   or struct CType and there is a unique set U1...Uk such that U directly 
            // SPEC:   or indirectly implements C<U1...Uk> then an
            // SPEC:   exact, upper-bound, or lower-bound inference ...
            // SPEC:  ... and U is an interface CType ...
            // SPEC:  ... and U is a CType parameter ...

            //TypeArray pInterfaces = null;

            if (!pSource.isStructType() && !pSource.isClassType() &&
                !pSource.isInterfaceType() && !pSource.IsTypeParameterType())
            {
                return false;
            }

            var interfaces = pSource.AllPossibleInterfaces();
            AggregateType pInterface = null;
            foreach (AggregateType pCurrent in interfaces)
            {
                if (pCurrent.GetOwningAggregate() == pDest.GetOwningAggregate())
                {
                    if (pInterface == null)
                    {
                        pInterface = pCurrent;
                    }
                    else if (pInterface != pCurrent)
                    {
                        // Not unique. Bail out.
                        return false;
                    }
                }
            }
            if (pInterface == null)
            {
                return false;
            }
            LowerBoundTypeArgumentInference(pInterface, pDest);
            return true;
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:48,代码来源:MethodTypeInferrer.cs


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