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