1 implementation of IConditionalOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5718internal sealed partial class ConditionalOperation : Operation, IConditionalOperation
88 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)
35protected abstract (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol); 43var ifOperation = (IConditionalOperation)context.Operation;
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
18IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
28protected sealed override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
15IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
20ISyntaxFacts 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)
185else if (operation.Parent is IConditionalOperation conditionalOperation)
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
85Document document, IConditionalOperation ifOperation, 125protected virtual SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (5)
66var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!; 103IConditionalOperation ifOperation, 120ISyntaxFactsService syntaxFacts, SyntaxEditor editor, IConditionalOperation ifOperation, 152IConditionalOperation ifOperation,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
55var 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)
882if (rewrittenSemanticModel.GetOperation(rewrittenConditionalExpression, cancellationToken) is not IConditionalOperation rewrittenConditionalOperation)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
898IConditionalOperation 968if (bodyOps.FirstOrDefault() is not IConditionalOperation
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
44protected override SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation)
Microsoft.CodeAnalysis.CSharp.Features (4)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
31public override bool CanConvert(IConditionalOperation operation)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (2)
898IConditionalOperation 968if (bodyOps.FirstOrDefault() is not IConditionalOperation
src\Analyzers\CSharp\CodeFixes\UseConditionalExpression\CSharpUseConditionalExpressionForReturnCodeFixProvider.cs (1)
44protected override SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
882if (rewrittenSemanticModel.GetOperation(rewrittenConditionalExpression, cancellationToken) is not IConditionalOperation rewrittenConditionalOperation)
Microsoft.CodeAnalysis.Features (32)
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)
35protected abstract (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol); 43var ifOperation = (IConditionalOperation)context.Operation;
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer.cs (1)
28protected override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
18IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer.cs (1)
28protected sealed override (bool matched, bool canSimplify) TryMatchPattern(IConditionalOperation ifOperation, ISymbol containingSymbol)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
15IConditionalOperation ifOperation,
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
20ISyntaxFacts 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 (2)
85Document document, IConditionalOperation ifOperation, 125protected virtual SyntaxNode WrapIfStatementIfNecessary(IConditionalOperation operation)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (5)
66var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!; 103IConditionalOperation ifOperation, 120ISyntaxFactsService syntaxFacts, SyntaxEditor editor, IConditionalOperation ifOperation, 152IConditionalOperation ifOperation,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (2)
55var 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)
185else if (operation.Parent is IConditionalOperation conditionalOperation)