2 writes to NarrowedType
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
8123
this.
NarrowedType
= narrowedType;
8138
this.
NarrowedType
= narrowedType;
133 references to NarrowedType
Microsoft.CodeAnalysis.CSharp (133)
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 (1)
27
inputInfo = MakeConvertToType(inputInfo, list.Syntax, list.
NarrowedType
, isExplicitTest: false, tests);
Binder\DecisionDagBuilder.cs (4)
1149
if (bin.InputType.Equals(bin.
NarrowedType
))
1160
var evaluation = new BoundDagTypeEvaluation(bin.Syntax, bin.
NarrowedType
, input);
1173
outputInfo.DagTemp.Type.Equals(bin.
NarrowedType
, TypeCompareKind.AllIgnoreOptions) :
1174
bin.
NarrowedType
.SpecialType == SpecialType.System_Object));
Binder\UnionMatchingRewriter.cs (11)
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
;
286
return node.Update(disjunction: true, preboundLeft, right, inputType: node.InputType, narrowedType: node.
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)
8174
if (value != this.Value || constantValue != this.ConstantValue || unionMatchingMode != this.UnionMatchingMode || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8216
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))
8256
if (!TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8311
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))
8354
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))
8398
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))
8437
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))
8477
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))
8623
if (declaredType != this.DeclaredType || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8662
if (disjunction != this.Disjunction || left != this.Left || right != this.Right || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8696
if (negated != this.Negated || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8737
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))
12518
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12528
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12534
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12543
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12555
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12568
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12578
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12587
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12613
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12621
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12628
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12635
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
15210
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15219
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15229
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15237
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15248
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15260
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15273
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15286
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15308
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15316
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15324
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
17462
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17473
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17480
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17492
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17507
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17522
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17533
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17543
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17576
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17586
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17594
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17605
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
Operations\CSharpOperationFactory.cs (12)
2606
TypeSymbol narrowedType = boundConstantPattern.
NarrowedType
;
2617
TypeSymbol narrowedType = boundRelationalPattern.
NarrowedType
;
2630
ITypeSymbol narrowedType = boundDeclarationPattern.
NarrowedType
.GetPublicSymbol();
2654
boundRecursivePattern.
NarrowedType
.GetPublicSymbol(),
2673
boundITuplePattern.
NarrowedType
.GetPublicSymbol(),
2682
matchedType: boundTypePattern.
NarrowedType
.GetPublicSymbol(),
2684
narrowedType: boundTypePattern.
NarrowedType
.GetPublicSymbol(),
2697
narrowedType: boundNode.
NarrowedType
.GetPublicSymbol(),
2711
narrowedType: boundNode.
NarrowedType
.GetPublicSymbol(),
2722
boundNegatedPattern.
NarrowedType
.GetPublicSymbol(),
2762
boundBinaryPattern.
NarrowedType
.GetPublicSymbol(),
2931
narrowedType: boundNode.
NarrowedType
.GetPublicSymbol(),