1 implementation of OperatorKind
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5657public BinaryOperatorKind OperatorKind { get; }
91 references to OperatorKind
ILLink.RoslynAnalyzer (2)
DataFlow\FeatureChecksVisitor.cs (1)
99 switch (operation.OperatorKind) {
TrimAnalysis\TrimAnalysisVisitor.cs (1)
186 operation.OperatorKind == BinaryOperatorKind.Or &&
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (2)
139if (binaryOperation.OperatorKind == BinaryOperatorKind.Equals) 145else if (binaryOperation.OperatorKind == BinaryOperatorKind.NotEquals)
Microsoft.CodeAnalysis (4)
Operations\ControlFlowGraphBuilder.cs (4)
2154switch (operation.OperatorKind) 2230leftOperand = PopStackFrame(frame, new BinaryOperation(operation.OperatorKind, PopOperand(), rightOperand, operation.IsLifted, operation.IsChecked, operation.IsCompareText, 2271switch (binOp.OperatorKind) 2281throw ExceptionUtilities.UnexpectedValue(binOp.OperatorKind);
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
99if (binary.OperatorKind == BinaryOperatorKind.Equals) 105else if (binary.OperatorKind == BinaryOperatorKind.NotEquals)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
65if (operation.OperatorKind is not (BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals)) 68var isOperatorEquals = operation.OperatorKind == BinaryOperatorKind.Equals;
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
220if (binaryOperator.OperatorKind != BinaryOperatorKind.Equals)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
153if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 159&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 167if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
57binaryOperation.OperatorKind == BinaryOperatorKind.Subtract)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsAnalyzer.cs (7)
44case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 47case IBinaryOperation { OperatorKind: NotEquals } op: 50case IBinaryOperation { OperatorKind: ConditionalOr, Syntax: BinaryExpressionSyntax syntax } op: 53case IBinaryOperation { OperatorKind: ConditionalAnd, Syntax: BinaryExpressionSyntax syntax } op: 56case IBinaryOperation op when IsRelationalOperator(op.OperatorKind): 106=> new Relational(Flip(op.OperatorKind), left, op.RightOperand), 108=> new Relational(op.OperatorKind, right, op.LeftOperand),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
919ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.RightOperand)) 926ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.LeftOperand))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (8)
158OperatorKind: BinaryOperatorKind.Equals, 668return binOp.OperatorKind == expectedKind && 739(true, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalAnd } andOp) 746(false, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalOr } orOp) 753OperatorKind: BinaryOperatorKind.Equals, 761OperatorKind: BinaryOperatorKind.NotEquals, 805OperatorKind: BinaryOperatorKind.ConditionalAnd, 817OperatorKind: BinaryOperatorKind.ConditionalOr,
Microsoft.CodeAnalysis.CSharp.Features (16)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
57binaryOperation.OperatorKind == BinaryOperatorKind.Subtract)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsAnalyzer.cs (7)
44case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 47case IBinaryOperation { OperatorKind: NotEquals } op: 50case IBinaryOperation { OperatorKind: ConditionalOr, Syntax: BinaryExpressionSyntax syntax } op: 53case IBinaryOperation { OperatorKind: ConditionalAnd, Syntax: BinaryExpressionSyntax syntax } op: 56case IBinaryOperation op when IsRelationalOperator(op.OperatorKind): 106=> new Relational(Flip(op.OperatorKind), left, op.RightOperand), 108=> new Relational(op.OperatorKind, right, op.LeftOperand),
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (8)
158OperatorKind: BinaryOperatorKind.Equals, 668return binOp.OperatorKind == expectedKind && 739(true, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalAnd } andOp) 746(false, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalOr } orOp) 753OperatorKind: BinaryOperatorKind.Equals, 761OperatorKind: BinaryOperatorKind.NotEquals, 805OperatorKind: BinaryOperatorKind.ConditionalAnd, 817OperatorKind: BinaryOperatorKind.ConditionalOr,
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
919ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.RightOperand)) 926ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.LeftOperand))
Microsoft.CodeAnalysis.Features (14)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (9)
207if (operation is IBinaryOperation { OperatorKind: ConditionalOr } op) 280case IBinaryOperation { OperatorKind: ConditionalAnd } op 284case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 294case IBinaryOperation { OperatorKind: NotEquals } op 299when Supports(Feature.RelationalPattern) && IsRelationalOperator(op.OperatorKind): 304case IBinaryOperation { OperatorKind: ConditionalAnd } op 351=> new AnalyzedPattern.Relational(Flip(op.OperatorKind), left), 353=> new AnalyzedPattern.Relational(op.OperatorKind, right), 397return op.OperatorKind switch
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
99if (binary.OperatorKind == BinaryOperatorKind.Equals) 105else if (binary.OperatorKind == BinaryOperatorKind.NotEquals)
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (2)
65if (operation.OperatorKind is not (BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals)) 68var isOperatorEquals = operation.OperatorKind == BinaryOperatorKind.Equals;
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
220if (binaryOperator.OperatorKind != BinaryOperatorKind.Equals)
Microsoft.CodeAnalysis.Test.Utilities (18)
Compilation\ControlFlowGraphVerifier.cs (6)
947(binOp.OperatorKind == Operations.BinaryOperatorKind.And || binOp.OperatorKind == Operations.BinaryOperatorKind.Or) && 973binOp.OperatorKind == Operations.BinaryOperatorKind.And && 980binOp.OperatorKind == Operations.BinaryOperatorKind.Or && 1876return (binary.OperatorKind != Operations.BinaryOperatorKind.ConditionalAnd && binary.OperatorKind != Operations.BinaryOperatorKind.ConditionalOr) ||
Compilation\OperationTreeVerifier.cs (1)
1190var kindStr = $"{nameof(BinaryOperatorKind)}.{operation.OperatorKind}";
Compilation\TestOperationVisitor.cs (1)
766var binaryOperationKind = operation.OperatorKind;
Diagnostics\OperationTestAnalyzer.cs (10)
204(condition.OperatorKind == BinaryOperatorKind.LessThan || 205condition.OperatorKind == BinaryOperatorKind.LessThanOrEqual || 206condition.OperatorKind == BinaryOperatorKind.NotEquals || 207condition.OperatorKind == BinaryOperatorKind.GreaterThan || 208condition.OperatorKind == BinaryOperatorKind.GreaterThanOrEqual)) 254advanceOperationCode = advanceOperation.OperatorKind; 1516if (binary.OperatorKind == BinaryOperatorKind.Add && binary.OperatorMethod != null && binary.OperatorMethod.Name.Contains("Addition")) 1521if (binary.OperatorKind == BinaryOperatorKind.Multiply && binary.Type.SpecialType == SpecialType.System_Double) 1575binary.OperatorKind.ToString())); 1628binary.OperatorKind.ToString()));
Microsoft.CodeAnalysis.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
153if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 159&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 167if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (2)
IOperation\IOperationTests.vb (2)
67Assert.Equal(add1.OperatorKind, Operations.BinaryOperatorKind.Add) 100Assert.Equal(add2.OperatorKind, Operations.BinaryOperatorKind.Add)