2 writes to NarrowedType
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
8120
this.
NarrowedType
= narrowedType;
8135
this.
NarrowedType
= narrowedType;
136 references to NarrowedType
Microsoft.CodeAnalysis.CSharp (136)
Binder\Binder_Patterns.cs (4)
2085
Debug.Assert(currentUnionType is null || subPattern.
NarrowedType
.IsObjectType());
2179
var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.
NarrowedType
, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching, underIsPattern: false);
2182
var result = new BoundBinaryPattern(node, disjunction: isDisjunction, preboundLeft, right, inputType: inputType, narrowedType: right.
NarrowedType
, hasErrors);
2251
var candidate = pat.
NarrowedType
;
Binder\DecisionDagBuilder_CheckOrReachability.cs (21)
558
var wrappedPattern = new BoundBinaryPattern(newPattern.Syntax, disjunction: false, current.Left, newPattern, current.InputType, newPattern.
NarrowedType
);
832
inputType = stack.Peek().
NarrowedType
;
850
if (resultRight.
NarrowedType
.Equals(resultLeft.
NarrowedType
, TypeCompareKind.AllIgnoreOptions))
852
return resultLeft.
NarrowedType
;
859
narrowedType = resultRight.
NarrowedType
;
1058
return typePattern1.Update(typePattern1.DeclaredType, typePattern1.IsExplicitNotNullTest, isUnionMatching: false, inputType, typePattern1.
NarrowedType
);
1069
inputType, recursivePattern.
NarrowedType
);
1086
var narrowedType = constantPattern.ConstantValue.IsNull ? inputType : constantPattern.
NarrowedType
;
1092
return relationalPattern.Update(relationalPattern.Relation, relationalPattern.Value, relationalPattern.ConstantValue, isUnionMatching: false, inputType, relationalPattern.
NarrowedType
);
1099
variable: null, variableAccess: null, inputType, declarationPattern.
NarrowedType
);
1110
var result = new BoundBinaryPattern(pattern.Syntax, disjunction: false, left: typePattern, right: pattern, inputType, pattern.
NarrowedType
);
1122
var result = new BoundDeclarationPattern(node.Syntax, node.DeclaredType, node.IsVar, isUnionMatching: false, node.Variable, node.VariableAccess, node.InputType, node.
NarrowedType
)
1162
initialCheck = new BoundTypePattern(node.Syntax, node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, node.InputType, node.
NarrowedType
, node.HasErrors);
1202
node.InputType, node.
NarrowedType
, node.HasErrors);
1237
node.InputType, node.
NarrowedType
, node.HasErrors);
1305
ituplePattern.InputType, ituplePattern.
NarrowedType
);
1322
ituplePattern.GetItemMethod, newSubpatterns, ituplePattern.InputType, ituplePattern.
NarrowedType
);
1387
listPattern.InputType, listPattern.
NarrowedType
);
1411
slice.ReceiverPlaceholder, slice.ArgumentPlaceholder, slice.InputType, slice.
NarrowedType
);
1418
listPattern.InputType, listPattern.
NarrowedType
);
Binder\DecisionDagBuilder_ListPatterns.cs (2)
20
inputType.StrippedType().Equals(list.
NarrowedType
, TypeCompareKind.ConsiderEverything) &&
27
inputInfo = MakeConvertToType(inputInfo, list.Syntax, list.
NarrowedType
, isExplicitTest: false, tests);
Binder\DecisionDagBuilder.cs (4)
1148
if (bin.InputType.Equals(bin.
NarrowedType
))
1159
var evaluation = new BoundDagTypeEvaluation(bin.Syntax, bin.
NarrowedType
, input);
1172
outputInfo.DagTemp.Type.Equals(bin.
NarrowedType
, TypeCompareKind.AllIgnoreOptions) :
1173
bin.
NarrowedType
.SpecialType == SpecialType.System_Object));
Binder\UnionMatchingRewriter.cs (13)
84
Debug.Assert(node.
NarrowedType
.Equals(node.InputType, TypeCompareKind.AllIgnoreOptions));
103
node.Update(node.Value, node.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType: ObjectType, narrowedType: node.
NarrowedType
));
118
inputType: ObjectType, narrowedType: node.
NarrowedType
));
134
TypeSymbol? narrowedType = node.
NarrowedType
;
148
inputType: ObjectType, narrowedType: node.
NarrowedType
));
161
node.Update(node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
174
node.Update(node.Relation, node.Value, node.ConstantValue, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
184
return node.Update(negated, node.InputType, node.
NarrowedType
);
194
TypeSymbol? narrowedType = node.
NarrowedType
;
283
Debug.Assert(node.
NarrowedType
.Equals(leastSpecific ?? node.InputType, TypeCompareKind.ConsiderEverything));
286
return node.Update(disjunction: true, preboundLeft, right, inputType: node.InputType, narrowedType: node.
NarrowedType
);
297
narrowedTypeCandidates.Add(result is BoundPatternWithUnionMatching unionResult ? getDisjunctionType(unionResult) : result.
NarrowedType
);
399
return new BoundBinaryPattern(node, disjunction: false, left, right, inputType: left.InputType, narrowedType: right.
NarrowedType
) { WasCompilerGenerated = makeCompilerGenerated };
BoundTree\BoundBinaryPattern.cs (3)
25
Debug.Assert(Right.InputType.Equals(Left.
NarrowedType
, TypeCompareKind.AllIgnoreOptions));
26
Debug.Assert(
NarrowedType
.Equals(Right.
NarrowedType
, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundConstantPattern.cs (5)
18
Debug.Assert(
NarrowedType
.IsObjectType() ||
19
NarrowedType
.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions) ||
20
(ConstantValue == ConstantValue.Null && (InputType.IsNullableType() || !InputType.IsValueType) &&
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions)));
24
Debug.Assert(
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
25
NarrowedType
.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundDeclarationPattern.cs (1)
14
Debug.Assert(
NarrowedType
.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundDiscardPattern.cs (1)
13
Debug.Assert(
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundITuplePattern.cs (2)
15
Debug.Assert(
NarrowedType
.IsCompilerServicesTopLevelType() &&
NarrowedType
.Name == "ITuple");
BoundTree\BoundListPattern.cs (2)
16
return Update(subpatterns, this.HasSlice, this.LengthAccess, this.IndexerAccess, this.ReceiverPlaceholder, this.ArgumentPlaceholder, this.Variable, this.VariableAccess, this.InputType, this.
NarrowedType
);
26
Debug.Assert(
NarrowedType
.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundNegatedPattern.cs (1)
14
Debug.Assert(
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundPatternWithUnionMatching.cs (5)
16
Debug.Assert(UnionMatchingInputType == (object)(LeftOfPendingConjunction?.
NarrowedType
?? InputType));
17
Debug.Assert(
NarrowedType
== (object)ValuePattern.
NarrowedType
);
22
: this(syntax, unionType, leftOfPendingConjunction: null, valueProperty, pattern, inputType, pattern.
NarrowedType
)
27
: this(syntax, unionType, leftOfPendingConjunction, valueProperty, pattern, inputType, pattern.
NarrowedType
)
BoundTree\BoundRecursivePattern.cs (2)
18
Debug.Assert(
NarrowedType
.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions));
22
Debug.Assert(
NarrowedType
.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundRelationalPattern.cs (4)
16
Debug.Assert(
NarrowedType
.IsObjectType() ||
17
NarrowedType
.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions));
21
Debug.Assert(
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
22
NarrowedType
.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundSlicePattern.cs (2)
13
return Update(pattern, this.IndexerAccess, this.ReceiverPlaceholder, this.ArgumentPlaceholder, this.InputType, this.
NarrowedType
);
21
Debug.Assert(
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundTreeRewriter.cs (1)
375
left = binary.Update(binary.Disjunction, left, right, VisitType(binary.InputType), VisitType(binary.
NarrowedType
));
BoundTree\BoundTypePattern.cs (1)
13
Debug.Assert(
NarrowedType
.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\NullabilityRewriter.cs (1)
160
TypeSymbol narrowedType = GetUpdatedSymbol(currentBinary, currentBinary.
NarrowedType
);
Compilation\CSharpSemanticModel.cs (2)
2040
pattern.InputType, pattern.
NarrowedType
, nullability: default, convertedNullability: default,
2041
Compilation.Conversions.ClassifyBuiltInConversion(pattern.InputType, pattern.
NarrowedType
, isChecked: false, ref discardedUseSiteInfo));
Generated\BoundNodes.xml.Generated.cs (47)
8171
if (value != this.Value || constantValue != this.ConstantValue || unionMatchingMode != this.UnionMatchingMode || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8213
if (!TypeSymbol.Equals(unionMatchingInputType, this.UnionMatchingInputType, TypeCompareKind.ConsiderEverything) || leftOfPendingConjunction != this.LeftOfPendingConjunction || valueProperty != this.ValueProperty || valuePattern != this.ValuePattern || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8253
if (!TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8308
if (declaredType != this.DeclaredType || isVar != this.IsVar || isUnionMatching != this.IsUnionMatching || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8351
if (declaredType != this.DeclaredType || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(deconstructMethod, this.DeconstructMethod) || deconstruction != this.Deconstruction || properties != this.Properties || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8395
if (subpatterns != this.Subpatterns || hasSlice != this.HasSlice || lengthAccess != this.LengthAccess || indexerAccess != this.IndexerAccess || receiverPlaceholder != this.ReceiverPlaceholder || argumentPlaceholder != this.ArgumentPlaceholder || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8434
if (pattern != this.Pattern || indexerAccess != this.IndexerAccess || receiverPlaceholder != this.ReceiverPlaceholder || argumentPlaceholder != this.ArgumentPlaceholder || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8474
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getLengthMethod, this.GetLengthMethod) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getItemMethod, this.GetItemMethod) || subpatterns != this.Subpatterns || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8620
if (declaredType != this.DeclaredType || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8659
if (disjunction != this.Disjunction || left != this.Left || right != this.Right || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8693
if (negated != this.Negated || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8734
if (relation != this.Relation || value != this.Value || constantValue != this.ConstantValue || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
12515
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12525
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12531
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12540
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12552
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12565
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12575
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12584
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12610
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12618
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12625
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12632
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
15207
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15216
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15226
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15234
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15245
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15257
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15270
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15283
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15305
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15313
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15321
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
17458
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17469
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17476
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17488
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17503
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17518
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17529
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17539
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17572
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17582
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17590
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17601
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
Operations\CSharpOperationFactory.cs (12)
2587
TypeSymbol narrowedType = boundConstantPattern.
NarrowedType
;
2598
TypeSymbol narrowedType = boundRelationalPattern.
NarrowedType
;
2611
ITypeSymbol narrowedType = boundDeclarationPattern.
NarrowedType
.GetPublicSymbol();
2635
boundRecursivePattern.
NarrowedType
.GetPublicSymbol(),
2654
boundITuplePattern.
NarrowedType
.GetPublicSymbol(),
2663
matchedType: boundTypePattern.
NarrowedType
.GetPublicSymbol(),
2665
narrowedType: boundTypePattern.
NarrowedType
.GetPublicSymbol(),
2678
narrowedType: boundNode.
NarrowedType
.GetPublicSymbol(),
2692
narrowedType: boundNode.
NarrowedType
.GetPublicSymbol(),
2703
boundNegatedPattern.
NarrowedType
.GetPublicSymbol(),
2743
boundBinaryPattern.
NarrowedType
.GetPublicSymbol(),
2912
narrowedType: boundNode.
NarrowedType
.GetPublicSymbol(),