10 types derived from BoundPattern
Microsoft.CodeAnalysis.CSharp (10)
Generated\BoundNodes.xml.Generated.cs (10)
8144internal sealed partial class BoundConstantPattern : BoundPattern 8183internal sealed partial class BoundPatternWithUnionMatching : BoundPattern 8225internal sealed partial class BoundDiscardPattern : BoundPattern 8265internal abstract partial class BoundObjectPattern : BoundPattern 8407internal sealed partial class BoundSlicePattern : BoundPattern 8446internal sealed partial class BoundITuplePattern : BoundPattern 8594internal sealed partial class BoundTypePattern : BoundPattern 8632internal sealed partial class BoundBinaryPattern : BoundPattern 8671internal sealed partial class BoundNegatedPattern : BoundPattern 8705internal sealed partial class BoundRelationalPattern : BoundPattern
270 references to BoundPattern
Microsoft.CodeAnalysis.CSharp (270)
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)
118BoundPattern pattern, 132BoundPattern pattern, 192BoundPattern pattern, 208BoundPattern pattern, 333BoundPattern pattern, 369BoundPattern pattern, 959BoundPattern pattern = recursive.Deconstruction[i].Pattern; 980BoundPattern pattern = recursive.Deconstruction[i].Pattern; 1005BoundPattern 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)
3823Debug.Assert(node is BoundExpression or BoundPattern);
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)
4944public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4962public BoundPattern Pattern { get; } 4971public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 5761public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, bool hasErrors = false) 5775public BoundPattern Pattern { get; } 5782public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause) 8070public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 8090public BoundPattern Pattern { get; } 8100public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 8185public BoundPatternWithUnionMatching(SyntaxNode syntax, TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8206public BoundPattern? LeftOfPendingConjunction { get; } 8208public BoundPattern ValuePattern { get; } 8213public BoundPatternWithUnionMatching Update(TypeSymbol unionMatchingInputType, BoundPattern? leftOfPendingConjunction, BoundPropertySubpatternMember valueProperty, BoundPattern valuePattern, TypeSymbol inputType, TypeSymbol narrowedType) 8365public 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) 8385public ImmutableArray<BoundPattern> Subpatterns { get; } 8395public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8409public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8426public BoundPattern? Pattern { get; } 8434public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType) 8488protected BoundSubpattern(BoundKind kind, SyntaxNode syntax, BoundPattern pattern, bool hasErrors = false) 8501public BoundPattern Pattern { get; } 8506public BoundPositionalSubpattern(SyntaxNode syntax, Symbol? symbol, BoundPattern pattern, bool hasErrors = false) 8520public BoundPositionalSubpattern Update(Symbol? symbol, BoundPattern pattern) 8534public BoundPropertySubpattern(SyntaxNode syntax, BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern, bool hasErrors = false) 8550public BoundPropertySubpattern Update(BoundPropertySubpatternMember? member, bool isLengthOrCount, BoundPattern pattern) 8634public BoundBinaryPattern(SyntaxNode syntax, bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8653public BoundPattern Left { get; } 8654public BoundPattern Right { get; } 8659public BoundBinaryPattern Update(bool disjunction, BoundPattern left, BoundPattern right, TypeSymbol inputType, TypeSymbol narrowedType) 8673public BoundNegatedPattern(SyntaxNode syntax, BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8688public BoundPattern Negated { get; } 8693public BoundNegatedPattern Update(BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType) 11925BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12082BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12508BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12522BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 12524BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 12560ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 12572BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 12592BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12598BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12617BoundPattern left = (BoundPattern)this.Visit(node.Left); 12618BoundPattern right = (BoundPattern)this.Visit(node.Right); 12625BoundPattern negated = (BoundPattern)this.Visit(node.Negated); 14124BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15190BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15219BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 15221BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 15260ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 15273BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 15293BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 15316BoundPattern negated = (BoundPattern)this.Visit(node.Negated);