72 instantiations of BinaryOperatorSignature
Microsoft.CodeAnalysis.CSharp (53)
Binder\Binder_Operators.cs (6)
78
new
BinaryOperatorSignature
(
249
bestSignature = new
BinaryOperatorSignature
(
502
new
BinaryOperatorSignature
(
1114
resultSignature = new
BinaryOperatorSignature
(kind, leftType: null, rightType: null, CreateErrorType());
1147
resultSignature = new
BinaryOperatorSignature
(kind, leftType: null, rightType: null, CreateErrorType());
1175
resultSignature = new
BinaryOperatorSignature
(kind | BinaryOperatorKind.NullableNull, leftType: null, rightType: null,
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (40)
325
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Delegate, delegateType, delegateType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
331
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Delegate, delegateType, delegateType, delegateType));
497
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumAndUnderlyingAddition, enumType, underlying, enumType));
498
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UnderlyingAndEnumAddition, underlying, enumType, enumType));
499
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumAndUnderlyingAddition, nullableEnum, nullableUnderlying, nullableEnum));
500
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedUnderlyingAndEnumAddition, nullableUnderlying, nullableEnum, nullableEnum));
505
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumSubtraction, enumType, enumType, underlying));
506
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumAndUnderlyingSubtraction, enumType, underlying, enumType));
507
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumSubtraction, nullableEnum, nullableEnum, nullableUnderlying));
508
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumAndUnderlyingSubtraction, nullableEnum, nullableUnderlying, nullableEnum));
518
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumSubtraction, enumType, enumType, underlying)
520
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.EnumAndUnderlyingSubtraction, enumType, underlying, enumType)
522
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumSubtraction, nullableEnum, nullableEnum, nullableUnderlying)
524
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedEnumAndUnderlyingSubtraction, nullableEnum, nullableUnderlying, nullableEnum)
528
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UnderlyingAndEnumSubtraction, underlying, enumType, enumType)
530
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LiftedUnderlyingAndEnumSubtraction, nullableUnderlying, nullableEnum, nullableEnum)
541
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Enum, enumType, enumType, boolean));
542
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Lifted | BinaryOperatorKind.Enum, nullableEnum, nullableEnum, boolean));
547
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Enum, enumType, enumType, enumType));
548
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Lifted | BinaryOperatorKind.Enum, nullableEnum, nullableEnum, nullableEnum));
564
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
565
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndUIntAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
566
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndLongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
567
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndULongAddition, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
568
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.IntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType, pointerType));
569
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UIntAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType, pointerType));
570
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.LongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType, pointerType));
571
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.ULongAndPointerAddition, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType, pointerType));
574
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int32), pointerType));
575
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndUIntSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt32), pointerType));
576
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndLongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64), pointerType));
577
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerAndULongSubtraction, pointerType, Compilation.GetSpecialType(SpecialType.System_UInt64), pointerType));
578
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.PointerSubtraction, pointerType, pointerType, Compilation.GetSpecialType(SpecialType.System_Int64)));
596
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Pointer, voidPointerType, voidPointerType, Compilation.GetSpecialType(SpecialType.System_Boolean)));
799
operators.Add(new
BinaryOperatorSignature
(kind | BinaryOperatorKind.Object, @object, @object, Compilation.GetSpecialType(SpecialType.System_Boolean)));
1016
operators.Add(new
BinaryOperatorSignature
(BinaryOperatorKind.UserDefined | kind, leftOperandType, rightOperandType, resultType, op, constrainedToTypeOpt));
1033
operators.Add(new
BinaryOperatorSignature
(
1039
operators.Add(new
BinaryOperatorSignature
(
1559
inferredCandidate = new
BinaryOperatorSignature
(
1568
inferredCandidate = new
BinaryOperatorSignature
(BinaryOperatorKind.UserDefined | kind, leftOperandType, rightOperandType, resultType, method, constrainedToTypeOpt: null);
BoundTree\NullabilityRewriter.cs (1)
152
op = new
BinaryOperatorSignature
(op.Kind, op.LeftType, op.RightType, op.ReturnType, GetUpdatedSymbol(node, op.Method), op.ConstrainedToTypeOpt);
Compilation\BuiltInOperators.cs (6)
696
static readonlySpanOfByte => new
BinaryOperatorSignature
(BinaryOperatorKind.Utf8Addition, readonlySpanOfByte, readonlySpanOfByte, readonlySpanOfByte),
714
return new
BinaryOperatorSignature
(kind, left, left, left);
716
return new
BinaryOperatorSignature
(kind, left, RightType(kind), ReturnType(kind));
725
return new
BinaryOperatorSignature
(kind, left, rightType, left);
733
return new
BinaryOperatorSignature
(kind, left, left, _compilation.GetSpecialType(SpecialType.System_Boolean));
735
return new
BinaryOperatorSignature
(kind, left, RightType(kind), ReturnType(kind));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (19)
Semantics\OperatorTests.cs (19)
8163
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Dynamic, leftType, rightType, leftType);
8167
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Dynamic, leftType, rightType, rightType);
8176
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Delegate,
8183
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Delegate,
8189
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Object, compilation.ObjectType, compilation.ObjectType,
8200
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.String, leftType, compilation.ObjectType, leftType);
8205
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.String, compilation.ObjectType, rightType, rightType);
8214
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer, leftType, symbol1.Parameters[1].Type.GetSymbol(), leftType);
8219
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer, symbol1.Parameters[0].Type.GetSymbol(), rightType, rightType);
8226
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.String, leftType, symbol1.Parameters[1].Type.GetSymbol(), leftType);
8231
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer, leftType, rightType, compilation.GetSpecialType(SpecialType.System_Int64));
8238
signature = new
BinaryOperatorSignature
(signature.Kind | BinaryOperatorKind.EnumAndUnderlying, leftType, signature.RightType, leftType);
8245
signature = new
BinaryOperatorSignature
(signature.Kind | BinaryOperatorKind.EnumAndUnderlying, signature.LeftType, rightType, rightType);
8250
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Enum, leftType, rightType, leftType.EnumUnderlyingTypeOrSelf());
8260
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Enum, leftType, rightType, compilation.GetSpecialType(SpecialType.System_Boolean));
8267
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Enum, leftType, rightType, leftType);
8272
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Delegate, leftType, leftType, leftType);
8282
signature = new
BinaryOperatorSignature
(op | BinaryOperatorKind.Pointer,
8831
Assert.Equal(op, new
BinaryOperatorSignature
(op.Kind, op.LeftType, op.RightType, op.ReturnType, op.Method, constrainedToTypeOpt: null));
106 references to BinaryOperatorSignature
Microsoft.CodeAnalysis.CSharp (101)
Binder\Binder_Operators.cs (14)
54
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
99
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
113
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
241
BinaryOperatorSignature
bestSignature = best.Signature;
327
return new BoundCompoundAssignmentOperator(node,
BinaryOperatorSignature
.Error, left, right,
529
BinaryOperatorSignature
.Error,
985
BinaryOperatorSignature
signature;
1107
out
BinaryOperatorSignature
resultSignature, out BinaryOperatorAnalysisResult best)
1132
out
BinaryOperatorSignature
resultSignature,
1152
var
signature = best.Signature;
1456
BinaryOperatorSignature
signature = best.Signature;
1624
BinaryOperatorSignature
signature,
1643
BinaryOperatorSignature
signature,
1810
BinaryOperatorSignature
signature,
Binder\Semantics\Operators\BinaryOperatorAnalysisResult.cs (4)
18
public readonly
BinaryOperatorSignature
Signature;
21
private BinaryOperatorAnalysisResult(OperatorAnalysisResultKind kind,
BinaryOperatorSignature
signature, Conversion leftConversion, Conversion rightConversion)
54
public static BinaryOperatorAnalysisResult Applicable(
BinaryOperatorSignature
signature, Conversion leftConversion, Conversion rightConversion)
59
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 (37)
243
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
265
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
319
ArrayBuilder<
BinaryOperatorSignature
> operators)
337
ArrayBuilder<
BinaryOperatorSignature
> operators, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
477
private void GetEnumOperation(BinaryOperatorKind kind, TypeSymbol enumType, BoundExpression right, ArrayBuilder<
BinaryOperatorSignature
> operators)
556
ArrayBuilder<
BinaryOperatorSignature
> operators)
585
ArrayBuilder<
BinaryOperatorSignature
> operators)
601
private void GetEnumOperations(BinaryOperatorKind kind, BoundExpression left, BoundExpression right, ArrayBuilder<
BinaryOperatorSignature
> results)
690
ArrayBuilder<
BinaryOperatorSignature
> results)
724
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
737
BinaryOperatorSignature
op = operators[0];
796
private void GetReferenceEquality(BinaryOperatorKind kind, ArrayBuilder<
BinaryOperatorSignature
> operators)
804
ArrayBuilder<
BinaryOperatorSignature
> operators,
811
foreach (
var
op in operators)
838
var
existingSignature = result[i].Signature;
899
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
953
ArrayBuilder<
BinaryOperatorSignature
> operators)
961
var operators2 = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
971
foreach (
BinaryOperatorSignature
signature1 in operators)
989
private static void GetDeclaredUserDefinedBinaryOperators(TypeSymbol? constrainedToTypeOpt, NamedTypeSymbol type, BinaryOperatorKind kind, string name, ArrayBuilder<
BinaryOperatorSignature
> operators)
997
private static void GetDeclaredUserDefinedBinaryOperators(TypeSymbol? constrainedToTypeOpt, ArrayBuilder<MethodSymbol> typeOperators, BinaryOperatorKind kind, string name, ArrayBuilder<
BinaryOperatorSignature
> operators)
1020
void AddLiftedUserDefinedBinaryOperators(TypeSymbol? constrainedToTypeOpt, BinaryOperatorKind kind, ArrayBuilder<
BinaryOperatorSignature
> operators)
1223
private BetterResult BetterOperator(
BinaryOperatorSignature
op1,
BinaryOperatorSignature
op2, BoundExpression left, BoundExpression right, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1372
private BetterResult MoreSpecificOperator(
BinaryOperatorSignature
op1,
BinaryOperatorSignature
op2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1444
var operators = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
1472
static void getDeclaredUserDefinedBinaryOperatorsInScope(ArrayBuilder<Symbol> extensionCandidatesInSingleScope, BinaryOperatorKind kind, string name1, string? name2Opt, ArrayBuilder<
BinaryOperatorSignature
> operators)
1483
var operators2 = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
1486
foreach (
var
op in operators2)
1503
static void getDeclaredUserDefinedBinaryOperators(ArrayBuilder<Symbol> extensionCandidatesInSingleScope, BinaryOperatorKind kind, string name, ArrayBuilder<
BinaryOperatorSignature
> operators)
1512
void inferTypeArgumentsAndRemoveInapplicableToReceiverType(BinaryOperatorKind kind, BoundExpression left, BoundExpression right, ArrayBuilder<
BinaryOperatorSignature
> operators, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1516
var
candidate = operators[i];
1552
BinaryOperatorSignature
inferredCandidate;
1586
bool isApplicableToReceiver(in
BinaryOperatorSignature
candidate, BoundExpression left, BoundExpression right, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1603
static bool parameterMatchesReceiver(in
BinaryOperatorSignature
candidate, int paramIndex)
1612
bool isOperandApplicableToReceiver(in
BinaryOperatorSignature
candidate, BoundExpression operand, 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)
650
BinaryOperatorSignature
@operator,
664
public BoundCompoundAssignmentOperator Update(
BinaryOperatorSignature
@operator,
BoundTree\NullabilityRewriter.cs (1)
148
var
op = node.Operator;
Compilation\BuiltInOperators.cs (28)
29
private ImmutableArray<
BinaryOperatorSignature
>[][] _builtInOperators;
30
private SingleInitNullable<
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)
695
var
utfConcatenation = _builtInUtf8Concatenation.Initialize(
702
internal
BinaryOperatorSignature
GetSignature(BinaryOperatorKind kind)
Compilation\CSharpCompilation.cs (1)
4364
var
signature = this.BuiltInOperators.GetSignature(easyOutBinaryKind);
Generated\BoundNodes.xml.Generated.cs (3)
1767
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)
1787
public
BinaryOperatorSignature
Operator { get; }
1800
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)
1590
var builder = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\NativeIntegerTests.cs (1)
4830
var builder = ArrayBuilder<
BinaryOperatorSignature
>.GetInstance();
Semantics\OperatorTests.cs (3)
3249
"@operator" => ((
BinaryOperatorSignature
)child.Value).Kind.ToString(),
8157
BinaryOperatorSignature
signature;
8828
var
op = visitor.FirstNode.Operator;