2 writes to NarrowedType
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
8139
this.
NarrowedType
= narrowedType;
8154
this.
NarrowedType
= narrowedType;
138 references to NarrowedType
Microsoft.CodeAnalysis.CSharp (138)
Binder\Binder_Patterns.cs (3)
2525
var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.
NarrowedType
, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching);
2528
var result = new BoundBinaryPattern(node, disjunction: isDisjunction, preboundLeft, right, inputType: inputType, narrowedType: right.
NarrowedType
, hasErrors);
2597
var candidate = pat.
NarrowedType
;
Binder\DecisionDagBuilder.cs (4)
1140
if (bin.InputType.Equals(bin.
NarrowedType
))
1151
var evaluation = new BoundDagTypeEvaluation(bin.Syntax, bin.
NarrowedType
, input);
1164
outputInfo.DagTemp.Type.Equals(bin.
NarrowedType
, TypeCompareKind.AllIgnoreOptions) :
1165
bin.
NarrowedType
.SpecialType == SpecialType.System_Object));
Binder\DecisionDagBuilder_CheckOrReachability.cs (21)
488
var wrappedPattern = new BoundBinaryPattern(newPattern.Syntax, disjunction: false, current.Left, newPattern, current.InputType, newPattern.
NarrowedType
);
762
inputType = stack.Peek().
NarrowedType
;
780
if (resultRight.
NarrowedType
.Equals(resultLeft.
NarrowedType
, TypeCompareKind.AllIgnoreOptions))
782
return resultLeft.
NarrowedType
;
789
narrowedType = resultRight.
NarrowedType
;
988
return typePattern1.Update(typePattern1.DeclaredType, typePattern1.IsExplicitNotNullTest, isUnionMatching: false, inputType, typePattern1.
NarrowedType
);
999
isUnionMatching: false, inputType, recursivePattern.
NarrowedType
);
1016
var narrowedType = constantPattern.ConstantValue.IsNull ? inputType : constantPattern.
NarrowedType
;
1022
return relationalPattern.Update(relationalPattern.Relation, relationalPattern.Value, relationalPattern.ConstantValue, isUnionMatching: false, inputType, relationalPattern.
NarrowedType
);
1029
variable: null, variableAccess: null, isUnionMatching: false, inputType, declarationPattern.
NarrowedType
);
1040
var result = new BoundBinaryPattern(pattern.Syntax, disjunction: false, left: typePattern, right: pattern, inputType, pattern.
NarrowedType
);
1052
var result = new BoundDeclarationPattern(node.Syntax, node.DeclaredType, node.IsVar, node.Variable, node.VariableAccess, isUnionMatching: false, node.InputType, node.
NarrowedType
)
1092
initialCheck = new BoundTypePattern(node.Syntax, node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, node.InputType, node.
NarrowedType
, node.HasErrors);
1132
isUnionMatching: false, node.InputType, node.
NarrowedType
, node.HasErrors);
1167
isUnionMatching: false, node.InputType, node.
NarrowedType
, node.HasErrors);
1235
isUnionMatching: false, ituplePattern.InputType, ituplePattern.
NarrowedType
);
1252
ituplePattern.GetItemMethod, newSubpatterns, isUnionMatching: false, ituplePattern.InputType, ituplePattern.
NarrowedType
);
1317
isUnionMatching: false, listPattern.InputType, listPattern.
NarrowedType
);
1341
slice.ReceiverPlaceholder, slice.ArgumentPlaceholder, slice.InputType, slice.
NarrowedType
);
1348
isUnionMatching: false, 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\UnionMatchingRewriter.cs (14)
79
if (Binder.IsClassOrNullableValueTypeUnionNullPatternMatching((NamedTypeSymbol)node.InputType, node.ConstantValue) && node.
NarrowedType
.Equals(node.InputType, TypeCompareKind.AllIgnoreOptions))
98
node.Update(node.Value, node.ConstantValue, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
113
isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
129
TypeSymbol? narrowedType = node.
NarrowedType
;
150
isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
164
isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
177
node.Update(node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
190
node.Update(node.Relation, node.Value, node.ConstantValue, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
200
return node.Update(negated, node.InputType, node.
NarrowedType
);
210
TypeSymbol? narrowedType = node.
NarrowedType
;
299
Debug.Assert(node.
NarrowedType
.Equals(leastSpecific ?? node.InputType, TypeCompareKind.ConsiderEverything));
302
return node.Update(disjunction: true, preboundLeft, right, inputType: node.InputType, narrowedType: node.
NarrowedType
);
313
narrowedTypeCandidates.Add(result is BoundPatternWithUnionMatching unionResult ? getDisjunctionType(unionResult) : result.
NarrowedType
);
415
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)
16
Debug.Assert(
NarrowedType
.IsObjectType() ||
17
NarrowedType
.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions) ||
18
(ConstantValue == ConstantValue.Null && (InputType.IsNullableType() || !InputType.IsValueType) &&
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions)));
22
Debug.Assert(
NarrowedType
.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
23
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)
14
Debug.Assert(
NarrowedType
.IsCompilerServicesTopLevelType() &&
NarrowedType
.Name == "ITuple");
BoundTree\BoundListPattern.cs (3)
16
return Update(subpatterns, this.HasSlice, this.LengthAccess, this.IndexerAccess, this.ReceiverPlaceholder, this.ArgumentPlaceholder, this.Variable, this.VariableAccess, this.IsUnionMatching, this.InputType, this.
NarrowedType
);
28
Debug.Assert(
NarrowedType
.IsObjectType());
32
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 (3)
19
Debug.Assert(
NarrowedType
.IsObjectType());
23
Debug.Assert(
NarrowedType
.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions));
28
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)
8190
if (value != this.Value || constantValue != this.ConstantValue || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8232
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))
8272
if (!TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8327
if (declaredType != this.DeclaredType || isVar != this.IsVar || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8368
if (declaredType != this.DeclaredType || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(deconstructMethod, this.DeconstructMethod) || deconstruction != this.Deconstruction || properties != this.Properties || isExplicitNotNullTest != this.IsExplicitNotNullTest || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(variable, this.Variable) || variableAccess != this.VariableAccess || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8412
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 || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8451
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))
8493
if (!Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getLengthMethod, this.GetLengthMethod) || !Symbols.SymbolEqualityComparer.ConsiderEverything.Equals(getItemMethod, this.GetItemMethod) || subpatterns != this.Subpatterns || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8639
if (declaredType != this.DeclaredType || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8678
if (disjunction != this.Disjunction || left != this.Left || right != this.Right || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8712
if (negated != this.Negated || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8753
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))
12519
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12529
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12535
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12544
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12556
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12569
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12579
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12588
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12614
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12622
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12629
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12636
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
15206
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15215
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15225
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15233
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15244
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15256
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15269
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15282
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15304
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15312
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15320
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
17454
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17465
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17472
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17484
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17499
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17515
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17526
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17537
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17570
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17580
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17588
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17599
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(),