10 types derived from BoundPattern
Microsoft.CodeAnalysis.CSharp (10)
Generated\BoundNodes.xml.Generated.cs (10)
8141internal sealed partial class BoundConstantPattern : BoundPattern 8180internal sealed partial class BoundPatternWithUnionMatching : BoundPattern 8222internal sealed partial class BoundDiscardPattern : BoundPattern 8262internal abstract partial class BoundObjectPattern : BoundPattern 8402internal sealed partial class BoundSlicePattern : BoundPattern 8441internal sealed partial class BoundITuplePattern : BoundPattern 8591internal sealed partial class BoundTypePattern : BoundPattern 8629internal sealed partial class BoundBinaryPattern : BoundPattern 8668internal sealed partial class BoundNegatedPattern : BoundPattern 8702internal sealed partial class BoundRelationalPattern : BoundPattern
272 references to BoundPattern
Microsoft.CodeAnalysis.CSharp (272)
Binder\Binder_Patterns.cs (34)
555BoundPattern pattern = BindPattern(node.Pattern, ref unionType, expression.Type, permitDesignations: true, hasErrors, diagnostics, out bool hasUnionMatching, underIsPattern: true); 565BoundPattern pattern, 571bool negated = pattern.IsNegated(out var innerPattern); 693internal BoundPattern BindPattern( 722private BoundPattern BindParenthesizedPattern( 736private BoundPattern BindSlicePattern( 752BoundPattern? pattern = null; 799private ImmutableArray<BoundPattern> BindListPatternSubpatterns( 811var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count); 814BoundPattern boundPattern; 877ImmutableArray<BoundPattern> subpatterns = BindListPatternSubpatterns( 952private static BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol inputType, BindingDiagnosticBag diagnostics) 958private BoundPattern BindConstantPatternWithFallbackToTypePattern( 969internal BoundPattern BindConstantPatternWithFallbackToTypePattern( 1538private BoundPattern BindDeclarationPattern( 1667private BoundPattern BindRecursivePattern( 2048private BoundPattern BindVarPattern( 2076private BoundPattern BindVarDesignation( 2119BoundPattern bindParenthesizedVariableDesignation(VariableDesignationSyntax node, ref NamedTypeSymbol? unionType, TypeSymbol inputType, bool permitDesignations, bool hasErrors, BindingDiagnosticBag diagnostics, out bool hasUnionMatching) 2180BoundPattern pattern = BindVarDesignation(variable, ref varUnionType, elementType, permitDesignations, isError, diagnostics, out bool varHasUnionMatching); 2206BoundPattern pattern = BindVarDesignation(variable, ref unionType, elementType, permitDesignations, isError, diagnostics, out bool varHasUnionMatching); 2224BoundPattern pattern = BindVarDesignation(variable, ref unionType, objectType, permitDesignations, hasErrors: false, diagnostics, out bool varHasUnionMatching); 2292BoundPattern boundPattern = BindPattern(pattern, ref unionType, memberType, permitDesignations, hasErrors, diagnostics, out bool patternHasUnionMatching); 2421private BoundPattern BindTypePattern( 2445private BoundPattern BindRelationalPattern( 2548private BoundPattern BindUnaryPattern( 2561var subPattern = BindPattern(node.Pattern, ref currentUnionType, inputType, permitDesignations, hasErrors, diagnostics, out hasUnionMatching, underIsPattern); 2566private BoundPattern BindBinaryPattern( 2591BoundPattern result = BindPattern(binaryPatternAndPermitDesignations.pat.Left, ref unionType, inputType, binaryPatternAndPermitDesignations.permitDesignations, hasErrors, diagnostics, out hasUnionMatching); 2617BoundPattern preboundLeft, 2637var right = binder.BindPattern(node.Right, ref rightUnionType, inputType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching); 2655var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.NarrowedType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching); 2719internal static void CollectDisjunctionTypes(BoundPattern pat, ArrayBuilder<TypeSymbol> candidates, bool hasUnionMatching) 2742static void adjustForUnionMatching(BoundPattern pat, ref TypeSymbol candidate)
Binder\DecisionDagBuilder.cs (9)
117BoundPattern pattern, 131BoundPattern pattern, 189BoundPattern pattern, 205BoundPattern pattern, 324BoundPattern pattern, 360BoundPattern pattern, 950BoundPattern pattern = recursive.Deconstruction[i].Pattern; 971BoundPattern pattern = recursive.Deconstruction[i].Pattern; 996BoundPattern 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. 41public static BoundPattern Rewrite(CSharpCompilation compilation, BoundPattern pattern) 45return RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)result); 55private static BoundPatternWithUnionMatching CreatePatternWithUnionMatching(NamedTypeSymbol unionMatchingInputType, BoundPattern innerPattern) 122ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns).SelectAsArray(RewritePatternWithUnionMatchingToPropertyPattern); 199BoundPattern negated = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Negated)); 205BoundPattern? pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 217BoundPattern pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 224BoundPattern pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 242BoundPattern result = (BoundPattern)Visit(binaryPattern.Left); 274static BoundPattern rewriteBinaryPattern( 276BoundPattern preboundLeft, 286var right = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)rewriter.Visit(node.Right)); 307var right = (BoundPattern)rewriter.Visit(node.Right); 309BoundPattern result = makeConjunction(node.Syntax, preboundLeft, right, makeCompilerGenerated: node.WasCompilerGenerated); 324static BoundPattern makeConjunction(SyntaxNode node, BoundPattern left, BoundPattern? right, bool makeCompilerGenerated) 350var leftOfPendingConjunction = makeConjunction(node, left, rightUnionPattern.LeftOfPendingConjunction, makeCompilerGenerated: true); 413private static BoundBinaryPattern MakeBinaryAnd(SyntaxNode node, BoundPattern left, BoundPattern right, bool makeCompilerGenerated) 418private static BoundPattern RewritePatternWithUnionMatchingToPropertyPattern(BoundPattern pattern) 434BoundPattern? leftOfPendingConjunction = unionPattern.LeftOfPendingConjunction; 435BoundPattern valuePattern = unionPattern.ValuePattern; 441BoundPattern 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)
153var leftChild = (BoundPattern)Visit(stack.Peek().Left); 162var 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 (5)
363if (node is BoundExpression or BoundPattern) 931bool negated = node.Pattern.IsNegated(out var pattern); 980static bool patternMatchesNull(BoundPattern pattern) 1030static bool? isBoolTest(BoundPattern pattern) 1103public 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)
3781Debug.Assert(node is BoundExpression or BoundPattern);
FlowAnalysis\NullableWalker.DebugVerifier.cs (2)
99if (node is BoundExpression or BoundPattern) 382node.Subpatterns.Any(static (BoundPattern p) => p.Kind != BoundKind.SlicePattern))
FlowAnalysis\NullableWalker_Patterns.cs (2)
28BoundPattern pattern) 158BoundPattern 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)
4941public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4959public BoundPattern Pattern { get; } 4968public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 5758public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, bool hasErrors = false) 5772public BoundPattern Pattern { get; } 5779public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause) 8067public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 8087public BoundPattern Pattern { get; } 8097public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 8182public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8203public BoundPattern? LeftOfPendingConjunction { get; } 8205public BoundPattern ValuePattern { get; } 8210public BoundPatternWithUnionMatching Update(TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType) 8360public 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) 8380public ImmutableArray<BoundPattern> Subpatterns { get; } 8390public 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) 8404public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8421public BoundPattern? Pattern { get; } 8429public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType) 8485protected BoundSubpattern(BoundKind kind, SyntaxNode syntax, BoundPattern pattern, bool hasErrors = false) 8498public BoundPattern Pattern { get; } 8503public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8517public BoundPositionalSubpattern Update(Symbol? symbol, BoundPattern pattern) 8531public BoundPropertySubpattern(SyntaxNode syntax, BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern, bool hasErrors = false) 8547public BoundPropertySubpattern Update(BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern) 8631public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8650public BoundPattern Left { get; } 8651public BoundPattern Right { get; } 8656public BoundBinaryPattern Update(bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType) 8670public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8685public BoundPattern Negated { get; } 8690public BoundNegatedPattern Update(BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType) 11922BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12079BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12505BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12519BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 12521BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 12557ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 12569BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 12589BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12595BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12614BoundPattern left = (BoundPattern)this.Visit(node.Left); 12615BoundPattern right = (BoundPattern)this.Visit(node.Right); 12622BoundPattern negated = (BoundPattern)this.Visit(node.Negated); 14121BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15187BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15216BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 15218BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 15257ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 15270BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 15290BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15313BoundPattern negated = (BoundPattern)this.Visit(node.Negated);