1 implementation of OperatorKind
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5697public BinaryOperatorKind OperatorKind { get; }
130 references to OperatorKind
GenerateDocumentationAndConfigFiles (5)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
245=> binaryOperation.OperatorKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
149if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 155&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 163if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
ILLink.RoslynAnalyzer (2)
DataFlow\FeatureChecksVisitor.cs (1)
100switch (operation.OperatorKind)
TrimAnalysis\TrimAnalysisVisitor.cs (1)
200operation.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)
2164switch (operation.OperatorKind) 2240leftOperand = PopStackFrame(frame, new BinaryOperation(operation.OperatorKind, PopOperand(), rightOperand, operation.IsLifted, operation.IsChecked, operation.IsCompareText, 2281switch (binOp.OperatorKind) 2291throw ExceptionUtilities.UnexpectedValue(binOp.OperatorKind);
Microsoft.CodeAnalysis.Analyzers (13)
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (1)
128if (binary.OperatorKind is not BinaryOperatorKind.Equals and not BinaryOperatorKind.NotEquals)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (1)
280if (binaryOperation.OperatorKind == BinaryOperatorKind.NotEquals)
MetaAnalyzers\PreferIsKindAnalyzer.cs (1)
73if (operation.OperatorKind is not (BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (1)
208countBinaryOperator(operation, ((IBinaryOperation)operation).OperatorKind);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (4)
337return binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalAnd || 338binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalOr || 340(binaryOperation.OperatorKind == BinaryOperatorKind.Or || binaryOperation.OperatorKind == BinaryOperatorKind.And));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
245=> binaryOperation.OperatorKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
149if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 155&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 163if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
Microsoft.CodeAnalysis.AnalyzerUtilities (17)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (1)
208countBinaryOperator(operation, ((IBinaryOperation)operation).OperatorKind);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (4)
337return binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalAnd || 338binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalOr || 340(binaryOperation.OperatorKind == BinaryOperatorKind.Or || binaryOperation.OperatorKind == BinaryOperatorKind.And));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
245=> binaryOperation.OperatorKind switch
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (4)
453(operation.OperatorKind == BinaryOperatorKind.Equals || operation.OperatorKind == BinaryOperatorKind.ObjectValueEquals); 461(operation.OperatorKind == BinaryOperatorKind.NotEquals || operation.OperatorKind == BinaryOperatorKind.ObjectValueNotEquals);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (4)
396(operation.OperatorKind == BinaryOperatorKind.NotEquals || operation.OperatorKind == BinaryOperatorKind.ObjectValueNotEquals); 404(operation.OperatorKind == BinaryOperatorKind.Equals || operation.OperatorKind == BinaryOperatorKind.ObjectValueEquals);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.ValueContentDataFlowOperationVisitor.cs (1)
228return leftValue.MergeBinaryOperation(rightValue, operation.OperatorKind, operation.LeftOperand.Type, operation.RightOperand.Type, operation.Type);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (1)
1870switch (operation.OperatorKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
Microsoft.CodeAnalysis.CodeStyle (7)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
99if (binary.OperatorKind == BinaryOperatorKind.Equals) 105else if (binary.OperatorKind == BinaryOperatorKind.NotEquals)
src\roslyn\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\roslyn\src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
163if (current is IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals } binaryOperation)
src\roslyn\src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
219if (binaryOperator.OperatorKind != BinaryOperatorKind.Equals)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
149if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 155&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 163if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
55if (operation is IBinaryOperation { OperatorKind: BinaryOperatorKind.Subtract } binaryOperation)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsAnalyzer.cs (7)
43case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 46case IBinaryOperation { OperatorKind: NotEquals } op: 49case IBinaryOperation { OperatorKind: ConditionalOr, Syntax: BinaryExpressionSyntax syntax } op: 52case IBinaryOperation { OperatorKind: ConditionalAnd, Syntax: BinaryExpressionSyntax syntax } op: 55case IBinaryOperation op when IsRelationalOperator(op.OperatorKind): 105=> new Relational(Flip(op.OperatorKind), left, op.RightOperand), 107=> new Relational(op.OperatorKind, right, op.LeftOperand),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1071ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.RightOperand)) 1078ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.LeftOperand))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (8)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (8)
158OperatorKind: BinaryOperatorKind.Equals, 667return binOp.OperatorKind == expectedKind && 738(true, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalAnd } andOp) 745(false, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalOr } orOp) 752OperatorKind: BinaryOperatorKind.Equals, 760OperatorKind: BinaryOperatorKind.NotEquals, 804OperatorKind: BinaryOperatorKind.ConditionalAnd, 816OperatorKind: BinaryOperatorKind.ConditionalOr,
Microsoft.CodeAnalysis.CSharp.Features (16)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
55if (operation is IBinaryOperation { OperatorKind: BinaryOperatorKind.Subtract } binaryOperation)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsAnalyzer.cs (7)
43case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 46case IBinaryOperation { OperatorKind: NotEquals } op: 49case IBinaryOperation { OperatorKind: ConditionalOr, Syntax: BinaryExpressionSyntax syntax } op: 52case IBinaryOperation { OperatorKind: ConditionalAnd, Syntax: BinaryExpressionSyntax syntax } op: 55case IBinaryOperation op when IsRelationalOperator(op.OperatorKind): 105=> new Relational(Flip(op.OperatorKind), left, op.RightOperand), 107=> new Relational(op.OperatorKind, right, op.LeftOperand),
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (8)
158OperatorKind: BinaryOperatorKind.Equals, 667return binOp.OperatorKind == expectedKind && 738(true, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalAnd } andOp) 745(false, IBinaryOperation { OperatorKind: BinaryOperatorKind.ConditionalOr } orOp) 752OperatorKind: BinaryOperatorKind.Equals, 760OperatorKind: BinaryOperatorKind.NotEquals, 804OperatorKind: BinaryOperatorKind.ConditionalAnd, 816OperatorKind: BinaryOperatorKind.ConditionalOr,
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpUseSpanBasedStringConcat.cs (1)
21return operation.OperatorKind == BinaryOperatorKind.Add &&
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1071ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.RightOperand)) 1078ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.LeftOperand))
Microsoft.CodeAnalysis.Features (16)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (9)
209if (operation is IBinaryOperation { OperatorKind: ConditionalOr } op) 282case IBinaryOperation { OperatorKind: ConditionalAnd } op 286case IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals } op: 296case IBinaryOperation { OperatorKind: NotEquals } op 301when Supports(Feature.RelationalPattern) && IsRelationalOperator(op.OperatorKind): 306case IBinaryOperation { OperatorKind: ConditionalAnd } op 353=> new AnalyzedPattern.Relational(Flip(op.OperatorKind), left), 355=> new AnalyzedPattern.Relational(op.OperatorKind, right), 399return op.OperatorKind switch
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
307if (condition is IBinaryOperation { OperatorKind: BinaryOperatorKind.LessThan or BinaryOperatorKind.LessThanOrEqual or BinaryOperatorKind.GreaterThan or BinaryOperatorKind.GreaterThanOrEqual } binaryOperator &&
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
99if (binary.OperatorKind == BinaryOperatorKind.Equals) 105else if (binary.OperatorKind == BinaryOperatorKind.NotEquals)
src\roslyn\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\roslyn\src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
163if (current is IBinaryOperation { OperatorKind: BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals } binaryOperation)
src\roslyn\src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (1)
219if (binaryOperator.OperatorKind != BinaryOperatorKind.Equals)
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (1)
208countBinaryOperator(operation, ((IBinaryOperation)operation).OperatorKind);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (4)
337return binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalAnd || 338binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalOr || 340(binaryOperation.OperatorKind == BinaryOperatorKind.Or || binaryOperation.OperatorKind == BinaryOperatorKind.And));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
245=> binaryOperation.OperatorKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\BasicUseSpanBasedStringConcat.vb (1)
30Return operation.OperatorKind = BinaryOperatorKind.Concatenate
Microsoft.CodeAnalysis.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
149if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 155&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 163if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
Roslyn.Diagnostics.Analyzers (10)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\ComputationalComplexityMetrics.cs (1)
208countBinaryOperator(operation, ((IBinaryOperation)operation).OperatorKind);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (4)
337return binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalAnd || 338binaryOperation.OperatorKind == BinaryOperatorKind.ConditionalOr || 340(binaryOperation.OperatorKind == BinaryOperatorKind.Or || binaryOperation.OperatorKind == BinaryOperatorKind.And));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
245=> binaryOperation.OperatorKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (1)
86return op.OperatorKind is BinaryOperatorKind.Add or
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
149if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind)) 155&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or 163if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1071ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.RightOperand)) 1078ConvertedHasUserDefinedEquals(binaryOperation.OperatorKind, binaryOperation.LeftOperand))