本文整理汇总了C#中Microsoft.CSharp.RuntimeBinder.Semantics.CType.HasErrors方法的典型用法代码示例。如果您正苦于以下问题:C# CType.HasErrors方法的具体用法?C# CType.HasErrors怎么用?C# CType.HasErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CSharp.RuntimeBinder.Semantics.CType
的用法示例。
在下文中一共展示了CType.HasErrors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPointer
public PointerType GetPointer(CType baseType)
{
PointerType pPointer = _typeTable.LookupPointer(baseType);
if (pPointer == null)
{
// No existing type. Create a new one.
Name namePtr = _BSymmgr.GetNameManager().GetPredefName(PredefinedName.PN_PTR);
pPointer = _typeFactory.CreatePointer(namePtr, baseType);
pPointer.InitFromParent();
_typeTable.InsertPointer(baseType, pPointer);
}
else
{
Debug.Assert(pPointer.HasErrors() == baseType.HasErrors());
Debug.Assert(pPointer.IsUnresolved() == baseType.IsUnresolved());
}
Debug.Assert(pPointer.GetReferentType() == baseType);
return pPointer;
}
示例2: GetParameterModifier
public ParameterModifierType GetParameterModifier(CType paramType, bool isOut)
{
Name name = _BSymmgr.GetNameManager().GetPredefName(isOut ? PredefinedName.PN_OUTPARAM : PredefinedName.PN_REFPARAM);
ParameterModifierType pParamModifier = _typeTable.LookupParameterModifier(name, paramType);
if (pParamModifier == null)
{
// No existing parammod symbol. Create a new one.
pParamModifier = _typeFactory.CreateParameterModifier(name, paramType);
pParamModifier.isOut = isOut;
pParamModifier.InitFromParent();
_typeTable.InsertParameterModifier(name, paramType, pParamModifier);
}
else
{
Debug.Assert(pParamModifier.HasErrors() == paramType.HasErrors());
Debug.Assert(pParamModifier.IsUnresolved() == paramType.IsUnresolved());
}
Debug.Assert(pParamModifier.GetParameterType() == paramType);
return pParamModifier;
}
示例3: GetArray
public ArrayType GetArray(CType elementType, int args)
{
Name name;
ArrayType pArray;
Debug.Assert(args > 0 && args < 32767);
switch (args)
{
case 1:
case 2:
name = _BSymmgr.GetNameManager().GetPredefinedName(PredefinedName.PN_ARRAY0 + args);
break;
default:
name = _BSymmgr.GetNameManager().Add("[X" + args + 1);
break;
}
// See if we already have an array type of this element type and rank.
pArray = _typeTable.LookupArray(name, elementType);
if (pArray == null)
{
// No existing array symbol. Create a new one.
pArray = _typeFactory.CreateArray(name, elementType, args);
pArray.InitFromParent();
_typeTable.InsertArray(name, elementType, pArray);
}
else
{
Debug.Assert(pArray.HasErrors() == elementType.HasErrors());
Debug.Assert(pArray.IsUnresolved() == elementType.IsUnresolved());
}
Debug.Assert(pArray.rank == args);
Debug.Assert(pArray.GetElementType() == elementType);
return pArray;
}