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