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