本文整理汇总了C#中CSharpCompilation.CreatePointerTypeSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# CSharpCompilation.CreatePointerTypeSymbol方法的具体用法?C# CSharpCompilation.CreatePointerTypeSymbol怎么用?C# CSharpCompilation.CreatePointerTypeSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSharpCompilation
的用法示例。
在下文中一共展示了CSharpCompilation.CreatePointerTypeSymbol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestBinaryIntrinsicSymbol
//.........这里部分代码省略.........
signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Enum, leftType, rightType, leftType.EnumUnderlyingType());
}
else if ((op == BinaryOperatorKind.Equal ||
op == BinaryOperatorKind.NotEqual ||
op == BinaryOperatorKind.LessThan ||
op == BinaryOperatorKind.LessThanOrEqual ||
op == BinaryOperatorKind.GreaterThan ||
op == BinaryOperatorKind.GreaterThanOrEqual) &&
leftType.IsEnumType() && leftType == rightType)
{
signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Enum, leftType, rightType, compilation.GetSpecialType(SpecialType.System_Boolean));
}
else if ((op == BinaryOperatorKind.Xor ||
op == BinaryOperatorKind.And ||
op == BinaryOperatorKind.Or) &&
leftType.IsEnumType() && leftType == rightType)
{
signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Enum, leftType, rightType, leftType);
}
else if ((op == BinaryOperatorKind.Addition || op == BinaryOperatorKind.Subtraction) &&
leftType.IsDelegateType() && leftType == rightType)
{
signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Delegate, leftType, leftType, leftType);
}
else if ((op == BinaryOperatorKind.Equal ||
op == BinaryOperatorKind.NotEqual ||
op == BinaryOperatorKind.LessThan ||
op == BinaryOperatorKind.LessThanOrEqual ||
op == BinaryOperatorKind.GreaterThan ||
op == BinaryOperatorKind.GreaterThanOrEqual) &&
leftType.IsPointerType() && rightType.IsPointerType())
{
signature = new BinaryOperatorSignature(op | BinaryOperatorKind.Pointer,
compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_Void)),
compilation.CreatePointerTypeSymbol(compilation.GetSpecialType(SpecialType.System_Void)),
compilation.GetSpecialType(SpecialType.System_Boolean));
}
else
{
if ((object)symbol1 != null)
{
Assert.False(symbol1.IsImplicitlyDeclared);
Assert.Equal(MethodKind.UserDefinedOperator, symbol1.MethodKind);
if (leftType.IsValueType && !leftType.IsPointerType())
{
if (rightType.IsValueType && !rightType.IsPointerType())
{
Assert.Same(symbol1, symbol2);
Assert.Same(symbol1, symbol3);
Assert.Same(symbol1, symbol4);
return;
}
else
{
Assert.Null(symbol2);
Assert.Same(symbol1, symbol3);
Assert.Null(symbol4);
return;
}
}
else if (rightType.IsValueType && !rightType.IsPointerType())
{
Assert.Null(symbol2);
Assert.Null(symbol3);
Assert.Same(symbol1, symbol4);