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)
542node, convertedExpression, constantValueOpt, unionMatchingMode: UnionMatchingMode.Both, inputType: unionMatchingInputType, narrowedType: unionMatchingInputType, hasErrors); 553unionMatchingMode: hasUnionMatching ? UnionMatchingMode.UnionValue : UnionMatchingMode.None, 1035(BoundTypeExpression boundDeclType, UnionMatchingMode unionMatchingMode) = BindTypeForPattern(node, typeSyntax, unionType, inputType, ref permitDesignations, ref hasErrors, diagnostics); 1036hasUnionMatching = unionMatchingMode != UnionMatchingMode.None; 1046private (BoundTypeExpression, UnionMatchingMode) BindTypeForPattern( 1060UnionMatchingMode unionMatchingMode = DetermineUnionMatchingMode( 1168UnionMatchingMode unionMatchingMode; 1180unionMatchingMode = UnionMatchingMode.None; 1183hasUnionMatching = unionMatchingMode != UnionMatchingMode.None; 1221Debug.Assert(unionMatchingMode == UnionMatchingMode.None); 1602boundOperandType, isVar: true, unionMatchingMode: UnionMatchingMode.None, variableSymbol, variableAccess, 1680isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, inputType: inputType, narrowedType: strippedInputType, hasErrors: hasErrors); 1926private UnionMatchingMode DetermineUnionMatchingMode( 1943UnionMatchingMode unionMatchingMode; 1958unionMatchingMode = UnionMatchingMode.None; 1962unionMatchingMode |= UnionMatchingMode.UnionValue; 1965unionMatchingMode |= UnionMatchingMode.UnionInstance; 1998unionMatchingMode = UnionMatchingMode.None; 2021UnionMatchingMode unionMatchingMode = DetermineUnionMatchingMode( 2032hasUnionMatching = unionMatchingMode != UnionMatchingMode.None; 2035Debug.Assert(!isExplicitNotNullTest || unionMatchingMode == UnionMatchingMode.None); 2111unionMatchingMode: hasUnionMatching ? UnionMatchingMode.UnionValue : UnionMatchingMode.None, 2376if (pat is { UnionMatchingMode: not UnionMatchingMode.None })
Binder\DecisionDagBuilder_CheckOrReachability.cs (13)
868Debug.Assert(node is not BoundPattern { UnionMatchingMode: not UnionMatchingMode.None }); 1058return typePattern1.Update(typePattern1.DeclaredType, typePattern1.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, inputType, typePattern1.NarrowedType); 1068unionMatchingMode: UnionMatchingMode.None, recursivePattern.Variable, recursivePattern.VariableAccess, 1087return constantPattern.Update(constantPattern.Value, constantPattern.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType, narrowedType); 1092return relationalPattern.Update(relationalPattern.Relation, relationalPattern.Value, relationalPattern.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType, relationalPattern.NarrowedType); 1098return declarationPattern.Update(declarationPattern.DeclaredType, declarationPattern.IsVar, unionMatchingMode: UnionMatchingMode.None, 1108isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, inputType, narrowedType: pattern.InputType).MakeCompilerGenerated(); 1122var result = new BoundDeclarationPattern(node.Syntax, node.DeclaredType, node.IsVar, unionMatchingMode: UnionMatchingMode.None, node.Variable, node.VariableAccess, node.InputType, node.NarrowedType) 1162initialCheck = new BoundTypePattern(node.Syntax, node.DeclaredType, node.IsExplicitNotNullTest, unionMatchingMode: UnionMatchingMode.None, node.InputType, node.NarrowedType, node.HasErrors); 1169ConstantValue.Null, unionMatchingMode: UnionMatchingMode.None, node.InputType, node.InputType, hasErrors: false); 1176ImmutableArray<BoundPropertySubpattern>.Empty, isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, variable: null, variableAccess: null, node.InputType, node.InputType); 1201properties: default, isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, variable: null, variableAccess: null, 1236isExplicitNotNullTest: false, unionMatchingMode: UnionMatchingMode.None, variable: null, variableAccess: null,
Binder\DecisionDagBuilder.cs (1)
372Debug.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)
8144public BoundConstantPattern(SyntaxNode syntax, BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8164public override UnionMatchingMode UnionMatchingMode { get; } 8169public BoundConstantPattern Update(BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType) 8286public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8305public override UnionMatchingMode UnionMatchingMode { get; } 8310public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8324public 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) 8348public override UnionMatchingMode UnionMatchingMode { get; } 8353public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8598public BoundTypePattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8617public override UnionMatchingMode UnionMatchingMode { get; } 8622public BoundTypePattern Update(BoundTypeExpression declaredType, bool isExplicitNotNullTest, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType) 8709public BoundRelationalPattern(SyntaxNode syntax, BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8731public override UnionMatchingMode UnionMatchingMode { get; } 8736public BoundRelationalPattern Update(BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, UnionMatchingMode unionMatchingMode, TypeSymbol inputType, TypeSymbol narrowedType)