1 write to OperatorKind
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
1668this.OperatorKind = operatorKind;
96 references to OperatorKind
Microsoft.CodeAnalysis.CSharp (96)
Binder\Binder.ValueChecks.cs (1)
5218if (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)
774return value is BoundUtf8String or BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Utf8Addition };
BoundTree\BoundNode_Source.cs (1)
356append(binary.OperatorKind.ToString());
BoundTree\BoundTreeRewriter.cs (1)
145left = binary.Update(binary.OperatorKind, binary.Data, binary.ResultKind, left, right, type);
BoundTree\Constructors.cs (1)
480return Update(OperatorKind, uncommonData, ResultKind, Left, Right, Type);
BoundTree\NullabilityRewriter.cs (1)
101binary.OperatorKind,
CodeGen\EmitConversion.cs (1)
160(fromPredefTypeKind == Cci.PrimitiveTypeCode.IntPtr && conversion.Operand is BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Division })); // pointer subtraction: see LocalRewriter.RewritePointerSubtraction()
CodeGen\EmitExpression.cs (2)
2154Debug.Assert(!b.OperatorKind.IsUserDefined()); 2156if (b.OperatorKind.IsUserDefined() || !isSafeToDereferenceReceiverRefAfterEvaluatingArgument(b.Right))
CodeGen\EmitOperators.cs (17)
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()) 438throw ExceptionUtilities.UnexpectedValue(binOp.OperatorKind.OperatorWithLogical()); 445else if (IsFloat(binOp.OperatorKind)) 510if (IsConditional(binOp.OperatorKind)) 543if (binOp.OperatorKind.IsComparison()) 649switch (expression.OperatorKind.Operator() | expression.OperatorKind.OperandTypes()) 700switch (expression.OperatorKind.Operator()) 736throw ExceptionUtilities.UnexpectedValue(expression.OperatorKind.Operator()); 778BinaryOperatorKind 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)
1510var isLogical = (binary.OperatorKind & BinaryOperatorKind.Logical) != 0; 1527left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type); 1548var isLogical = (node.OperatorKind & BinaryOperatorKind.Logical) != 0; 1561return node.Update(node.OperatorKind, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type); 2102left = binary.Update(binary.OperatorKind, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type);
Compilation\CSharpSemanticModel.cs (6)
3842BinaryOperatorKind operandType = binaryOperator.OperatorKind.OperandTypes(); 3843BinaryOperatorKind op = binaryOperator.OperatorKind.Operator(); 3844isDynamic = binaryOperator.OperatorKind.IsDynamic(); 3846if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.OperatorKind.IsLogical()) 3867OperatorFacts.BinaryOperatorNameFromOperatorKind(op, isChecked: binaryOperator.OperatorKind.IsChecked()), 3877binaryOperator.OperatorKind.IsChecked()));
FlowAnalysis\AbstractFlowPass.cs (8)
2386if (node.OperatorKind.IsLogical()) 2388Debug.Assert(!node.OperatorKind.IsUserDefined()); 2425if (!binOp.OperatorKind.IsLogical()) 2430Debug.Assert(!binOp.OperatorKind.IsUserDefined()); 2461kind = binOp.OperatorKind; 2546while (binary != null && !binary.OperatorKind.IsLogical() && binary.InterpolatedStringHandlerData is null); 2623var kind = binary.OperatorKind; 2636=> binary.OperatorKind.Operator() == BinaryOperatorKind.Equal;
FlowAnalysis\NullableWalker.cs (5)
4963=> binary.OperatorKind.Operator() == BinaryOperatorKind.Equal; 5067var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.OperatorKind, binary.Method, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType); 5220BinaryOperatorKind op = binary.OperatorKind.Operator(); 11367Debug.Assert(!((BoundBinaryOperator)node).OperatorKind.IsUserDefined()); 11418BoundBinaryOperator binary => InferResultNullability(binary.OperatorKind, binary.Method, binary.Type, leftType, rightType),
Generated\BoundNodes.xml.Generated.cs (3)
1682if (operatorKind != this.OperatorKind || data != this.Data || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) 11021return node.Update(node.OperatorKind, node.Data, node.ResultKind, left, right, type); 15292new TreeDumperNode("operatorKind", node.OperatorKind, null),
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
195return VisitBinaryOperator(binOp.OperatorKind, binOp.Method, binOp.Type, binOp.Left, binOp.Right);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
729if (_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)
122if (node.OperatorKind is BinaryOperatorKind.Utf8Addition) 138if (current.InterpolatedStringHandlerData is not null || current.OperatorKind is BinaryOperatorKind.Utf8Addition) 152loweredLeft = MakeBinaryOperator(original, original.Syntax, original.OperatorKind, loweredLeft, loweredRight, original.Type, original.Method, original.ConstrainedToType, 162Debug.Assert(node.OperatorKind == BinaryOperatorKind.StringConcatenation);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
168Debug.Assert(node.OperatorKind is BinaryOperatorKind.Utf8Addition); 196Debug.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)
271node.OperatorKind,
Lowering\SpillSequenceSpiller.cs (4)
994if (node.OperatorKind == BinaryOperatorKind.LogicalBoolOr || node.OperatorKind == BinaryOperatorKind.LogicalBoolAnd) 1000node.OperatorKind == BinaryOperatorKind.LogicalBoolAnd ? _F.Local(tmp) : _F.Not(_F.Local(tmp)), 1013return UpdateExpression(builder, node.Update(node.OperatorKind, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type));
Operations\CSharpOperationFactory.cs (3)
1509BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.OperatorKind); 1525bool isLifted = boundBinaryOperator.OperatorKind.IsLifted(); 1526bool isChecked = boundBinaryOperator.OperatorKind.IsChecked() || (boundBinaryOperator.Method is not null && SyntaxFacts.IsCheckedOperator(boundBinaryOperator.Method.Name));