本文整理汇总了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>();
}
示例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;
}
示例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));
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例8: FieldWithType
public FieldWithType(FieldSymbol field, AggregateType ats)
{
Set(field, ats);
}
示例9: MethPropWithInst
public MethPropWithInst(MethodOrPropertySymbol mps, AggregateType ats)
: this(mps, ats, null)
{
}
示例10: PropWithType
public PropWithType(PropertySymbol prop, AggregateType ats)
{
Set(prop, ats);
}
示例11: EventWithType
public EventWithType(EventSymbol @event, AggregateType ats)
{
Set(@event, ats);
}
示例12: MethPropWithType
public MethPropWithType(MethodOrPropertySymbol mps, AggregateType ats)
{
Set(mps, ats);
}
示例13: MethWithType
public MethWithType(MethodSymbol meth, AggregateType ats)
{
Set(meth, ats);
}
示例14: MethWithInst
public MethWithInst(MethodSymbol meth, AggregateType ats)
: this(meth, ats, null)
{
}
示例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;
}