9 types derived from BoundPattern
Microsoft.CodeAnalysis.CSharp (9)
Generated\BoundNodes.xml.Generated.cs (9)
8025internal sealed partial class BoundConstantPattern : BoundPattern 8062internal sealed partial class BoundDiscardPattern : BoundPattern 8102internal abstract partial class BoundObjectPattern : BoundPattern 8240internal sealed partial class BoundSlicePattern : BoundPattern 8279internal sealed partial class BoundITuplePattern : BoundPattern 8423internal sealed partial class BoundTypePattern : BoundPattern 8459internal sealed partial class BoundBinaryPattern : BoundPattern 8498internal sealed partial class BoundNegatedPattern : BoundPattern 8532internal sealed partial class BoundRelationalPattern : BoundPattern
218 references to BoundPattern
Microsoft.CodeAnalysis.CSharp (218)
Binder\Binder_Patterns.cs (33)
39BoundPattern pattern = BindPattern(node.Pattern, expression.Type, permitDesignations: true, hasErrors, diagnostics, underIsPattern: true); 49BoundPattern pattern, 58bool negated = pattern.IsNegated(out var innerPattern); 175internal BoundPattern BindPattern( 201private BoundPattern BindParenthesizedPattern( 213private BoundPattern BindSlicePattern( 228BoundPattern? pattern = null; 270private ImmutableArray<BoundPattern> BindListPatternSubpatterns( 280var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count); 283BoundPattern boundPattern; 338ImmutableArray<BoundPattern> subpatterns = BindListPatternSubpatterns( 413private static BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol inputType, BindingDiagnosticBag diagnostics) 419private BoundPattern BindConstantPatternWithFallbackToTypePattern( 428internal BoundPattern BindConstantPatternWithFallbackToTypePattern( 848private BoundPattern BindDeclarationPattern( 968private BoundPattern BindRecursivePattern( 1156BoundPattern pattern = BindVarDesignation(variable, objectType, permitDesignations, hasErrors: false, diagnostics); 1328private BoundPattern BindVarPattern( 1354private BoundPattern BindVarDesignation( 1435BoundPattern pattern = BindVarDesignation(variable, elementType, permitDesignations, isError, diagnostics); 1458BoundPattern pattern = BindVarDesignation(variable, elementType, permitDesignations, isError, diagnostics); 1514BoundPattern boundPattern = BindPattern(pattern, memberType, permitDesignations, hasErrors, diagnostics); 1622private BoundPattern BindTypePattern( 1635private BoundPattern BindRelationalPattern( 1728private BoundPattern BindUnaryPattern( 1738var subPattern = BindPattern(node.Pattern, inputType, permitDesignations, hasErrors, diagnostics, underIsPattern); 1742private BoundPattern BindBinaryPattern( 1764BoundPattern result = BindPattern(binaryPatternAndPermitDesignations.pat.Left, inputType, binaryPatternAndPermitDesignations.permitDesignations, hasErrors, diagnostics); 1785static BoundPattern bindBinaryPattern( 1786BoundPattern preboundLeft, 1801var right = binder.BindPattern(node.Right, inputType, permitDesignations, hasErrors, diagnostics); 1868var right = binder.BindPattern(node.Right, preboundLeft.NarrowedType, permitDesignations, hasErrors, diagnostics); 1875static void collectCandidates(BoundPattern pat, ArrayBuilder<TypeSymbol> candidates)
Binder\DecisionDagBuilder.cs (9)
117BoundPattern pattern, 130BoundPattern pattern, 187BoundPattern pattern, 197BoundPattern pattern, 316BoundPattern pattern, 329BoundPattern pattern, 585BoundPattern pattern = recursive.Deconstruction[i].Pattern; 606BoundPattern pattern = recursive.Deconstruction[i].Pattern; 629BoundPattern pattern = subpattern.Pattern;
Binder\DecisionDagBuilder_CheckOrReachability.cs (69)
64BoundPattern pattern, 338BoundPattern pattern, 349var normalizedPattern = PatternNormalizer.Rewrite(pattern, rootIdentifier.Type); 363var normalizedNegatedPattern = PatternNormalizer.Rewrite(negated, rootIdentifier.Type); 384static void populateStateForCases(ArrayBuilder<BoundPattern> set, PooledHashSet<LabelSymbol> labelsToIgnore, 395foreach (BoundPattern pattern in set) 413static void analyze(BoundPattern pattern, ref readonly ReachabilityAnalysisContext context) 417var currentCases = ArrayBuilder<BoundPattern>.GetInstance(); 426static void analyzePattern(ArrayBuilder<BoundPattern> currentCases, BoundPattern pattern, Func<BoundPattern, BoundPattern>? wrapIntoParentAndPattern, ref readonly ReachabilityAnalysisContext context) 434static void analyzeBinary(ArrayBuilder<BoundPattern> currentCases, BoundBinaryPattern binaryPattern, Func<BoundPattern, BoundPattern>? wrapIntoParentAndPattern, ref readonly ReachabilityAnalysisContext context) 440var patterns = ArrayBuilder<BoundPattern>.GetInstance(); 448BoundPattern pattern = patterns[i]; 450BoundPattern wrappedPattern = wrapIntoParentAndPattern?.Invoke(pattern) ?? pattern; 476Func<BoundPattern, BoundPattern> newWrapIntoParentAndPattern = (BoundPattern newPattern) => 481var result = wrapIntoParentAndPattern?.Invoke(wrappedPattern) ?? wrappedPattern; 505static void checkReachability(ArrayBuilder<BoundPattern> orCases, ref readonly ReachabilityAnalysisContext context) 540static void addPatternsFromOrTree(BoundPattern pattern, ArrayBuilder<BoundPattern> builder) 620private Func<BoundPattern, BoundPattern>? _makeEvaluationSequenceOperand; 640private readonly BoundPattern? _operand; 651private OperandOrOperation(BoundPattern? operand, bool? disjunction, SyntaxNode? operationSyntax) 663public static OperandOrOperation CreateOperand(BoundPattern operand) 668public bool IsOperand([NotNullWhen(true)] out BoundPattern? operand) 707internal static BoundPattern Rewrite(BoundPattern pattern, TypeSymbol inputType) 719private BoundPattern GetResult(TypeSymbol inputType) 723var stack = ArrayBuilder<BoundPattern>.GetInstance(); 732var right = stack.Pop(); 733var left = stack.Pop(); 737else if (operandOrOperation.IsOperand(out BoundPattern? operand)) 762var result = stack.Single(); 767static TypeSymbol narrowedTypeForBinary(BoundPattern resultLeft, BoundPattern resultRight, bool resultDisjunction) 888private void TryPushOperand(BoundPattern pattern) 919public BoundPattern NegateIfNeeded(BoundPattern node) 970private static BoundPattern WithInputTypeCheckIfNeeded(BoundPattern pattern, TypeSymbol inputType) 1027BoundPattern typePattern = new BoundTypePattern(pattern.Syntax, 1079BoundPattern initialCheck; 1112_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1119BoundPattern newRecursive = new BoundRecursivePattern( 1147_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1154BoundPattern newRecursive = new BoundRecursivePattern( 1187private void VisitPatternAndCombine(SyntaxNode syntax, BoundPattern pattern, int startOfLeft) 1235_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1242BoundPattern newITuple = new BoundITuplePattern(newPattern.Syntax, ituplePattern.GetLengthMethod, 1286ImmutableArray<BoundPattern> equivalentDefaultPatterns = listPattern.Subpatterns.SelectAsArray(makeEquivalentDefaultPattern); 1298Func<BoundPattern, BoundPattern> makeListPattern = (BoundPattern newPattern) => 1303ImmutableArray<BoundPattern> newSubpatterns = equivalentDefaultPatterns.SetItem(i, newPattern); 1305BoundPattern newList = new BoundListPattern( 1319Func<BoundPattern, BoundPattern>? makeListPatternWithSlice = null; 1322makeListPatternWithSlice = (BoundPattern newPattern) => 1331BoundPattern newSlice = new BoundSlicePattern(newPattern.Syntax, newPattern, slice.IndexerAccess, 1334ImmutableArray<BoundPattern> newSubpatterns = equivalentDefaultPatterns.SetItem(i, newSlice); 1336BoundPattern newList = new BoundListPattern( 1381static BoundPattern makeEquivalentDefaultPattern(BoundPattern pattern)
Binder\DecisionDagBuilder_ListPatterns.cs (2)
50foreach (BoundPattern subpattern in subpatterns) 57if (slice.Pattern is BoundPattern slicePattern)
Binder\SwitchBinder_Patterns.cs (3)
250BoundPattern pattern = sectionBinder.BindConstantPatternWithFallbackToTypePattern( 282BoundPattern pattern = sectionBinder.BindPattern( 296void reportIfConstantNamedUnderscore(BoundPattern pattern, ExpressionSyntax expression)
Binder\SwitchExpressionArmBinder.cs (1)
42BoundPattern pattern = armBinder.BindPattern(node.Pattern, switchGoverningType, permitDesignations: true, hasErrors, diagnostics);
BoundTree\BoundIsPatternExpression.cs (1)
16bool negated = this.Pattern.IsNegated(out var innerPattern);
BoundTree\BoundListPattern.cs (1)
13internal BoundListPattern WithSubpatterns(ImmutableArray<BoundPattern> subpatterns)
BoundTree\BoundPattern.cs (1)
14internal bool IsNegated(out BoundPattern innerPattern)
BoundTree\BoundPositionalSubpattern.cs (1)
9internal BoundPositionalSubpattern WithPattern(BoundPattern pattern)
BoundTree\BoundPropertySubpattern.cs (1)
9internal BoundPropertySubpattern WithPattern(BoundPattern pattern)
BoundTree\BoundSlicePattern.cs (1)
11internal BoundSlicePattern WithPattern(BoundPattern? pattern)
BoundTree\BoundTreeRewriter.cs (6)
218if (node is BoundExpression or BoundPattern) 342BoundPattern child = node.Left; 367var left = (BoundPattern?)this.Visit(child); 373var right = (BoundPattern?)this.Visit(binary.Right);
BoundTree\BoundTreeVisitors.cs (1)
202Debug.Assert(node is BoundExpression or BoundPattern);
BoundTree\BoundTreeWalker.cs (4)
73if (node is BoundExpression or BoundPattern) 88Debug.Assert(node is BoundExpression or BoundPattern); 152var rightOperands = ArrayBuilder<BoundPattern>.GetInstance(); 157BoundPattern? current = binary.Left;
BoundTree\NullabilityRewriter.cs (4)
152var leftChild = (BoundPattern)Visit(stack.Peek().Left); 161var right = (BoundPattern)Visit(currentBinary.Right);
Compilation\CSharpSemanticModel.cs (3)
2021BoundPattern pattern = lowestBoundNode as BoundPattern ?? highestBoundNode as BoundPattern ?? (highestBoundNode is BoundSubpattern sp ? sp.Pattern : null);
Compilation\MemberSemanticModel.NodeMapBuilder.cs (2)
225var stack = ArrayBuilder<BoundPattern>.GetInstance(); 228BoundPattern currentPattern = binaryPattern.Left;
FlowAnalysis\AbstractFlowPass.cs (5)
363if (node is BoundExpression or BoundPattern) 930bool negated = node.Pattern.IsNegated(out var pattern); 979static bool patternMatchesNull(BoundPattern pattern) 1029static bool? isBoolTest(BoundPattern pattern) 1102public virtual void VisitPattern(BoundPattern pattern)
FlowAnalysis\DefiniteAssignment.cs (3)
1943public override void VisitPattern(BoundPattern pattern) 1953void assignPatternVariablesAndMarkReadFields(BoundPattern pattern, bool definitely = true) 2028foreach (BoundPattern p in pat.Subpatterns)
FlowAnalysis\NullableWalker.cs (1)
3707Debug.Assert(node is BoundExpression or BoundPattern);
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
98if (node is BoundExpression or BoundPattern)
FlowAnalysis\NullableWalker_Patterns.cs (2)
26BoundPattern pattern) 155BoundPattern pattern)
FlowAnalysis\VariablesDeclaredWalker.cs (3)
50public override void VisitPattern(BoundPattern pattern) 69private void NoteDeclaredPatternVariables(BoundPattern pattern) 94foreach (var elementPattern in listPattern.Subpatterns)
Generated\BoundNodes.xml.Generated.cs (60)
4909public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4926public BoundPattern Pattern { get; } 4934public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 5696public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause, bool hasErrors = false) 5709public BoundPattern Pattern { get; } 5715public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause) 7957public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 7976public BoundPattern Pattern { get; } 7985public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 8198public BoundListPattern(SyntaxNode syntax, ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8218public ImmutableArray<BoundPattern> Subpatterns { get; } 8228public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8242public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8259public BoundPattern? Pattern { get; } 8267public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType) 8321protected BoundSubpattern(BoundKind kind, SyntaxNode syntax, BoundPattern pattern, bool hasErrors = false) 8330public BoundPattern Pattern { get; } 8335public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8349public BoundPositionalSubpattern Update(Symbol? symbol, BoundPattern pattern) 8363public BoundPropertySubpattern(SyntaxNode syntax, BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern, bool hasErrors = false) 8379public BoundPropertySubpattern Update(BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern) 8461public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8480public BoundPattern Left { get; } 8481public BoundPattern Right { get; } 8486public BoundBinaryPattern Update(bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType) 8500public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8515public BoundPattern Negated { get; } 8520public BoundNegatedPattern Update(BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType) 11659BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 11811BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12232BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12274ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 12286BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 12306BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12312BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12331BoundPattern left = (BoundPattern)this.Visit(node.Left); 12332BoundPattern right = (BoundPattern)this.Visit(node.Right); 12339BoundPattern negated = (BoundPattern)this.Visit(node.Negated); 13810BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 14876BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 14935ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 14948BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 14968BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 14991BoundPattern negated = (BoundPattern)this.Visit(node.Negated);