1 implementation of IConditionalOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5718internal sealed partial class ConditionalOperation : Operation, IConditionalOperation
96 references to IConditionalOperation
ILLink.RoslynAnalyzer (1)
IOperationExtensions.cs (1)
144 } else if (operation.Parent is IConditionalOperation conditionalOperation) {
Microsoft.AspNetCore.App.Analyzers (1)
RouteHandlers\DetectAmbiguousRoutes.cs (1)
74else if (current.Parent is IConditionalOperation or
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (2)
39var ifOperation = (IConditionalOperation)context.Operation;
Microsoft.CodeAnalysis (10)
Generated\OperationKind.Generated.cs (1)
88/// <summary>Indicates an <see cref="IConditionalOperation"/>.</summary>
Generated\Operations.Generated.cs (3)
10951public override IOperation VisitConditional(IConditionalOperation operation, object? argument) 11447public virtual void VisitConditional(IConditionalOperation operation) => DefaultVisit(operation); 11586public virtual TResult? VisitConditional(IConditionalOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (4)
1535public override IOperation? VisitConditional(IConditionalOperation operation, int? captureIdForResult) 1574if (operation.WhenFalse is IConditionalOperation nested) 2868var conditional = (IConditionalOperation)condition;
Operations\OperationMapBuilder.cs (2)
57public override object? VisitConditional(IConditionalOperation operation, Dictionary<SyntaxNode, IOperation> argument) 64if (operation.WhenFalse is IConditionalOperation nested)
Microsoft.CodeAnalysis.CodeStyle (17)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
91case IConditionalOperation conditional:
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
383case IConditionalOperation conditional when conditional.IsRef:
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (3)
36IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken); 45var ifOperation = (IConditionalOperation)context.Operation;
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
21IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
16IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
24ISyntaxFacts syntaxFacts, IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (6)
83var ifOperation = GetContainingIfOperation( 139private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 168IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 209IConditionalOperation ifStatement, 269private static IConditionalOperation? GetContainingIfOperation( 290if (containingOperation is IConditionalOperation conditionalOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
181else if (operation.Parent is IConditionalOperation conditionalOperation)
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
85Document document, IConditionalOperation ifOperation, 127IConditionalOperation originalIfStatement, TConditionalExpressionSyntax conditionalExpression) 132protected virtual TExpressionSyntax WrapIfStatementIfNecessary(IConditionalOperation operation)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (5)
69var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!; 106IConditionalOperation ifOperation, 123ISyntaxFactsService syntaxFacts, SyntaxEditor editor, IConditionalOperation ifOperation, 155IConditionalOperation ifOperation,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
58var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!;
Microsoft.CodeAnalysis.CSharp (2)
Operations\CSharpOperationFactory.cs (2)
1572private IConditionalOperation CreateBoundConditionalOperatorOperation(BoundConditionalOperator boundConditionalOperator) 1802private IConditionalOperation CreateBoundIfStatementOperation(BoundIfStatement boundIfStatement)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
889if (rewrittenSemanticModel.GetOperation(rewrittenConditionalExpression, cancellationToken) is not IConditionalOperation rewrittenConditionalOperation)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
897IConditionalOperation 967if (bodyOps.FirstOrDefault() is not IConditionalOperation
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
63protected override (ConditionalExpressionSyntax conditional, bool makeMultiLine) UpdateConditionalExpression(IConditionalOperation originalIfStatement, ConditionalExpressionSyntax conditional)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (2)
44protected override ExpressionSyntax WrapIfStatementIfNecessary(IConditionalOperation operation) 66protected override (ConditionalExpressionSyntax conditional, bool makeMultiLine) UpdateConditionalExpression(IConditionalOperation originalIfStatement, ConditionalExpressionSyntax conditional)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionHelpers.cs (1)
28IConditionalOperation originalIfStatement,
Microsoft.CodeAnalysis.CSharp.Features (7)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
31public override bool CanConvert(IConditionalOperation operation)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
897IConditionalOperation 967if (bodyOps.FirstOrDefault() is not IConditionalOperation
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
63protected override (ConditionalExpressionSyntax conditional, bool makeMultiLine) UpdateConditionalExpression(IConditionalOperation originalIfStatement, ConditionalExpressionSyntax conditional)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (2)
44protected override ExpressionSyntax WrapIfStatementIfNecessary(IConditionalOperation operation) 66protected override (ConditionalExpressionSyntax conditional, bool makeMultiLine) UpdateConditionalExpression(IConditionalOperation originalIfStatement, ConditionalExpressionSyntax conditional)
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionHelpers.cs (1)
28IConditionalOperation originalIfStatement,
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
889if (rewrittenSemanticModel.GetOperation(rewrittenConditionalExpression, cancellationToken) is not IConditionalOperation rewrittenConditionalOperation)
Microsoft.CodeAnalysis.Features (33)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (4)
49public abstract bool CanConvert(IConditionalOperation operation); 103operations[current] is IConditionalOperation { WhenFalse: null } op && 156case IConditionalOperation op when CanConvert(op): 188private AnalyzedSwitchSection? ParseSwitchSection(IConditionalOperation operation)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
87if (ifOperation is not IConditionalOperation { Parent: IBlockOperation parentBlock })
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (2)
213if (statement is IConditionalOperation ifStatement) 468if (statement is IConditionalOperation ifStatement)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
91case IConditionalOperation conditional:
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
383case IConditionalOperation conditional when conditional.IsRef:
src\Analyzers\Core\Analyzers\UseConditionalExpression\AbstractUseConditionalExpressionDiagnosticAnalyzer.cs (3)
36IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken); 45var ifOperation = (IConditionalOperation)context.Operation;
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
21IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
25IConditionalOperation ifOperation, ISymbol containingSymbol, CancellationToken cancellationToken)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
16IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
24ISyntaxFacts syntaxFacts, IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (6)
83var ifOperation = GetContainingIfOperation( 139private static bool ValueIsAccessed(SemanticModel semanticModel, IConditionalOperation ifOperation, IBlockOperation containingBlock, ISymbol localOrParameter, IExpressionStatementOperation expressionStatement, IAssignmentOperation assignmentExpression) 168IBlockOperation containingBlock, IConditionalOperation ifOperation, ISymbol localOrParameter, 209IConditionalOperation ifStatement, 269private static IConditionalOperation? GetContainingIfOperation( 290if (containingOperation is IConditionalOperation conditionalOperation)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
85Document document, IConditionalOperation ifOperation, 127IConditionalOperation originalIfStatement, TConditionalExpressionSyntax conditionalExpression) 132protected virtual TExpressionSyntax WrapIfStatementIfNecessary(IConditionalOperation operation)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (5)
69var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!; 106IConditionalOperation ifOperation, 123ISyntaxFactsService syntaxFacts, SyntaxEditor editor, IConditionalOperation ifOperation, 155IConditionalOperation ifOperation,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
58var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!;
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\OperationTreeVerifier.cs (2)
1273public override void VisitConditional(IConditionalOperation operation) 1275LogString(nameof(IConditionalOperation));
Compilation\TestOperationVisitor.cs (1)
886public override void VisitConditional(IConditionalOperation operation)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Analyzer.vb (1)
23Public Overrides Function CanConvert(operation As IConditionalOperation) As Boolean
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
181else if (operation.Parent is IConditionalOperation conditionalOperation)