1 write to OperatorKind
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
1656this.OperatorKind = operatorKind;
101 references to OperatorKind
Microsoft.CodeAnalysis.CSharp (101)
Binder\Binder.ValueChecks.cs (1)
4211if (binary.OperatorKind == BinaryOperatorKind.Utf8Addition)
Binder\Binder_TupleOperators.cs (1)
111return new TupleBinaryOperatorInfo.Single(binary.Left.Type, binary.Right.Type, binary.OperatorKind, binary.Method, binary.ConstrainedToType,
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
756return value is BoundUtf8String or BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Utf8Addition };
BoundTree\BoundNode_Source.cs (1)
335append(binary.OperatorKind.ToString());
BoundTree\BoundTreeRewriter.cs (1)
146left = binary.Update(binary.OperatorKind, binary.Data, binary.ResultKind, left, right, type);
BoundTree\Constructors.cs (1)
423return Update(OperatorKind, uncommonData, ResultKind, Left, Right, Type);
BoundTree\NullabilityRewriter.cs (1)
58binary.OperatorKind,
CodeGen\EmitExpression.cs (2)
1934Debug.Assert(!b.OperatorKind.IsUserDefined()); 1936if (b.OperatorKind.IsUserDefined() || !isSafeToDereferenceReceiverRefAfterEvaluatingArgument(b.Right))
CodeGen\EmitOperators.cs (16)
60var operatorKind = expression.OperatorKind; 101var operatorKind = binary.OperatorKind; 124operatorKind = binary.OperatorKind; 139bool isChecked = binary.OperatorKind.EmitsAsCheckedInstruction(); 162bool isChecked = expression.OperatorKind.EmitsAsCheckedInstruction(); 177switch (expression.OperatorKind.Operator()) 245throw ExceptionUtilities.UnexpectedValue(expression.OperatorKind.Operator()); 302switch (binOp.OperatorKind.OperatorWithLogical()) 418throw ExceptionUtilities.UnexpectedValue(binOp.OperatorKind.OperatorWithLogical()); 425else if (IsFloat(binOp.OperatorKind)) 496if (IsConditional(binOp.OperatorKind)) 577switch (expression.OperatorKind.Operator() | expression.OperatorKind.OperandTypes()) 628switch (expression.OperatorKind.Operator()) 664throw ExceptionUtilities.UnexpectedValue(expression.OperatorKind.Operator()); 706BinaryOperatorKind opKind = op.OperatorKind;
CodeGen\EmitStatement.cs (8)
230var opKind = condition.OperatorKind.Operator(); 303switch (op.OperatorKind.Operator()) 330throw ExceptionUtilities.UnexpectedValue(op.OperatorKind.Operator()); 337else if (IsFloat(op.OperatorKind)) 424if (binOp.OperatorKind.OperatorWithLogical() is BinaryOperatorKind.LogicalOr or BinaryOperatorKind.LogicalAnd) 445binary.OperatorKind.OperatorWithLogical() is BinaryOperatorKind.LogicalOr or BinaryOperatorKind.LogicalAnd) 447if (binary.OperatorKind.OperatorWithLogical() is BinaryOperatorKind.LogicalOr ? !top.sense : top.sense) 492switch (binOp.OperatorKind.OperatorWithLogical())
CodeGen\Optimizer.cs (5)
1443var isLogical = (binary.OperatorKind & BinaryOperatorKind.Logical) != 0; 1460left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type); 1481var isLogical = (node.OperatorKind & BinaryOperatorKind.Logical) != 0; 1494return node.Update(node.OperatorKind, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type); 2035left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type);
Compilation\CSharpSemanticModel.cs (6)
3830BinaryOperatorKind operandType = binaryOperator.OperatorKind.OperandTypes(); 3831BinaryOperatorKind op = binaryOperator.OperatorKind.Operator(); 3832isDynamic = binaryOperator.OperatorKind.IsDynamic(); 3834if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.OperatorKind.IsLogical()) 3855OperatorFacts.BinaryOperatorNameFromOperatorKind(op, isChecked: binaryOperator.OperatorKind.IsChecked()), 3865binaryOperator.OperatorKind.IsChecked()));
FlowAnalysis\AbstractFlowPass.cs (8)
2194if (node.OperatorKind.IsLogical()) 2196Debug.Assert(!node.OperatorKind.IsUserDefined()); 2233if (!binOp.OperatorKind.IsLogical()) 2238Debug.Assert(!binOp.OperatorKind.IsUserDefined()); 2269kind = binOp.OperatorKind; 2354while (binary != null && !binary.OperatorKind.IsLogical() && binary.InterpolatedStringHandlerData is null); 2431var kind = binary.OperatorKind; 2444=> binary.OperatorKind.Operator() == BinaryOperatorKind.Equal;
FlowAnalysis\NullableWalker.cs (12)
4465&& binary.OperatorKind.Operator() is BinaryOperatorKind.Equal or BinaryOperatorKind.NotEqual) 4536=> binary.OperatorKind.Operator() == BinaryOperatorKind.Equal; 4568if (binary.OperatorKind.Operator() is not (BinaryOperatorKind.Equal or BinaryOperatorKind.NotEqual)) 4592if (binary.OperatorKind.IsUserDefined()) 4646if (binary.OperatorKind.IsUserDefined() && 4651bool isLifted = binary.OperatorKind.IsLifted(); 4728if (binary.OperatorKind.IsLifted() 4729&& binary.OperatorKind.Operator() is BinaryOperatorKind.GreaterThan or BinaryOperatorKind.GreaterThanOrEqual or BinaryOperatorKind.LessThan or BinaryOperatorKind.LessThanOrEqual) 4738var inferredResult = InferResultNullability(binary.OperatorKind, method, binary.Type, leftType, rightType); 4774BinaryOperatorKind op = binary.OperatorKind.Operator(); 10446Debug.Assert(!((BoundBinaryOperator)node).OperatorKind.IsUserDefined()); 10497BoundBinaryOperator binary => InferResultNullability(binary.OperatorKind, binary.Method, binary.Type, leftType, rightType),
Generated\BoundNodes.xml.Generated.cs (3)
1670if (operatorKind != this.OperatorKind || data != this.Data || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) 10642return node.Update(node.OperatorKind, node.Data, node.ResultKind, left, right, type); 14755new TreeDumperNode("operatorKind", node.OperatorKind, null),
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
197return VisitBinaryOperator(binOp.OperatorKind, binOp.Method, binOp.Type, binOp.Left, binOp.Right);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
664if (_inExpressionLambda && node.OperatorKind.IsDynamic())
Lowering\DiagnosticsPass_Warnings.cs (16)
272CheckForBitwiseOrSignExtend(node, node.OperatorKind, node.Left, node.Right); 278if (_inExpressionLambda && node.OperatorKind.Operator() == BinaryOperatorKind.UnsignedRightShift) 308if (!node.OperatorKind.IsComparison()) 327if (node.OperatorKind == BinaryOperatorKind.ObjectEqual || node.OperatorKind == BinaryOperatorKind.ObjectNotEqual) 330if (node.Left.Type.SpecialType == SpecialType.System_Object && !IsExplicitCast(node.Left) && !(node.Left.ConstantValueOpt != null && node.Left.ConstantValueOpt.IsNull) && ConvertedHasEqual(node.OperatorKind, node.Right, out t)) 335else if (node.Right.Type.SpecialType == SpecialType.System_Object && !IsExplicitCast(node.Right) && !(node.Right.ConstantValueOpt != null && node.Right.ConstantValueOpt.IsNull) && ConvertedHasEqual(node.OperatorKind, node.Left, out t)) 384Debug.Assert(node.OperatorKind.IsComparison()); 751if (node.OperatorKind.OperandTypes() != BinaryOperatorKind.NullableNull) 756switch (node.OperatorKind.Operator()) 765string always = node.OperatorKind.Operator() == BinaryOperatorKind.NotEqual ? "true" : "false"; 784if (!node.OperatorKind.IsLifted()) 789switch (node.OperatorKind.Operator()) 814string always = node.OperatorKind.Operator() == BinaryOperatorKind.NotEqual ? "true" : "false"; 818Error(node.OperatorKind.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Left.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Right)); 822Error(node.OperatorKind.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Right.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Left));
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (4)
120if (node.OperatorKind is BinaryOperatorKind.Utf8Addition) 136if (current.InterpolatedStringHandlerData is not null || current.OperatorKind is BinaryOperatorKind.Utf8Addition) 150loweredLeft = MakeBinaryOperator(original, original.Syntax, original.OperatorKind, loweredLeft, loweredRight, original.Type, original.Method, original.ConstrainedToType, 160Debug.Assert(node.OperatorKind == BinaryOperatorKind.StringConcatenation);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
161Debug.Assert(node.OperatorKind is BinaryOperatorKind.Utf8Addition); 189Debug.Assert(utf8Addition.OperatorKind is BinaryOperatorKind.Utf8Addition);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
51if (node.OperatorKind == UnaryOperatorKind.DynamicTrue && binaryOperator.OperatorKind == BinaryOperatorKind.DynamicLogicalOr || 52node.OperatorKind == UnaryOperatorKind.DynamicFalse && binaryOperator.OperatorKind == BinaryOperatorKind.DynamicLogicalAnd)
Lowering\MethodToClassRewriter.cs (1)
266node.OperatorKind,
Lowering\SpillSequenceSpiller.cs (4)
923if (node.OperatorKind == BinaryOperatorKind.LogicalBoolOr || node.OperatorKind == BinaryOperatorKind.LogicalBoolAnd) 929node.OperatorKind == BinaryOperatorKind.LogicalBoolAnd ? _F.Local(tmp) : _F.Not(_F.Local(tmp)), 942return UpdateExpression(builder, node.Update(node.OperatorKind, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type));
Operations\CSharpOperationFactory.cs (3)
1442BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.OperatorKind); 1458bool isLifted = boundBinaryOperator.OperatorKind.IsLifted(); 1459bool isChecked = boundBinaryOperator.OperatorKind.IsChecked() || (boundBinaryOperator.Method is not null && SyntaxFacts.IsCheckedOperator(boundBinaryOperator.Method.Name));