2 writes to NarrowedType
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
8139
this.
NarrowedType
= narrowedType;
8154
this.
NarrowedType
= narrowedType;
140 references to NarrowedType
Microsoft.CodeAnalysis.CSharp (140)
Binder\Binder_Patterns.cs (3)
2272
var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.
NarrowedType
, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching);
2275
var result = new BoundBinaryPattern(node, disjunction: isDisjunction, preboundLeft, right, inputType: inputType, narrowedType: right.
NarrowedType
, hasErrors);
2344
var candidate = pat.
NarrowedType
;
Binder\DecisionDagBuilder.cs (4)
1114
if (bin.InputType.Equals(bin.
NarrowedType
))
1126
var evaluation = new BoundDagTypeEvaluation(bin.Syntax, bin.
NarrowedType
, input);
1139
outputInfo.DagTemp.Type.Equals(bin.
NarrowedType
, TypeCompareKind.AllIgnoreOptions) :
1140
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)
81
if (Binder.IsClassOrNullableValueTypeUnionNullPatternMatching((NamedTypeSymbol)node.InputType, node.ConstantValue) && node.
NarrowedType
.Equals(node.InputType, TypeCompareKind.AllIgnoreOptions))
100
node.Update(node.Value, node.ConstantValue, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
115
isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
131
TypeSymbol? narrowedType = node.
NarrowedType
;
152
isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
166
isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
179
node.Update(node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
192
node.Update(node.Relation, node.Value, node.ConstantValue, isUnionMatching: false, inputType: ObjectType, narrowedType: node.
NarrowedType
));
202
TypeSymbol? narrowedType = node.
NarrowedType
;
221
TypeSymbol? narrowedType = node.
NarrowedType
;
310
Debug.Assert(node.
NarrowedType
.Equals(leastSpecific ?? node.InputType, TypeCompareKind.ConsiderEverything));
313
return node.Update(disjunction: true, preboundLeft, right, inputType: node.InputType, narrowedType: node.
NarrowedType
);
324
narrowedTypeCandidates.Add(result is BoundPatternWithUnionMatching unionResult ? getDisjunctionType(unionResult) : result.
NarrowedType
);
426
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 (2)
16
Debug.Assert(
NarrowedType
.IsObjectType());
21
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)
159
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));
FlowAnalysis\AbstractFlowPass.cs (1)
978
rewritten.InputType, rewritten.
NarrowedType
);
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))
8714
if (negated != this.Negated || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.
NarrowedType
, TypeCompareKind.ConsiderEverything))
8755
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))
12521
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12531
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12537
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12546
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12558
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12571
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12581
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12590
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12616
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12624
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12631
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
12638
TypeSymbol? narrowedType = this.VisitType(node.
NarrowedType
);
15208
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15217
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15227
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15235
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15246
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15258
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15271
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15284
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15306
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15314
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
15322
TypeSymbol narrowedType = GetUpdatedSymbol(node, node.
NarrowedType
);
17456
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17467
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17474
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17486
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17501
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17517
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17528
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),
17591
new TreeDumperNode("narrowedType", node.
NarrowedType
, null),
17602
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(),