67 instantiations of BinaryOperatorSignature
Microsoft.CodeAnalysis.CSharp (48)
Binder\Binder_Operators.cs (4)
73
new
BinaryOperatorSignature
(
184
bestSignature = new
BinaryOperatorSignature
(
684
resultSignature = new
BinaryOperatorSignature
(kind, leftType: null, rightType: null, CreateErrorType());
706
resultSignature = new
BinaryOperatorSignature
(kind | BinaryOperatorKind.NullableNull, leftType: null, rightType: null,
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (38)
312
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Delegate, delegateType, delegateType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
318
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Delegate, delegateType, delegateType, delegateType));
485
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumAndUnderlyingAddition, enumType, underlying, enumType));
486
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UnderlyingAndEnumAddition, underlying, enumType, enumType));
487
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumAndUnderlyingAddition, nullableEnum, nullableUnderlying, nullableEnum));
488
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedUnderlyingAndEnumAddition, nullableUnderlying, nullableEnum, nullableEnum));
493
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumSubtraction, enumType, enumType, underlying));
494
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumAndUnderlyingSubtraction, enumType, underlying, enumType));
495
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumSubtraction, nullableEnum, nullableEnum, nullableUnderlying));
496
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumAndUnderlyingSubtraction, nullableEnum, nullableUnderlying, nullableEnum));
506
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumSubtraction, enumType, enumType, underlying)
508
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumAndUnderlyingSubtraction, enumType, underlying, enumType)
510
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumSubtraction, nullableEnum, nullableEnum, nullableUnderlying)
512
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumAndUnderlyingSubtraction, nullableEnum, nullableUnderlying, nullableEnum)
516
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UnderlyingAndEnumSubtraction, underlying, enumType, enumType)
518
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedUnderlyingAndEnumSubtraction, nullableUnderlying, nullableEnum, nullableEnum)
529
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Enum, enumType, enumType, boolean));
530
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Lifted | BinaryOperatorKind.Enum, nullableEnum, nullableEnum, boolean));
535
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Enum, enumType, enumType, enumType));
536
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Lifted | BinaryOperatorKind.Enum, nullableEnum, nullableEnum, nullableEnum));
552
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
553
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndUIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
554
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndLongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
555
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndULongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
556
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.IntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType, pointerType));
557
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UIntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType, pointerType));
558
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType, pointerType));
559
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.ULongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType, pointerType));
562
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
563
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndUIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
564
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndLongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
565
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndULongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
566
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerSubtraction, pointerType, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64)));
584
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Pointer, voidPointerType, voidPointerType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
763
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Object, @object, @object, Compilation.GetSpecialType(SpecialType.System_Boolean)));
950
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UserDefined | kind, leftOperandType, rightOperandType, resultType, op, constrainedToTypeOpt));
967
operators.Add(new
BinaryOperatorSignature
(
973
operators.Add(new
BinaryOperatorSignature
(
Compilation\BuiltInOperators.cs (6)
699
new
BinaryOperatorSignature
(BinaryOperatorKind.Utf8Addition, readonlySpanOfByte, readonlySpanOfByte, readonlySpanOfByte)), null);
717
return new
BinaryOperatorSignature
(kind, left, left, left);
719
return new
BinaryOperatorSignature
(kind, left, RightType(kind), ReturnType(kind));
728
return new
BinaryOperatorSignature
(kind, left, rightType, left);
736
return new
BinaryOperatorSignature
(kind, left, left, _compilation.GetSpecialType(SpecialType.System_Boolean));
738
return new
BinaryOperatorSignature
(kind, left, RightType(kind), ReturnType(kind));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (19)
Semantics\OperatorTests.cs (19)
8161
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Dynamic, leftType, rightType, leftType);
8165
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Dynamic, leftType, rightType, rightType);
8174
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Delegate,
8181
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Delegate,
8187
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Object, compilation.ObjectType, compilation.ObjectType,
8198
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.String, leftType, compilation.ObjectType, leftType);
8203
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.String, compilation.ObjectType, rightType, rightType);
8212
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer, leftType, symbol1.Parameters[1].Type.GetSymbol(), leftType);
8217
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer, symbol1.Parameters[0].Type.GetSymbol(), rightType, rightType);
8224
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.String, leftType, symbol1.Parameters[1].Type.GetSymbol(), leftType);
8229
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer, leftType, rightType, compilation.GetSpecialType(SpecialType.System_Int64));
8236
signature = new
BinaryOperatorSignature
(signature.Kind | BinaryOperatorKind.EnumAndUnderlying, leftType, signature.RightType, leftType);
8243
signature = new
BinaryOperatorSignature
(signature.Kind | BinaryOperatorKind.EnumAndUnderlying, signature.LeftType, rightType, rightType);
8248
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Enum, leftType, rightType, leftType.EnumUnderlyingTypeOrSelf());
8258
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Enum, leftType, rightType, compilation.GetSpecialType(SpecialType.System_Boolean));
8265
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Enum, leftType, rightType, leftType);
8270
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Delegate, leftType, leftType, leftType);
8280
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer,
8829
Assert.Equal(op, new
BinaryOperatorSignature
(op.Kind, op.LeftType, op.RightType, op.ReturnType, op.Method, constrainedToTypeOpt: null));
88 references to BinaryOperatorSignature
Microsoft.CodeAnalysis.CSharp (83)
Binder\Binder_Operators.cs (10)
51
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
94
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
108
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
129
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
176
BinaryOperatorSignature
bestSignature = best.Signature;
579
BinaryOperatorSignature
signature;
670
out
BinaryOperatorSignature
resultSignature, out BinaryOperatorAnalysisResult best)
689
var
signature = best.Signature;
954
BinaryOperatorSignature
signature = best.Signature;
1070
BinaryOperatorSignature
signature,
Binder\Semantics\Operators\BinaryOperatorAnalysisResult.cs (4)
17
public readonly
BinaryOperatorSignature
Signature;
20
private BinaryOperatorAnalysisResult(OperatorAnalysisResultKind kind,
BinaryOperatorSignature
signature, Conversion leftConversion, Conversion rightConversion)
50
public static BinaryOperatorAnalysisResult Applicable(
BinaryOperatorSignature
signature, Conversion leftConversion, Conversion rightConversion)
55
public static BinaryOperatorAnalysisResult Inapplicable(
BinaryOperatorSignature
signature, Conversion leftConversion, Conversion rightConversion)
Binder\Semantics\Operators\BinaryOperatorEasyOut.cs (1)
312
BinaryOperatorSignature
signature = this.Compilation.builtInOperators.GetSignature(easyOut);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (24)
230
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
252
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
306
ArrayBuilder<
BinaryOperatorSignature
> operators)
324
ArrayBuilder<
BinaryOperatorSignature
> operators, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
464
private void GetEnumOperation(BinaryOperatorKind kind, TypeSymbol enumType, BoundExpression right, ArrayBuilder<
BinaryOperatorSignature
> operators)
544
ArrayBuilder<
BinaryOperatorSignature
> operators)
573
ArrayBuilder<
BinaryOperatorSignature
> operators)
589
private void GetEnumOperations(BinaryOperatorKind kind, BoundExpression left, BoundExpression right, ArrayBuilder<
BinaryOperatorSignature
> results)
678
ArrayBuilder<
BinaryOperatorSignature
> results)
712
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
760
private void GetReferenceEquality(BinaryOperatorKind kind, ArrayBuilder<
BinaryOperatorSignature
> operators)
768
ArrayBuilder<
BinaryOperatorSignature
> operators,
775
foreach (
var
op in operators)
802
var
existingSignature = result[i].Signature;
861
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
898
ArrayBuilder<
BinaryOperatorSignature
> operators)
909
var operators2 = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
919
foreach (
BinaryOperatorSignature
signature1 in operators)
936
void getDeclaredOperators(TypeSymbol constrainedToTypeOpt, NamedTypeSymbol type, BinaryOperatorKind kind, string name, ArrayBuilder<
BinaryOperatorSignature
> operators)
954
void addLiftedOperators(TypeSymbol constrainedToTypeOpt, BinaryOperatorKind kind, ArrayBuilder<
BinaryOperatorSignature
> operators)
1154
private BetterResult BetterOperator(
BinaryOperatorSignature
op1,
BinaryOperatorSignature
op2, BoundExpression left, BoundExpression right, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1290
private BetterResult MoreSpecificOperator(
BinaryOperatorSignature
op1,
BinaryOperatorSignature
op2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Operators\BinaryOperatorSignature.cs (10)
14
internal struct BinaryOperatorSignature : IEquatable<
BinaryOperatorSignature
>
16
public static
BinaryOperatorSignature
Error = default(
BinaryOperatorSignature
);
59
public bool Equals(
BinaryOperatorSignature
other)
69
public static bool operator ==(
BinaryOperatorSignature
x,
BinaryOperatorSignature
y)
74
public static bool operator !=(
BinaryOperatorSignature
x,
BinaryOperatorSignature
y)
81
return obj is
BinaryOperatorSignature
&& Equals((
BinaryOperatorSignature
)obj);
BoundTree\Constructors.cs (2)
657
BinaryOperatorSignature
@operator,
671
public BoundCompoundAssignmentOperator Update(
BinaryOperatorSignature
@operator,
Compilation\BuiltInOperators.cs (28)
29
private ImmutableArray<
BinaryOperatorSignature
>[][] _builtInOperators;
30
private StrongBox<
BinaryOperatorSignature
> _builtInUtf8Concatenation;
292
private ImmutableArray<
BinaryOperatorSignature
> GetSignaturesFromBinaryOperatorKinds(int[] operatorKinds)
294
var builder = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
303
internal void GetSimpleBuiltInOperators(BinaryOperatorKind kind, ArrayBuilder<
BinaryOperatorSignature
> operators, bool skipNativeIntegerOperators)
307
var logicalOperators = new ImmutableArray<
BinaryOperatorSignature
>[]
309
ImmutableArray<
BinaryOperatorSignature
>.Empty, //multiplication
310
ImmutableArray<
BinaryOperatorSignature
>.Empty, //addition
311
ImmutableArray<
BinaryOperatorSignature
>.Empty, //subtraction
312
ImmutableArray<
BinaryOperatorSignature
>.Empty, //division
313
ImmutableArray<
BinaryOperatorSignature
>.Empty, //remainder
314
ImmutableArray<
BinaryOperatorSignature
>.Empty, //left shift
315
ImmutableArray<
BinaryOperatorSignature
>.Empty, //right shift
316
ImmutableArray<
BinaryOperatorSignature
>.Empty, //equal
317
ImmutableArray<
BinaryOperatorSignature
>.Empty, //not equal
318
ImmutableArray<
BinaryOperatorSignature
>.Empty, //greater than
319
ImmutableArray<
BinaryOperatorSignature
>.Empty, //less than
320
ImmutableArray<
BinaryOperatorSignature
>.Empty, //greater than or equal
321
ImmutableArray<
BinaryOperatorSignature
>.Empty, //less than or equal
322
ImmutableArray.Create<
BinaryOperatorSignature
>(GetSignature(BinaryOperatorKind.LogicalBoolAnd)), //and
323
ImmutableArray<
BinaryOperatorSignature
>.Empty, //xor
324
ImmutableArray.Create<
BinaryOperatorSignature
>(GetSignature(BinaryOperatorKind.LogicalBoolOr)), //or
325
ImmutableArray<
BinaryOperatorSignature
>.Empty, //unsigned right shift
328
var nonLogicalOperators = new ImmutableArray<
BinaryOperatorSignature
>[]
675
foreach (
var
op in _builtInOperators[kind.IsLogical() ? 1 : 0][kind.OperatorIndex()])
690
internal void GetUtf8ConcatenationBuiltInOperator(TypeSymbol readonlySpanOfByte, ArrayBuilder<
BinaryOperatorSignature
> operators)
698
new StrongBox<
BinaryOperatorSignature
>(
705
internal
BinaryOperatorSignature
GetSignature(BinaryOperatorKind kind)
Compilation\CSharpCompilation.cs (1)
3959
var
signature = this.builtInOperators.GetSignature(easyOutBinaryKind);
Generated\BoundNodes.xml.Generated.cs (3)
1765
public BoundCompoundAssignmentOperator(SyntaxNode syntax,
BinaryOperatorSignature
@operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1785
public
BinaryOperatorSignature
Operator { get; }
1798
public BoundCompoundAssignmentOperator Update(
BinaryOperatorSignature
@operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\NumericIntPtrTests.cs (1)
1550
var builder = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\NativeIntegerTests.cs (1)
4799
var builder = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
Semantics\OperatorTests.cs (3)
3248
"@operator" => ((
BinaryOperatorSignature
)child.Value).Kind.ToString(),
8155
BinaryOperatorSignature
signature;
8826
var
op = visitor.FirstNode.Operator;