10 types derived from BoundPattern
Microsoft.CodeAnalysis.CSharp (10)
Generated\BoundNodes.xml.Generated.cs (10)
8161internal sealed partial class BoundConstantPattern : BoundPattern 8200internal sealed partial class BoundPatternWithUnionMatching : BoundPattern 8242internal sealed partial class BoundDiscardPattern : BoundPattern 8282internal abstract partial class BoundObjectPattern : BoundPattern 8422internal sealed partial class BoundSlicePattern : BoundPattern 8461internal sealed partial class BoundITuplePattern : BoundPattern 8611internal sealed partial class BoundTypePattern : BoundPattern 8649internal sealed partial class BoundBinaryPattern : BoundPattern 8688internal sealed partial class BoundNegatedPattern : BoundPattern 8724internal sealed partial class BoundRelationalPattern : BoundPattern
272 references to BoundPattern
Microsoft.CodeAnalysis.CSharp (272)
Binder\Binder_Patterns.cs (34)
224BoundPattern pattern = BindPattern(node.Pattern, ref unionType, expression.Type, permitDesignations: true, hasErrors, diagnostics, out bool hasUnionMatching, underIsPattern: true); 234BoundPattern pattern, 244bool negated = pattern.IsNegated(out var innerPattern); 361internal BoundPattern BindPattern( 390private BoundPattern BindParenthesizedPattern( 404private BoundPattern BindSlicePattern( 420BoundPattern? pattern = null; 467private ImmutableArray<BoundPattern> BindListPatternSubpatterns( 479var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count); 482BoundPattern boundPattern; 545ImmutableArray<BoundPattern> subpatterns = BindListPatternSubpatterns( 622private static BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol inputType, BindingDiagnosticBag diagnostics) 628private BoundPattern BindConstantPatternWithFallbackToTypePattern( 639internal BoundPattern BindConstantPatternWithFallbackToTypePattern( 1195private BoundPattern BindDeclarationPattern( 1322private BoundPattern BindRecursivePattern( 1691private BoundPattern BindVarPattern( 1719private BoundPattern BindVarDesignation( 1765BoundPattern bindParenthesizedVariableDesignation(VariableDesignationSyntax node, ref NamedTypeSymbol? unionType, TypeSymbol inputType, bool permitDesignations, bool hasErrors, BindingDiagnosticBag diagnostics, out bool hasUnionMatching) 1824BoundPattern pattern = BindVarDesignation(variable, ref varUnionType, elementType, permitDesignations, isError, diagnostics, out bool varHasUnionMatching); 1849BoundPattern pattern = BindVarDesignation(variable, ref unionType, elementType, permitDesignations, isError, diagnostics, out bool varHasUnionMatching); 1867BoundPattern pattern = BindVarDesignation(variable, ref unionType, objectType, permitDesignations, hasErrors: false, diagnostics, out bool varHasUnionMatching); 1926BoundPattern boundPattern = BindPattern(pattern, ref unionType, memberType, permitDesignations, hasErrors, diagnostics, out bool patternHasUnionMatching); 2035private BoundPattern BindTypePattern( 2053private BoundPattern BindRelationalPattern( 2151private BoundPattern BindUnaryPattern( 2178var subPattern = BindPattern(node.Pattern, ref currentUnionType, inputType, permitDesignations, hasErrors, diagnostics, out hasUnionMatching, underIsPattern); 2183private BoundPattern BindBinaryPattern( 2208BoundPattern result = BindPattern(binaryPatternAndPermitDesignations.pat.Left, ref unionType, inputType, binaryPatternAndPermitDesignations.permitDesignations, hasErrors, diagnostics, out hasUnionMatching); 2234BoundPattern preboundLeft, 2254var right = binder.BindPattern(node.Right, ref rightUnionType, inputType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching); 2272var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.NarrowedType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching); 2336internal static void CollectDisjunctionTypes(BoundPattern pat, ArrayBuilder<TypeSymbol> candidates, bool hasUnionMatching) 2359static void adjustForUnionMatching(BoundPattern pat, ref TypeSymbol candidate)
Binder\DecisionDagBuilder.cs (9)
117BoundPattern pattern, 131BoundPattern pattern, 189BoundPattern pattern, 205BoundPattern pattern, 324BoundPattern pattern, 360BoundPattern pattern, 947BoundPattern pattern = recursive.Deconstruction[i].Pattern; 968BoundPattern pattern = recursive.Deconstruction[i].Pattern; 993BoundPattern pattern = subpattern.Pattern;
Binder\DecisionDagBuilder_CheckOrReachability.cs (70)
64BoundPattern pattern, 340BoundPattern pattern, 357var normalizedPattern = PatternNormalizer.Rewrite(pattern, rootIdentifier.Type); 371var normalizedNegatedPattern = PatternNormalizer.Rewrite(negated, rootIdentifier.Type); 392static void populateStateForCases(ArrayBuilder<BoundPattern> set, PooledHashSet<LabelSymbol> labelsToIgnore, 403foreach (BoundPattern pattern in set) 421static void analyze(BoundPattern pattern, ref readonly ReachabilityAnalysisContext context) 425var currentCases = ArrayBuilder<BoundPattern>.GetInstance(); 434static void analyzePattern(ArrayBuilder<BoundPattern> currentCases, BoundPattern pattern, Func<BoundPattern, BoundPattern>? wrapIntoParentAndPattern, ref readonly ReachabilityAnalysisContext context) 442static void analyzeBinary(ArrayBuilder<BoundPattern> currentCases, BoundBinaryPattern binaryPattern, Func<BoundPattern, BoundPattern>? wrapIntoParentAndPattern, ref readonly ReachabilityAnalysisContext context) 448var patterns = ArrayBuilder<BoundPattern>.GetInstance(); 456BoundPattern pattern = patterns[i]; 458BoundPattern wrappedPattern = wrapIntoParentAndPattern?.Invoke(pattern) ?? pattern; 484Func<BoundPattern, BoundPattern> newWrapIntoParentAndPattern = (BoundPattern newPattern) => 489var result = wrapIntoParentAndPattern?.Invoke(wrappedPattern) ?? wrappedPattern; 513static void checkReachability(ArrayBuilder<BoundPattern> orCases, ref readonly ReachabilityAnalysisContext context) 548static void addPatternsFromOrTree(BoundPattern pattern, ArrayBuilder<BoundPattern> builder) 628private Func<BoundPattern, BoundPattern>? _makeEvaluationSequenceOperand; 648private readonly BoundPattern? _operand; 659private OperandOrOperation(BoundPattern? operand, bool? disjunction, SyntaxNode? operationSyntax) 671public static OperandOrOperation CreateOperand(BoundPattern operand) 676public bool IsOperand([NotNullWhen(true)] out BoundPattern? operand) 715internal static BoundPattern Rewrite(BoundPattern pattern, TypeSymbol inputType) 727private BoundPattern GetResult(TypeSymbol inputType) 731var stack = ArrayBuilder<BoundPattern>.GetInstance(); 740var right = stack.Pop(); 741var left = stack.Pop(); 745else if (operandOrOperation.IsOperand(out BoundPattern? operand)) 770var result = stack.Single(); 775static TypeSymbol narrowedTypeForBinary(BoundPattern resultLeft, BoundPattern resultRight, bool resultDisjunction) 798Debug.Assert(node is not BoundPattern { IsUnionMatching: true }); 897private void TryPushOperand(BoundPattern pattern) 928public BoundPattern NegateIfNeeded(BoundPattern node) 979private static BoundPattern WithInputTypeCheckIfNeeded(BoundPattern pattern, TypeSymbol inputType) 1036BoundPattern typePattern = new BoundTypePattern(pattern.Syntax, 1088BoundPattern initialCheck; 1121_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1128BoundPattern newRecursive = new BoundRecursivePattern( 1156_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1163BoundPattern newRecursive = new BoundRecursivePattern( 1196private void VisitPatternAndCombine(SyntaxNode syntax, BoundPattern pattern, int startOfLeft) 1244_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1251BoundPattern newITuple = new BoundITuplePattern(newPattern.Syntax, ituplePattern.GetLengthMethod, 1295ImmutableArray<BoundPattern> equivalentDefaultPatterns = listPattern.Subpatterns.SelectAsArray(makeEquivalentDefaultPattern); 1307Func<BoundPattern, BoundPattern> makeListPattern = (BoundPattern newPattern) => 1312ImmutableArray<BoundPattern> newSubpatterns = equivalentDefaultPatterns.SetItem(i, newPattern); 1314BoundPattern newList = new BoundListPattern( 1328Func<BoundPattern, BoundPattern>? makeListPatternWithSlice = null; 1331makeListPatternWithSlice = (BoundPattern newPattern) => 1340BoundPattern newSlice = new BoundSlicePattern(newPattern.Syntax, newPattern, slice.IndexerAccess, 1343ImmutableArray<BoundPattern> newSubpatterns = equivalentDefaultPatterns.SetItem(i, newSlice); 1345BoundPattern newList = new BoundListPattern( 1390static BoundPattern makeEquivalentDefaultPattern(BoundPattern pattern)
Binder\DecisionDagBuilder_ListPatterns.cs (2)
54foreach (BoundPattern subpattern in subpatterns) 61if (slice.Pattern is BoundPattern slicePattern)
Binder\SwitchBinder_Patterns.cs (3)
251BoundPattern pattern = sectionBinder.BindConstantPatternWithFallbackToTypePattern( 284BoundPattern pattern = sectionBinder.BindPattern( 298void reportIfConstantNamedUnderscore(BoundPattern pattern, ExpressionSyntax expression)
Binder\SwitchExpressionArmBinder.cs (1)
43BoundPattern pattern = armBinder.BindPattern(node.Pattern, ref unionType, switchGoverningType, permitDesignations: true, hasErrors, diagnostics, out bool hasUnionMatching);
Binder\UnionMatchingRewriter.cs (34)
20/// <see cref="RewritePatternWithUnionMatchingToPropertyPattern(BoundPattern)"/> helper at that point. 43public static BoundPattern Rewrite(CSharpCompilation compilation, BoundPattern pattern) 47return RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)result); 57private static BoundPatternWithUnionMatching CreatePatternWithUnionMatching(NamedTypeSymbol unionMatchingInputType, BoundPattern innerPattern) 124ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns).SelectAsArray(RewritePatternWithUnionMatchingToPropertyPattern); 200BoundPattern negated = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Negated)); 216BoundPattern? pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 228BoundPattern pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 235BoundPattern pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 253BoundPattern result = (BoundPattern)Visit(binaryPattern.Left); 285static BoundPattern rewriteBinaryPattern( 287BoundPattern preboundLeft, 297var right = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)rewriter.Visit(node.Right)); 318var right = (BoundPattern)rewriter.Visit(node.Right); 320BoundPattern result = makeConjunction(node.Syntax, preboundLeft, right, makeCompilerGenerated: node.WasCompilerGenerated); 335static BoundPattern makeConjunction(SyntaxNode node, BoundPattern left, BoundPattern? right, bool makeCompilerGenerated) 361var leftOfPendingConjunction = makeConjunction(node, left, rightUnionPattern.LeftOfPendingConjunction, makeCompilerGenerated: true); 424private static BoundBinaryPattern MakeBinaryAnd(SyntaxNode node, BoundPattern left, BoundPattern right, bool makeCompilerGenerated) 429private static BoundPattern RewritePatternWithUnionMatchingToPropertyPattern(BoundPattern pattern) 445BoundPattern? leftOfPendingConjunction = unionPattern.LeftOfPendingConjunction; 446BoundPattern valuePattern = unionPattern.ValuePattern; 452BoundPattern result = new BoundRecursivePattern(
BoundTree\BoundIsPatternExpression.cs (1)
16bool negated = this.Pattern.IsNegated(out var innerPattern);
BoundTree\BoundListPattern.cs (1)
14internal BoundListPattern WithSubpatterns(ImmutableArray<BoundPattern> subpatterns)
BoundTree\BoundPattern.cs (1)
17internal bool IsNegated(out BoundPattern innerPattern)
BoundTree\BoundPatternWithUnionMatching.cs (3)
21public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionType, BoundPropertySubpatternMember valueProperty, BoundPattern pattern, TypeSymbol inputType) 26public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern pattern, TypeSymbol inputType)
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)
2034BoundPattern 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 (6)
363if (node is BoundExpression or BoundPattern) 931bool negated = node.Pattern.IsNegated(out var pattern); 970negated ^= nestedPattern.IsNegated(out var negatedNestedPattern); 1028static bool patternMatchesNull(BoundPattern pattern) 1078static bool? isBoolTest(BoundPattern pattern) 1151public virtual void VisitPattern(BoundPattern pattern)
FlowAnalysis\DefiniteAssignment.cs (3)
1944public override void VisitPattern(BoundPattern pattern) 1954void assignPatternVariablesAndMarkReadFields(BoundPattern pattern, bool definitely = true) 2029foreach (BoundPattern p in pat.Subpatterns)
FlowAnalysis\NullableWalker.cs (1)
3736Debug.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 (74)
4961public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4979public BoundPattern Pattern { get; } 4988public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 5778public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, bool hasErrors = false) 5792public BoundPattern Pattern { get; } 5799public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause) 8087public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 8107public BoundPattern Pattern { get; } 8117public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 8202public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8223public BoundPattern? LeftOfPendingConjunction { get; } 8225public BoundPattern ValuePattern { get; } 8230public BoundPatternWithUnionMatching Update(TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType) 8380public BoundListPattern(SyntaxNode syntax, ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8400public ImmutableArray<BoundPattern> Subpatterns { get; } 8410public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType) 8424public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8441public BoundPattern? Pattern { get; } 8449public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType) 8505protected BoundSubpattern(BoundKind kind, SyntaxNode syntax, BoundPattern pattern, bool hasErrors = false) 8518public BoundPattern Pattern { get; } 8523public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8537public BoundPositionalSubpattern Update(Symbol? symbol, BoundPattern pattern) 8551public BoundPropertySubpattern(SyntaxNode syntax, BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern, bool hasErrors = false) 8567public BoundPropertySubpattern Update(BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern) 8651public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8670public BoundPattern Left { get; } 8671public BoundPattern Right { get; } 8676public BoundBinaryPattern Update(bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType) 8690public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8706public BoundPattern Negated { get; } 8712public BoundNegatedPattern Update(BoundPattern negated, bool isUnionMatching, TypeSymbol inputType, TypeSymbol narrowedType) 11929BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12086BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12512BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12526BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 12528BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 12564ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 12576BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 12596BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12602BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12621BoundPattern left = (BoundPattern)this.Visit(node.Left); 12622BoundPattern right = (BoundPattern)this.Visit(node.Right); 12629BoundPattern negated = (BoundPattern)this.Visit(node.Negated); 14123BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15189BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15218BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 15220BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 15259ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 15272BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 15292BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15315BoundPattern negated = (BoundPattern)this.Visit(node.Negated);