2 writes to NarrowedType
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
8123this.NarrowedType = narrowedType; 8138this.NarrowedType = narrowedType;
133 references to NarrowedType
Microsoft.CodeAnalysis.CSharp (133)
Binder\Binder_Patterns.cs (4)
2085Debug.Assert(currentUnionType is null || subPattern.NarrowedType.IsObjectType()); 2179var right = binder.BindPattern(node.Right, ref unionType, preboundLeft.NarrowedType, permitDesignations, hasErrors, diagnostics, out bool rightHasUnionMatching, underIsPattern: false); 2182var result = new BoundBinaryPattern(node, disjunction: isDisjunction, preboundLeft, right, inputType: inputType, narrowedType: right.NarrowedType, hasErrors); 2251var candidate = pat.NarrowedType;
Binder\DecisionDagBuilder_CheckOrReachability.cs (21)
558var wrappedPattern = new BoundBinaryPattern(newPattern.Syntax, disjunction: false, current.Left, newPattern, current.InputType, newPattern.NarrowedType); 832inputType = stack.Peek().NarrowedType; 850if (resultRight.NarrowedType.Equals(resultLeft.NarrowedType, TypeCompareKind.AllIgnoreOptions)) 852return resultLeft.NarrowedType; 859narrowedType = resultRight.NarrowedType; 1058return typePattern1.Update(typePattern1.DeclaredType, typePattern1.IsExplicitNotNullTest, isUnionMatching: false, inputType, typePattern1.NarrowedType); 1069inputType, recursivePattern.NarrowedType); 1086var narrowedType = constantPattern.ConstantValue.IsNull ? inputType : constantPattern.NarrowedType; 1092return relationalPattern.Update(relationalPattern.Relation, relationalPattern.Value, relationalPattern.ConstantValue, isUnionMatching: false, inputType, relationalPattern.NarrowedType); 1099variable: null, variableAccess: null, inputType, declarationPattern.NarrowedType); 1110var result = new BoundBinaryPattern(pattern.Syntax, disjunction: false, left: typePattern, right: pattern, inputType, pattern.NarrowedType); 1122var result = new BoundDeclarationPattern(node.Syntax, node.DeclaredType, node.IsVar, isUnionMatching: false, node.Variable, node.VariableAccess, node.InputType, node.NarrowedType) 1162initialCheck = new BoundTypePattern(node.Syntax, node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, node.InputType, node.NarrowedType, node.HasErrors); 1202node.InputType, node.NarrowedType, node.HasErrors); 1237node.InputType, node.NarrowedType, node.HasErrors); 1305ituplePattern.InputType, ituplePattern.NarrowedType); 1322ituplePattern.GetItemMethod, newSubpatterns, ituplePattern.InputType, ituplePattern.NarrowedType); 1387listPattern.InputType, listPattern.NarrowedType); 1411slice.ReceiverPlaceholder, slice.ArgumentPlaceholder, slice.InputType, slice.NarrowedType); 1418listPattern.InputType, listPattern.NarrowedType);
Binder\DecisionDagBuilder_ListPatterns.cs (1)
27inputInfo = MakeConvertToType(inputInfo, list.Syntax, list.NarrowedType, isExplicitTest: false, tests);
Binder\DecisionDagBuilder.cs (4)
1149if (bin.InputType.Equals(bin.NarrowedType)) 1160var evaluation = new BoundDagTypeEvaluation(bin.Syntax, bin.NarrowedType, input); 1173outputInfo.DagTemp.Type.Equals(bin.NarrowedType, TypeCompareKind.AllIgnoreOptions) : 1174bin.NarrowedType.SpecialType == SpecialType.System_Object));
Binder\UnionMatchingRewriter.cs (11)
84Debug.Assert(node.NarrowedType.Equals(node.InputType, TypeCompareKind.AllIgnoreOptions)); 103node.Update(node.Value, node.ConstantValue, unionMatchingMode: UnionMatchingMode.None, inputType: ObjectType, narrowedType: node.NarrowedType)); 118inputType: ObjectType, narrowedType: node.NarrowedType)); 134TypeSymbol? narrowedType = node.NarrowedType; 148inputType: ObjectType, narrowedType: node.NarrowedType)); 161node.Update(node.DeclaredType, node.IsExplicitNotNullTest, isUnionMatching: false, inputType: ObjectType, narrowedType: node.NarrowedType)); 174node.Update(node.Relation, node.Value, node.ConstantValue, isUnionMatching: false, inputType: ObjectType, narrowedType: node.NarrowedType)); 184return node.Update(negated, node.InputType, node.NarrowedType); 194TypeSymbol? narrowedType = node.NarrowedType; 286return node.Update(disjunction: true, preboundLeft, right, inputType: node.InputType, narrowedType: node.NarrowedType); 399return new BoundBinaryPattern(node, disjunction: false, left, right, inputType: left.InputType, narrowedType: right.NarrowedType) { WasCompilerGenerated = makeCompilerGenerated };
BoundTree\BoundBinaryPattern.cs (3)
25Debug.Assert(Right.InputType.Equals(Left.NarrowedType, TypeCompareKind.AllIgnoreOptions)); 26Debug.Assert(NarrowedType.Equals(Right.NarrowedType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundConstantPattern.cs (5)
18Debug.Assert(NarrowedType.IsObjectType() || 19NarrowedType.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions) || 20(ConstantValue == ConstantValue.Null && (InputType.IsNullableType() || !InputType.IsValueType) && NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions))); 24Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions) || 25NarrowedType.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundDeclarationPattern.cs (1)
14Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundDiscardPattern.cs (1)
13Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundITuplePattern.cs (2)
15Debug.Assert(NarrowedType.IsCompilerServicesTopLevelType() && NarrowedType.Name == "ITuple");
BoundTree\BoundListPattern.cs (2)
16return Update(subpatterns, this.HasSlice, this.LengthAccess, this.IndexerAccess, this.ReceiverPlaceholder, this.ArgumentPlaceholder, this.Variable, this.VariableAccess, this.InputType, this.NarrowedType); 26Debug.Assert(NarrowedType.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundNegatedPattern.cs (1)
14Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundPatternWithUnionMatching.cs (5)
16Debug.Assert(UnionMatchingInputType == (object)(LeftOfPendingConjunction?.NarrowedType ?? InputType)); 17Debug.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)
18Debug.Assert(NarrowedType.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions)); 22Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundRelationalPattern.cs (4)
16Debug.Assert(NarrowedType.IsObjectType() || 17NarrowedType.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions)); 21Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions) || 22NarrowedType.Equals(Value.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundSlicePattern.cs (2)
13return Update(pattern, this.IndexerAccess, this.ReceiverPlaceholder, this.ArgumentPlaceholder, this.InputType, this.NarrowedType); 21Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundTreeRewriter.cs (1)
375left = binary.Update(binary.Disjunction, left, right, VisitType(binary.InputType), VisitType(binary.NarrowedType));
BoundTree\BoundTypePattern.cs (1)
13Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\NullabilityRewriter.cs (1)
160TypeSymbol narrowedType = GetUpdatedSymbol(currentBinary, currentBinary.NarrowedType);
Compilation\CSharpSemanticModel.cs (2)
2040pattern.InputType, pattern.NarrowedType, nullability: default, convertedNullability: default, 2041Compilation.Conversions.ClassifyBuiltInConversion(pattern.InputType, pattern.NarrowedType, isChecked: false, ref discardedUseSiteInfo));
Generated\BoundNodes.xml.Generated.cs (47)
8174if (value != this.Value || constantValue != this.ConstantValue || unionMatchingMode != this.UnionMatchingMode || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8216if (!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)) 8256if (!TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8311if (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)) 8354if (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)) 8398if (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)) 8437if (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)) 8477if (!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)) 8623if (declaredType != this.DeclaredType || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8662if (disjunction != this.Disjunction || left != this.Left || right != this.Right || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8696if (negated != this.Negated || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8737if (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)) 12518TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12528TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12534TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12543TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12555TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12568TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12578TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12587TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12613TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12621TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12628TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12635TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 15210TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15219TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15229TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15237TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15248TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15260TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15273TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15286TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15308TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15316TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15324TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 17462new TreeDumperNode("narrowedType", node.NarrowedType, null), 17473new TreeDumperNode("narrowedType", node.NarrowedType, null), 17480new TreeDumperNode("narrowedType", node.NarrowedType, null), 17492new TreeDumperNode("narrowedType", node.NarrowedType, null), 17507new TreeDumperNode("narrowedType", node.NarrowedType, null), 17522new TreeDumperNode("narrowedType", node.NarrowedType, null), 17533new TreeDumperNode("narrowedType", node.NarrowedType, null), 17543new TreeDumperNode("narrowedType", node.NarrowedType, null), 17576new TreeDumperNode("narrowedType", node.NarrowedType, null), 17586new TreeDumperNode("narrowedType", node.NarrowedType, null), 17594new TreeDumperNode("narrowedType", node.NarrowedType, null), 17605new TreeDumperNode("narrowedType", node.NarrowedType, null),
Operations\CSharpOperationFactory.cs (12)
2606TypeSymbol narrowedType = boundConstantPattern.NarrowedType; 2617TypeSymbol narrowedType = boundRelationalPattern.NarrowedType; 2630ITypeSymbol narrowedType = boundDeclarationPattern.NarrowedType.GetPublicSymbol(); 2654boundRecursivePattern.NarrowedType.GetPublicSymbol(), 2673boundITuplePattern.NarrowedType.GetPublicSymbol(), 2682matchedType: boundTypePattern.NarrowedType.GetPublicSymbol(), 2684narrowedType: boundTypePattern.NarrowedType.GetPublicSymbol(), 2697narrowedType: boundNode.NarrowedType.GetPublicSymbol(), 2711narrowedType: boundNode.NarrowedType.GetPublicSymbol(), 2722boundNegatedPattern.NarrowedType.GetPublicSymbol(), 2762boundBinaryPattern.NarrowedType.GetPublicSymbol(), 2931narrowedType: boundNode.NarrowedType.GetPublicSymbol(),