1 write to OperatorKind
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
1690
this.
OperatorKind
= operatorKind;
113 references to OperatorKind
Microsoft.CodeAnalysis.CSharp (113)
Binder\Binder_TupleOperators.cs (2)
111
Debug.Assert(!binary.
OperatorKind
.IsDynamic());
112
return new TupleBinaryOperatorInfo.Single(binary.Left.Type, binary.Right.Type, binary.
OperatorKind
, binary.BinaryOperatorMethod, binary.ConstrainedToType,
Binder\Binder.ValueChecks.cs (1)
5484
if (binary.
OperatorKind
== BinaryOperatorKind.Utf8Addition)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
787
return value is BoundUtf8String or BoundBinaryOperator {
OperatorKind
: BinaryOperatorKind.Utf8Addition };
BoundTree\BoundBinaryOperator.UncommonData.cs (2)
17
if (
OperatorKind
.IsDynamic())
19
Debug.Assert(
OperatorKind
.IsLogical());
BoundTree\BoundExpression.cs (3)
418
public MethodSymbol? BinaryOperatorMethod =>
OperatorKind
.IsDynamic() ? null : Data?.Method;
419
public MethodSymbol? LeftTruthOperatorMethod =>
OperatorKind
.IsDynamic() &&
OperatorKind
.IsLogical() ? Data?.Method : null;
BoundTree\BoundTreeRewriter.cs (2)
252
return node.Update(node.
OperatorKind
, VisitBinaryOperatorData(node), node.ResultKind, (BoundExpression)this.Visit(node.Left), (BoundExpression)this.Visit(node.Right), this.VisitType(node.Type));
282
left = binary.Update(binary.
OperatorKind
, VisitBinaryOperatorData(binary), binary.ResultKind, left, right, type);
BoundTree\Constructors.cs (1)
465
return Update(
OperatorKind
, uncommonData, ResultKind, Left, Right, Type);
BoundTree\NullabilityRewriter.cs (1)
101
binary.
OperatorKind
,
CodeGen\EmitExpression.cs (2)
2205
Debug.Assert(!b.
OperatorKind
.IsUserDefined());
2207
if (b.
OperatorKind
.IsUserDefined() || !isSafeToDereferenceReceiverRefAfterEvaluatingArgument(b.Right))
CodeGen\EmitOperators.cs (17)
60
var operatorKind = expression.
OperatorKind
;
101
var operatorKind = binary.
OperatorKind
;
124
operatorKind = binary.
OperatorKind
;
139
bool isChecked = binary.
OperatorKind
.EmitsAsCheckedInstruction();
162
bool isChecked = expression.
OperatorKind
.EmitsAsCheckedInstruction();
177
switch (expression.
OperatorKind
.Operator())
245
throw ExceptionUtilities.UnexpectedValue(expression.
OperatorKind
.Operator());
302
switch (binOp.
OperatorKind
.OperatorWithLogical())
438
throw ExceptionUtilities.UnexpectedValue(binOp.
OperatorKind
.OperatorWithLogical());
445
else if (IsFloat(binOp.
OperatorKind
))
510
if (IsConditional(binOp.
OperatorKind
))
543
if (binOp.
OperatorKind
.IsComparison())
649
switch (expression.
OperatorKind
.Operator() | expression.
OperatorKind
.OperandTypes())
700
switch (expression.
OperatorKind
.Operator())
736
throw ExceptionUtilities.UnexpectedValue(expression.
OperatorKind
.Operator());
778
BinaryOperatorKind opKind = op.
OperatorKind
;
CodeGen\EmitStatement.cs (8)
230
var opKind = condition.
OperatorKind
.Operator();
303
switch (op.
OperatorKind
.Operator())
330
throw ExceptionUtilities.UnexpectedValue(op.
OperatorKind
.Operator());
337
else if (IsFloat(op.
OperatorKind
))
424
if (binOp.
OperatorKind
.OperatorWithLogical() is BinaryOperatorKind.LogicalOr or BinaryOperatorKind.LogicalAnd)
445
binary.
OperatorKind
.OperatorWithLogical() is BinaryOperatorKind.LogicalOr or BinaryOperatorKind.LogicalAnd)
447
if (binary.
OperatorKind
.OperatorWithLogical() is BinaryOperatorKind.LogicalOr ? !top.sense : top.sense)
492
switch (binOp.
OperatorKind
.OperatorWithLogical())
CodeGen\Optimizer.cs (8)
1521
var isLogical = (binary.
OperatorKind
& BinaryOperatorKind.Logical) != 0;
1538
Debug.Assert(!binary.
OperatorKind
.IsDynamic());
1539
left = binary.Update(binary.
OperatorKind
, binary.ConstantValueOpt, binary.BinaryOperatorMethod, binary.ConstrainedToType, binary.ResultKind, left, right, type);
1560
var isLogical = (node.
OperatorKind
& BinaryOperatorKind.Logical) != 0;
1573
Debug.Assert(!node.
OperatorKind
.IsDynamic());
1574
return node.Update(node.
OperatorKind
, node.ConstantValueOpt, node.BinaryOperatorMethod, node.ConstrainedToType, node.ResultKind, left, right, node.Type);
2162
Debug.Assert(!binary.
OperatorKind
.IsDynamic());
2163
left = binary.Update(binary.
OperatorKind
, binary.ConstantValueOpt, binary.BinaryOperatorMethod, binary.ConstrainedToType, binary.ResultKind, left, right, type);
Compilation\CSharpSemanticModel.cs (6)
3867
BinaryOperatorKind operandType = binaryOperator.
OperatorKind
.OperandTypes();
3868
BinaryOperatorKind op = binaryOperator.
OperatorKind
.Operator();
3869
isDynamic = binaryOperator.
OperatorKind
.IsDynamic();
3871
if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.
OperatorKind
.IsLogical())
3892
OperatorFacts.BinaryOperatorNameFromOperatorKind(op, isChecked: binaryOperator.
OperatorKind
.IsChecked()),
3902
binaryOperator.
OperatorKind
.IsChecked()));
FlowAnalysis\AbstractFlowPass.cs (8)
2394
if (node.
OperatorKind
.IsLogical())
2396
Debug.Assert(!node.
OperatorKind
.IsUserDefined());
2433
if (!binOp.
OperatorKind
.IsLogical())
2438
Debug.Assert(!binOp.
OperatorKind
.IsUserDefined());
2491
kind = binOp.
OperatorKind
;
2576
while (binary != null && !binary.
OperatorKind
.IsLogical() && binary.InterpolatedStringHandlerData is null);
2656
var kind = binary.
OperatorKind
;
2669
=> binary.
OperatorKind
.Operator() == BinaryOperatorKind.Equal;
FlowAnalysis\NullableWalker.cs (8)
5477
&& binary.
OperatorKind
.Operator() is BinaryOperatorKind.Equal or BinaryOperatorKind.NotEqual)
5548
=> binary.
OperatorKind
.Operator() == BinaryOperatorKind.Equal;
5580
if (binary.
OperatorKind
.Operator() is not (BinaryOperatorKind.Equal or BinaryOperatorKind.NotEqual))
5604
if (binary.
OperatorKind
.IsUserDefined())
5668
var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.
OperatorKind
, binary.BinaryOperatorMethod, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType);
5878
BinaryOperatorKind op = binary.
OperatorKind
.Operator();
13089
getBinaryConditionalOperatorInfo(node.
OperatorKind
, out bool isAnd, out bool isBool);
13097
SetResultType(node, InferResultNullability(node.
OperatorKind
, node.BinaryOperatorMethod, node.Type, leftType, rightType));
Generated\BoundNodes.xml.Generated.cs (3)
1708
if (operatorKind != this.
OperatorKind
|| data != this.Data || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
11349
return node.Update(node.
OperatorKind
, node.Data, node.ResultKind, left, right, type);
15813
new TreeDumperNode("operatorKind", node.
OperatorKind
, null),
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (1)
164
Debug.Assert(!node.
OperatorKind
.IsDynamic());
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
199
Debug.Assert(!binOp.
OperatorKind
.IsDynamic());
200
return VisitBinaryOperator(binOp.
OperatorKind
, binOp.BinaryOperatorMethod, binOp.Type, binOp.Left, binOp.Right);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
797
if (_inExpressionLambda && node.
OperatorKind
.IsDynamic())
Lowering\DiagnosticsPass_Warnings.cs (16)
272
CheckForBitwiseOrSignExtend(node, node.
OperatorKind
, node.Left, node.Right);
278
if (_inExpressionLambda && node.
OperatorKind
.Operator() == BinaryOperatorKind.UnsignedRightShift)
307
if (!node.
OperatorKind
.IsComparison())
326
if (node.
OperatorKind
== BinaryOperatorKind.ObjectEqual || node.
OperatorKind
== BinaryOperatorKind.ObjectNotEqual)
329
if (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))
334
else 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))
383
Debug.Assert(node.
OperatorKind
.IsComparison());
750
if (node.
OperatorKind
.OperandTypes() != BinaryOperatorKind.NullableNull)
755
switch (node.
OperatorKind
.Operator())
764
string always = node.
OperatorKind
.Operator() == BinaryOperatorKind.NotEqual ? "true" : "false";
783
if (!node.
OperatorKind
.IsLifted())
788
switch (node.
OperatorKind
.Operator())
813
string always = node.
OperatorKind
.Operator() == BinaryOperatorKind.NotEqual ? "true" : "false";
817
Error(node.
OperatorKind
.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Left.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Right));
821
Error(node.
OperatorKind
.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Right.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Left));
Lowering\ExtensionMethodReferenceRewriter.cs (1)
250
Debug.Assert(!node.
OperatorKind
.IsDynamic());
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (4)
123
if (node.
OperatorKind
is BinaryOperatorKind.Utf8Addition)
145
if (current.InterpolatedStringHandlerData is not null || current.
OperatorKind
is BinaryOperatorKind.Utf8Addition || IsBinaryStringConcatenation(current))
159
loweredLeft = MakeBinaryOperator(original, original.Syntax, original.
OperatorKind
, loweredLeft, loweredRight, original.Type, original.LeftTruthOperatorMethod ?? original.BinaryOperatorMethod, original.ConstrainedToType,
169
Debug.Assert(node.
OperatorKind
== BinaryOperatorKind.StringConcatenation);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
166
Debug.Assert(node.
OperatorKind
is BinaryOperatorKind.Utf8Addition);
194
Debug.Assert(utf8Addition.
OperatorKind
is BinaryOperatorKind.Utf8Addition);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (3)
18
=> binaryOperator is {
OperatorKind
: var kind } && IsBinaryStringConcatenation(kind);
603
SpecialMember member = (current.
OperatorKind
== BinaryOperatorKind.StringConcatenation) ?
610
currentResult = new BoundBinaryOperator(current.Syntax, current.
OperatorKind
, constantValueOpt: null, method, constrainedToTypeOpt: null, default(LookupResultKind), currentResult, right, current.Type);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
52
if (node.OperatorKind == UnaryOperatorKind.DynamicTrue && binaryOperator.
OperatorKind
== BinaryOperatorKind.DynamicLogicalOr ||
53
node.OperatorKind == UnaryOperatorKind.DynamicFalse && binaryOperator.
OperatorKind
== BinaryOperatorKind.DynamicLogicalAnd)
Lowering\SpillSequenceSpiller.cs (5)
994
Debug.Assert(!node.
OperatorKind
.IsDynamic());
1008
if (node.
OperatorKind
== BinaryOperatorKind.LogicalBoolOr || node.
OperatorKind
== BinaryOperatorKind.LogicalBoolAnd)
1014
node.
OperatorKind
== BinaryOperatorKind.LogicalBoolAnd ? _F.Local(tmp) : _F.Not(_F.Local(tmp)),
1027
return UpdateExpression(builder, node.Update(node.
OperatorKind
, node.ConstantValueOpt, node.BinaryOperatorMethod, node.ConstrainedToType, node.ResultKind, left, right, node.Type));
Operations\CSharpOperationFactory.cs (3)
1584
BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.
OperatorKind
);
1591
bool isLifted = boundBinaryOperator.
OperatorKind
.IsLifted();
1592
bool isChecked = boundBinaryOperator.
OperatorKind
.IsChecked() || (binaryOperatorMethod is not null && SyntaxFacts.IsCheckedOperator(binaryOperatorMethod.Name));