1 implementation of IConstantPatternOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
8517internal sealed partial class ConstantPatternOperation : BasePatternOperation, IConstantPatternOperation
29 references to IConstantPatternOperation
ILLink.RoslynAnalyzer (1)
DataFlow\FeatureChecksVisitor.cs (1)
141 case IConstantPatternOperation constantPattern:
Microsoft.CodeAnalysis (5)
Generated\OperationKind.Generated.cs (1)
193/// <summary>Indicates an <see cref="IConstantPatternOperation"/>.</summary>
Generated\Operations.Generated.cs (3)
11206public override IOperation VisitConstantPattern(IConstantPatternOperation operation, object? argument) 11503public virtual void VisitConstantPattern(IConstantPatternOperation operation) => DefaultVisit(operation); 11642public virtual TResult? VisitConstantPattern(IConstantPatternOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (1)
7548public override IOperation VisitConstantPattern(IConstantPatternOperation operation, int? captureIdForResult)
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
42if (arm is { Guard: null, Pattern: IConstantPatternOperation constantPattern } &&
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
52else if (clause is IPatternCaseClauseOperation { Guard: null, Pattern: IConstantPatternOperation constantPattern } &&
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (3)
44if (arm.Pattern is IConstantPatternOperation { Value.ConstantValue: { HasValue: true, Value: null } }) 78if (operation is IConstantPatternOperation { Value.ConstantValue: { HasValue: true, Value: not null and var value } }) 120if (pattern is IConstantPatternOperation { Value: IConversionOperation { ConstantValue: { HasValue: true, Value: null } } })
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
39if (operation.Pattern is not IConstantPatternOperation { Value.ConstantValue.Value: true or false } constantPattern)
Microsoft.CodeAnalysis.CSharp (1)
Operations\CSharpOperationFactory.cs (1)
2515private IConstantPatternOperation CreateBoundConstantPatternOperation(BoundConstantPattern boundConstantPattern)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
679IConstantPatternOperation? constantPattern; 683Pattern as IConstantPatternOperation; 687constantPattern = patternOp.Pattern as IConstantPatternOperation;
Microsoft.CodeAnalysis.CSharp.Features (3)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (3)
679IConstantPatternOperation? constantPattern; 683Pattern as IConstantPatternOperation; 687constantPattern = patternOp.Pattern as IConstantPatternOperation;
Microsoft.CodeAnalysis.Features (7)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
228isPatternOperation.Pattern is IConstantPatternOperation constantPattern)
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
42if (arm is { Guard: null, Pattern: IConstantPatternOperation constantPattern } &&
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
52else if (clause is IPatternCaseClauseOperation { Guard: null, Pattern: IConstantPatternOperation constantPattern } &&
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (3)
44if (arm.Pattern is IConstantPatternOperation { Value.ConstantValue: { HasValue: true, Value: null } }) 78if (operation is IConstantPatternOperation { Value.ConstantValue: { HasValue: true, Value: not null and var value } }) 120if (pattern is IConstantPatternOperation { Value: IConversionOperation { ConstantValue: { HasValue: true, Value: null } } })
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
39if (operation.Pattern is not IConstantPatternOperation { Value.ConstantValue.Value: true or false } constantPattern)
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\OperationTreeVerifier.cs (2)
1955public override void VisitConstantPattern(IConstantPatternOperation operation) 1957LogString(nameof(IConstantPatternOperation));
Compilation\TestOperationVisitor.cs (1)
1365public override void VisitConstantPattern(IConstantPatternOperation operation)