97 references to UnionMatchingMode
Microsoft.CodeAnalysis.CSharp (97)
Binder\Binder_Operators.cs (5)
4860if (typePattern.UnionMatchingMode != UnionMatchingMode.None) 5002node.Right, convertedExpression, constantValueOpt, unionMatchingMode: UnionMatchingMode.Both, inputType: unionMatchingInputType, narrowedType: unionMatchingInputType, hasErrors).MakeCompilerGenerated(); 5010unionMatchingMode: unionMatchingInputType is not null ? UnionMatchingMode.UnionValue : UnionMatchingMode.None, 5018boundConstantPattern.UnionMatchingMode != UnionMatchingMode.None,
Binder\Binder_Patterns.cs (25)
1028node, convertedExpression, constantValueOpt, unionMatchingMode: UnionMatchingMode.Both, inputType: unionMatchingInputType, narrowedType: unionMatchingInputType, hasErrors); 1039unionMatchingMode: hasUnionMatching ? UnionMatchingMode.UnionValue : UnionMatchingMode.None, 1521(BoundTypeExpression boundDeclType, UnionMatchingMode unionMatchingMode) = BindTypeForPattern(node, typeSyntax, unionType, inputType, ref permitDesignations, ref hasErrors, diagnostics); 1522hasUnionMatching = unionMatchingMode != UnionMatchingMode.None; 1532private (BoundTypeExpression, UnionMatchingMode) BindTypeForPattern( 1546UnionMatchingMode unionMatchingMode = DetermineUnionMatchingMode( 1654UnionMatchingMode unionMatchingMode; 1666unionMatchingMode = UnionMatchingMode.None; 1669hasUnionMatching = unionMatchingMode != UnionMatchingMode.None; 1707Debug.Assert(unionMatchingMode == UnionMatchingMode.None); 2088boundOperandType, isVar: true, unionMatchingMode: UnionMatchingMode.None, variableSymbol, variableAccess, 2166isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, inputType: inputType, narrowedType: strippedInputType, hasErrors: hasErrors); 2412private UnionMatchingMode DetermineUnionMatchingMode( 2429UnionMatchingMode unionMatchingMode; 2444unionMatchingMode = UnionMatchingMode.None; 2448unionMatchingMode |= UnionMatchingMode.UnionValue; 2451unionMatchingMode |= UnionMatchingMode.UnionInstance; 2484unionMatchingMode = UnionMatchingMode.None; 2507UnionMatchingMode unionMatchingMode = DetermineUnionMatchingMode( 2518hasUnionMatching = unionMatchingMode != UnionMatchingMode.None; 2521Debug.Assert(!isExplicitNotNullTest || unionMatchingMode == UnionMatchingMode.None); 2597unionMatchingMode: hasUnionMatching ? UnionMatchingMode.UnionValue : UnionMatchingMode.None, 2862if (pat is { UnionMatchingMode: not UnionMatchingMode.None })
Binder\DecisionDagBuilder_CheckOrReachability.cs (13)
798Debug.Assert(node is not BoundPattern { UnionMatchingMode: not UnionMatchingMode.None }); 988return typePattern1.Update(typePattern1.DeclaredType, typePattern1.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, inputType, typePattern1.NarrowedType); 998unionMatchingMode: UnionMatchingMode.None, recursivePattern.Variable, recursivePattern.VariableAccess, 1017return constantPattern.Update(constantPattern.Value, constantPattern.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType, narrowedType); 1022return relationalPattern.Update(relationalPattern.Relation, relationalPattern.Value, relationalPattern.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType, relationalPattern.NarrowedType); 1028return declarationPattern.Update(declarationPattern.DeclaredType, declarationPattern.IsVar, unionMatchingMode: UnionMatchingMode.None, 1038isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, inputType, narrowedType: pattern.InputType).MakeCompilerGenerated(); 1052var result = new BoundDeclarationPattern(node.Syntax, node.DeclaredType, node.IsVar, unionMatchingMode: UnionMatchingMode.None, node.Variable, node.VariableAccess, node.InputType, node.NarrowedType) 1092initialCheck = new BoundTypePattern(node.Syntax, node.DeclaredType, node.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, node.InputType, node.NarrowedType, node.HasErrors); 1099ConstantValue.Null, unionMatchingMode: UnionMatchingMode.None, node.InputType, node.InputType, hasErrors: false); 1106ImmutableArray<BoundPropertySubpattern>.Empty, isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, variable: null, variableAccess: null, node.InputType, node.InputType); 1131properties: default, isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, variable: null, variableAccess: null, 1166isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, variable: null, variableAccess: null,
Binder\DecisionDagBuilder.cs (1)
364Debug.Assert(pattern.UnionMatchingMode == UnionMatchingMode.None);
Binder\UnionMatchingRewriter.cs (26)
82if (node.UnionMatchingMode != UnionMatchingMode.None) 85Debug.Assert((node.UnionMatchingMode & UnionMatchingMode.UnionValue) != 0); 87if ((node.UnionMatchingMode & UnionMatchingMode.UnionInstance) != 0) 96node.Update(node.Value, node.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType: ObjectType, narrowedType: ObjectType)); 100left: node.Update(node.Value, node.ConstantValue, unionMatchingMode: UnionMatchingMode.None, node.InputType, node.InputType).MakeCompilerGenerated(), 109node.Update(node.Value, node.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType: ObjectType, narrowedType: node.NarrowedType)); 118if (node.UnionMatchingMode != UnionMatchingMode.None) 122exclusiveInstancePattern: (node.UnionMatchingMode & UnionMatchingMode.UnionInstance) == 0 ? null : 124unionMatchingMode: UnionMatchingMode.None, node.Variable, node.VariableAccess, inputType: node.InputType, narrowedType: node.NarrowedType), 126node.DeclaredType, node.DeconstructMethod, node.Deconstruction, node.Properties, node.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, node.Variable, node.VariableAccess, 145Debug.Assert(node.UnionMatchingMode == UnionMatchingMode.None); 152if (node.UnionMatchingMode != UnionMatchingMode.None) 156exclusiveInstancePattern: (node.UnionMatchingMode & UnionMatchingMode.UnionInstance) == 0 ? null : 157node.Update(node.DeclaredType, node.IsVar, unionMatchingMode: UnionMatchingMode.None, node.Variable, node.VariableAccess, 159exclusiveValuePattern: node.Update(node.DeclaredType, node.IsVar, unionMatchingMode: UnionMatchingMode.None, node.Variable, node.VariableAccess, 169if (node.UnionMatchingMode != UnionMatchingMode.None) 171Debug.Assert((node.UnionMatchingMode & UnionMatchingMode.UnionValue) != 0); 175exclusiveInstancePattern: (node.UnionMatchingMode & UnionMatchingMode.UnionInstance) == 0 ? null : 176node.Update(node.DeclaredType, node.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, inputType: node.InputType, narrowedType: node.NarrowedType), 177exclusiveValuePattern: node.Update(node.DeclaredType, node.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, inputType: ObjectType, narrowedType: node.NarrowedType)); 186if (node.UnionMatchingMode != UnionMatchingMode.None) 188Debug.Assert(node.UnionMatchingMode == UnionMatchingMode.UnionValue); 191node.Update(node.Relation, node.Value, node.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType: ObjectType, narrowedType: node.NarrowedType)); 199Debug.Assert(node.UnionMatchingMode == UnionMatchingMode.None); 471unionMatchingMode: UnionMatchingMode.None, 543unionMatchingMode: UnionMatchingMode.None,
BoundTree\BoundConstantPattern.cs (1)
14if (UnionMatchingMode != UnionMatchingMode.None)
BoundTree\BoundITuplePattern.cs (1)
14Debug.Assert(UnionMatchingMode == UnionMatchingMode.None);
BoundTree\BoundListPattern.cs (1)
25Debug.Assert(UnionMatchingMode == UnionMatchingMode.None);
BoundTree\BoundNegatedPattern.cs (1)
17Debug.Assert(UnionMatchingMode == UnionMatchingMode.None);
BoundTree\BoundPattern.cs (5)
24Debug.Assert(negatedPattern.UnionMatchingMode == UnionMatchingMode.None); 31public virtual UnionMatchingMode UnionMatchingMode => UnionMatchingMode.None; 35Debug.Assert(UnionMatchingMode != UnionMatchingMode.UnionInstance); 36Debug.Assert(UnionMatchingMode == UnionMatchingMode.None || InputType is { IsSubjectForUnionMatching: true });
BoundTree\BoundRecursivePattern.cs (1)
17Debug.Assert(UnionMatchingMode == UnionMatchingMode.None);
BoundTree\BoundRelationalPattern.cs (2)
14if (UnionMatchingMode != UnionMatchingMode.None) 16Debug.Assert((UnionMatchingMode & UnionMatchingMode.UnionInstance) == 0);
Generated\BoundNodes.xml.Generated.cs (15)
8143public BoundConstantPattern(SyntaxNode syntax, BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8163public override UnionMatchingMode UnionMatchingMode { get; } 8168public BoundConstantPattern Update(BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType) 8285public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8304public override UnionMatchingMode UnionMatchingMode { get; } 8309public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8323public BoundRecursivePattern(SyntaxNode syntax, BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8347public override UnionMatchingMode UnionMatchingMode { get; } 8352public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8597public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8616public override UnionMatchingMode UnionMatchingMode { get; } 8621public BoundTypePattern Update(BoundTypeExpression declaredType, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType) 8708public BoundRelationalPattern(SyntaxNode syntax, BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8730public override UnionMatchingMode UnionMatchingMode { get; } 8735public BoundRelationalPattern Update(BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType)