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 8722internal sealed partial class BoundRelationalPattern : BoundPattern
271 references to BoundPattern
Microsoft.CodeAnalysis.CSharp (271)
Binder\Binder_Patterns.cs (34)
463BoundPattern pattern = BindPattern(node.Pattern, ref unionType, expression.Type, permitDesignations: true, hasErrors, diagnostics, out bool hasUnionMatching, underIsPattern: true); 473BoundPattern pattern, 479bool negated = pattern.IsNegated(out var innerPattern); 601internal BoundPattern BindPattern( 630private BoundPattern BindParenthesizedPattern( 644private BoundPattern BindSlicePattern( 660BoundPattern? pattern = null; 707private ImmutableArray<BoundPattern> BindListPatternSubpatterns( 719var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count); 722BoundPattern boundPattern; 785ImmutableArray<BoundPattern> subpatterns = BindListPatternSubpatterns( 862private static BoundPattern BindDiscardPattern(DiscardPatternSyntax node, TypeSymbol inputType, BindingDiagnosticBag diagnostics) 868private BoundPattern BindConstantPatternWithFallbackToTypePattern( 879internal BoundPattern BindConstantPatternWithFallbackToTypePattern( 1437private BoundPattern BindDeclarationPattern( 1564private BoundPattern BindRecursivePattern( 1933private BoundPattern BindVarPattern( 1961private BoundPattern BindVarDesignation( 2004BoundPattern bindParenthesizedVariableDesignation(VariableDesignationSyntax node, ref NamedTypeSymbol? unionType, TypeSymbol inputType, bool permitDesignations, bool hasErrors, BindingDiagnosticBag diagnostics, out bool hasUnionMatching) 2063BoundPattern pattern = BindVarDesignation(variable, ref varUnionType, elementType, permitDesignations, isError, diagnostics, out bool varHasUnionMatching); 2088BoundPattern pattern = BindVarDesignation(variable, ref unionType, elementType, permitDesignations, isError, diagnostics, out bool varHasUnionMatching); 2106BoundPattern pattern = BindVarDesignation(variable, ref unionType, objectType, permitDesignations, hasErrors: false, diagnostics, out bool varHasUnionMatching); 2174BoundPattern boundPattern = BindPattern(pattern, ref unionType, memberType, permitDesignations, hasErrors, diagnostics, out bool patternHasUnionMatching); 2303private BoundPattern BindTypePattern( 2321private BoundPattern BindRelationalPattern( 2419private BoundPattern BindUnaryPattern( 2432var subPattern = BindPattern(node.Pattern, ref currentUnionType, inputType, permitDesignations, hasErrors, diagnostics, out hasUnionMatching, underIsPattern); 2436private BoundPattern BindBinaryPattern( 2461BoundPattern result = BindPattern(binaryPatternAndPermitDesignations.pat.Left, ref unionType, inputType, binaryPatternAndPermitDesignations.permitDesignations, hasErrors, diagnostics, out hasUnionMatching); 2487BoundPattern preboundLeft, 2507var right = binder.BindPattern(node.Right, ref rightUnionType, inputType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching); 2525var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.NarrowedType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching); 2589internal static void CollectDisjunctionTypes(BoundPattern pat, ArrayBuilder<TypeSymbol> candidates, bool hasUnionMatching) 2612static 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)
3772Debug.Assert(node is BoundExpression or BoundPattern);
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
98if (node is BoundExpression or BoundPattern)
FlowAnalysis\NullableWalker_Patterns.cs (2)
27BoundPattern pattern) 157BoundPattern 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, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8705public BoundPattern Negated { get; } 8710public BoundNegatedPattern Update(BoundPattern negated, TypeSymbol inputType, TypeSymbol narrowedType) 11927BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12084BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12510BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12524BoundPattern? leftOfPendingConjunction = (BoundPattern?)this.Visit(node.LeftOfPendingConjunction); 12526BoundPattern valuePattern = (BoundPattern)this.Visit(node.ValuePattern); 12562ImmutableArray<BoundPattern> subpatterns = this.VisitList(node.Subpatterns); 12574BoundPattern? pattern = (BoundPattern?)this.Visit(node.Pattern); 12594BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12600BoundPattern pattern = (BoundPattern)this.Visit(node.Pattern); 12619BoundPattern left = (BoundPattern)this.Visit(node.Left); 12620BoundPattern right = (BoundPattern)this.Visit(node.Right); 12627BoundPattern 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);