10 types derived from BoundPattern
Microsoft.CodeAnalysis.CSharp (10)
Generated\BoundNodes.xml.Generated.cs (10)
8142internal sealed partial class BoundConstantPattern : BoundPattern 8181internal sealed partial class BoundPatternWithUnionMatching : BoundPattern 8223internal sealed partial class BoundDiscardPattern : BoundPattern 8263internal abstract partial class BoundObjectPattern : BoundPattern 8405internal sealed partial class BoundSlicePattern : BoundPattern 8444internal sealed partial class BoundITuplePattern : BoundPattern 8592internal sealed partial class BoundTypePattern : BoundPattern 8630internal sealed partial class BoundBinaryPattern : BoundPattern 8669internal sealed partial class BoundNegatedPattern : BoundPattern 8703internal sealed partial class BoundRelationalPattern : BoundPattern
272 references to BoundPattern
Microsoft.CodeAnalysis.CSharp (272)
Binder\Binder_Patterns.cs (34)
82BoundPattern pattern = BindPattern(node.Pattern, ref unionType, expression.Type, permitDesignations: true, hasErrors, diagnostics, out bool hasUnionMatching, underIsPattern: true); 92BoundPattern pattern, 98bool negated = pattern.IsNegated(out var innerPattern); 220internal BoundPattern BindPattern( 249private BoundPattern BindParenthesizedPattern( 263private BoundPattern BindSlicePattern( 279BoundPattern? pattern = null; 326private ImmutableArray<BoundPattern> BindListPatternSubpatterns( 338var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count); 341BoundPattern boundPattern; 400ImmutableArray<BoundPattern> subpatterns = BindListPatternSubpatterns( 473private static BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol inputType, BindingDiagnosticBag diagnostics) 479private BoundPattern BindConstantPatternWithFallbackToTypePattern( 490internal BoundPattern BindConstantPatternWithFallbackToTypePattern( 1022private BoundPattern BindDeclarationPattern( 1139private BoundPattern BindRecursivePattern( 1537private BoundPattern BindVarPattern( 1564private BoundPattern BindVarDesignation( 1604BoundPattern bindParenthesizedVariableDesignation(VariableDesignationSyntax node, ref NamedTypeSymbol? unionType, TypeSymbol inputType, bool permitDesignations, bool hasErrors, BindingDiagnosticBag diagnostics) 1660BoundPattern pattern = BindVarDesignation(variable, ref varUnionType, elementType, permitDesignations, isError, diagnostics); 1685BoundPattern pattern = BindVarDesignation(variable, ref unionType, elementType, permitDesignations, isError, diagnostics); 1700BoundPattern pattern = BindVarDesignation(variable, ref unionType, objectType, permitDesignations, hasErrors: false, diagnostics); 1767BoundPattern boundPattern = BindPattern(pattern, ref unionType, memberType, permitDesignations, hasErrors, diagnostics, out bool patternHasUnionMatching, underIsPattern: false); 1896private BoundPattern BindTypePattern( 1961private BoundPattern BindRelationalPattern( 2071private BoundPattern BindUnaryPattern( 2084var subPattern = BindPattern(node.Pattern, ref currentUnionType, inputType, permitDesignations, hasErrors, diagnostics, out hasUnionMatching, underIsPattern); 2089private BoundPattern BindBinaryPattern( 2114BoundPattern result = BindPattern(binaryPatternAndPermitDesignations.pat.Left, ref unionType, inputType, binaryPatternAndPermitDesignations.permitDesignations, hasErrors, diagnostics, out hasUnionMatching, underIsPattern: false); 2140BoundPattern preboundLeft, 2160var right = binder.BindPattern(node.Right, ref rightUnionType, inputType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching, underIsPattern: false); 2179var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.NarrowedType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching, underIsPattern: false); 2243internal static void CollectDisjunctionTypes(BoundPattern pat, ArrayBuilder<TypeSymbol> candidates, bool hasUnionMatching) 2266static void adjustForUnionMatching(BoundPattern pat, ref TypeSymbol candidate)
Binder\DecisionDagBuilder_CheckOrReachability.cs (70)
65BoundPattern pattern, 410BoundPattern pattern, 427var normalizedPattern = PatternNormalizer.Rewrite(pattern, rootIdentifier.Type); 441var normalizedNegatedPattern = PatternNormalizer.Rewrite(negated, rootIdentifier.Type); 462static void populateStateForCases(ArrayBuilder<BoundPattern> set, PooledHashSet<LabelSymbol> labelsToIgnore, 473foreach (BoundPattern pattern in set) 491static void analyze(BoundPattern pattern, ref readonly ReachabilityAnalysisContext context) 495var currentCases = ArrayBuilder<BoundPattern>.GetInstance(); 504static void analyzePattern(ArrayBuilder<BoundPattern> currentCases, BoundPattern pattern, Func<BoundPattern, BoundPattern>? wrapIntoParentAndPattern, ref readonly ReachabilityAnalysisContext context) 512static void analyzeBinary(ArrayBuilder<BoundPattern> currentCases, BoundBinaryPattern binaryPattern, Func<BoundPattern, BoundPattern>? wrapIntoParentAndPattern, ref readonly ReachabilityAnalysisContext context) 518var patterns = ArrayBuilder<BoundPattern>.GetInstance(); 526BoundPattern pattern = patterns[i]; 528BoundPattern wrappedPattern = wrapIntoParentAndPattern?.Invoke(pattern) ?? pattern; 554Func<BoundPattern, BoundPattern> newWrapIntoParentAndPattern = (BoundPattern newPattern) => 559var result = wrapIntoParentAndPattern?.Invoke(wrappedPattern) ?? wrappedPattern; 583static void checkReachability(ArrayBuilder<BoundPattern> orCases, ref readonly ReachabilityAnalysisContext context) 618static void addPatternsFromOrTree(BoundPattern pattern, ArrayBuilder<BoundPattern> builder) 698private Func<BoundPattern, BoundPattern>? _makeEvaluationSequenceOperand; 718private readonly BoundPattern? _operand; 729private OperandOrOperation(BoundPattern? operand, bool? disjunction, SyntaxNode? operationSyntax) 741public static OperandOrOperation CreateOperand(BoundPattern operand) 746public bool IsOperand([NotNullWhen(true)] out BoundPattern? operand) 785internal static BoundPattern Rewrite(BoundPattern pattern, TypeSymbol inputType) 797private BoundPattern GetResult(TypeSymbol inputType) 801var stack = ArrayBuilder<BoundPattern>.GetInstance(); 810var right = stack.Pop(); 811var left = stack.Pop(); 815else if (operandOrOperation.IsOperand(out BoundPattern? operand)) 840var result = stack.Single(); 845static TypeSymbol narrowedTypeForBinary(BoundPattern resultLeft, BoundPattern resultRight, bool resultDisjunction) 868Debug.Assert(node is not BoundPattern { IsUnionMatching: true }); 967private void TryPushOperand(BoundPattern pattern) 998public BoundPattern NegateIfNeeded(BoundPattern node) 1049private static BoundPattern WithInputTypeCheckIfNeeded(BoundPattern pattern, TypeSymbol inputType) 1106BoundPattern typePattern = new BoundTypePattern(pattern.Syntax, 1158BoundPattern initialCheck; 1191_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1198BoundPattern newRecursive = new BoundRecursivePattern( 1226_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1233BoundPattern newRecursive = new BoundRecursivePattern( 1266private void VisitPatternAndCombine(SyntaxNode syntax, BoundPattern pattern, int startOfLeft) 1314_makeEvaluationSequenceOperand = (BoundPattern newPattern) => 1321BoundPattern newITuple = new BoundITuplePattern(newPattern.Syntax, ituplePattern.GetLengthMethod, 1365ImmutableArray<BoundPattern> equivalentDefaultPatterns = listPattern.Subpatterns.SelectAsArray(makeEquivalentDefaultPattern); 1377Func<BoundPattern, BoundPattern> makeListPattern = (BoundPattern newPattern) => 1382ImmutableArray<BoundPattern> newSubpatterns = equivalentDefaultPatterns.SetItem(i, newPattern); 1384BoundPattern newList = new BoundListPattern( 1398Func<BoundPattern, BoundPattern>? makeListPatternWithSlice = null; 1401makeListPatternWithSlice = (BoundPattern newPattern) => 1410BoundPattern newSlice = new BoundSlicePattern(newPattern.Syntax, newPattern, slice.IndexerAccess, 1413ImmutableArray<BoundPattern> newSubpatterns = equivalentDefaultPatterns.SetItem(i, newSlice); 1415BoundPattern newList = new BoundListPattern( 1460static BoundPattern makeEquivalentDefaultPattern(BoundPattern pattern)
Binder\DecisionDagBuilder_ListPatterns.cs (2)
54foreach (BoundPattern subpattern in subpatterns) 61if (slice.Pattern is BoundPattern slicePattern)
Binder\DecisionDagBuilder.cs (9)
117BoundPattern pattern, 131BoundPattern pattern, 191BoundPattern pattern, 207BoundPattern pattern, 332BoundPattern pattern, 368BoundPattern pattern, 958BoundPattern pattern = recursive.Deconstruction[i].Pattern; 979BoundPattern pattern = recursive.Deconstruction[i].Pattern; 1004BoundPattern pattern = subpattern.Pattern;
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, underIsPattern: false);
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) 127ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns).SelectAsArray(RewritePatternWithUnionMatchingToPropertyPattern); 183BoundPattern negated = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Negated)); 189BoundPattern? pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 201BoundPattern pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 208BoundPattern pattern = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)this.Visit(node.Pattern)); 226BoundPattern result = (BoundPattern)Visit(binaryPattern.Left); 258static BoundPattern rewriteBinaryPattern( 260BoundPattern preboundLeft, 270var right = RewritePatternWithUnionMatchingToPropertyPattern((BoundPattern)rewriter.Visit(node.Right)); 291var right = (BoundPattern)rewriter.Visit(node.Right); 293BoundPattern result = makeConjunction(node.Syntax, preboundLeft, right, makeCompilerGenerated: node.WasCompilerGenerated); 308static BoundPattern makeConjunction(SyntaxNode node, BoundPattern left, BoundPattern? right, bool makeCompilerGenerated) 334var leftOfPendingConjunction = makeConjunction(node, left, rightUnionPattern.LeftOfPendingConjunction, makeCompilerGenerated: true); 397private static BoundBinaryPattern MakeBinaryAnd(SyntaxNode node, BoundPattern left, BoundPattern right, bool makeCompilerGenerated) 402private static BoundPattern RewritePatternWithUnionMatchingToPropertyPattern(BoundPattern pattern) 418BoundPattern? leftOfPendingConjunction = unionPattern.LeftOfPendingConjunction; 419BoundPattern valuePattern = unionPattern.ValuePattern; 424BoundPattern 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_Patterns.cs (2)
28BoundPattern pattern) 158BoundPattern pattern)
FlowAnalysis\NullableWalker.cs (1)
3767Debug.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\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)
4942public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4960public BoundPattern Pattern { get; } 4969public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 5759public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, bool hasErrors = false) 5773public BoundPattern Pattern { get; } 5780public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause) 8068public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 8088public BoundPattern Pattern { get; } 8098public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 8183public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8204public BoundPattern? LeftOfPendingConjunction { get; } 8206public BoundPattern ValuePattern { get; } 8211public BoundPatternWithUnionMatching Update(TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType) 8363public 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) 8383public ImmutableArray<BoundPattern> Subpatterns { get; } 8393public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8407public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8424public BoundPattern? Pattern { get; } 8432public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType) 8486protected BoundSubpattern(BoundKind kind, SyntaxNode syntax, BoundPattern pattern, bool hasErrors = false) 8499public BoundPattern Pattern { get; } 8504public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8518public BoundPositionalSubpattern Update(Symbol? symbol, BoundPattern pattern) 8532public BoundPropertySubpattern(SyntaxNode syntax, BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern, bool hasErrors = false) 8548public BoundPropertySubpattern Update(BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern) 8632public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8651public BoundPattern Left { get; } 8652public BoundPattern Right { get; } 8657public BoundBinaryPattern Update(bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType) 8671public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8686public BoundPattern Negated { get; } 8691public BoundNegatedPattern Update(BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType) 11923BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12080BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12506BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12520BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 12522BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 12558ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 12570BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 12590BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12596BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12615BoundPattern left = (BoundPattern)this.Visit(node.Left); 12616BoundPattern right = (BoundPattern)this.Visit(node.Right); 12623BoundPattern negated = (BoundPattern)this.Visit(node.Negated); 14122BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15188BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15217BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 15219BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 15258ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 15271BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 15291BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15314BoundPattern negated = (BoundPattern)this.Visit(node.Negated);