2 writes to NarrowedType
Microsoft.CodeAnalysis.CSharp (2)
Generated\BoundNodes.xml.Generated.cs (2)
8120this.NarrowedType = narrowedType; 8135this.NarrowedType = narrowedType;
136 references to NarrowedType
Microsoft.CodeAnalysis.CSharp (136)
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 (2)
20inputType.StrippedType().Equals(list.NarrowedType, TypeCompareKind.ConsiderEverything) && 27inputInfo = MakeConvertToType(inputInfo, list.Syntax, list.NarrowedType, isExplicitTest: false, tests);
Binder\DecisionDagBuilder.cs (4)
1148if (bin.InputType.Equals(bin.NarrowedType)) 1159var evaluation = new BoundDagTypeEvaluation(bin.Syntax, bin.NarrowedType, input); 1172outputInfo.DagTemp.Type.Equals(bin.NarrowedType, TypeCompareKind.AllIgnoreOptions) : 1173bin.NarrowedType.SpecialType == SpecialType.System_Object));
Binder\UnionMatchingRewriter.cs (13)
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; 283Debug.Assert(node.NarrowedType.Equals(leastSpecific ?? node.InputType, TypeCompareKind.ConsiderEverything)); 286return node.Update(disjunction: true, preboundLeft, right, inputType: node.InputType, narrowedType: node.NarrowedType); 297narrowedTypeCandidates.Add(result is BoundPatternWithUnionMatching unionResult ? getDisjunctionType(unionResult) : result.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)
8171if (value != this.Value || constantValue != this.ConstantValue || unionMatchingMode != this.UnionMatchingMode || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8213if (!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)) 8253if (!TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8308if (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)) 8351if (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)) 8395if (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)) 8434if (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)) 8474if (!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)) 8620if (declaredType != this.DeclaredType || isExplicitNotNullTest != this.IsExplicitNotNullTest || isUnionMatching != this.IsUnionMatching || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8659if (disjunction != this.Disjunction || left != this.Left || right != this.Right || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8693if (negated != this.Negated || !TypeSymbol.Equals(inputType, this.InputType, TypeCompareKind.ConsiderEverything) || !TypeSymbol.Equals(narrowedType, this.NarrowedType, TypeCompareKind.ConsiderEverything)) 8734if (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)) 12515TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12525TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12531TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12540TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12552TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12565TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12575TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12584TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12610TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12618TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12625TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 12632TypeSymbol? narrowedType = this.VisitType(node.NarrowedType); 15207TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15216TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15226TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15234TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15245TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15257TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15270TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15283TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15305TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15313TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 15321TypeSymbol narrowedType = GetUpdatedSymbol(node, node.NarrowedType); 17458new TreeDumperNode("narrowedType", node.NarrowedType, null), 17469new TreeDumperNode("narrowedType", node.NarrowedType, null), 17476new TreeDumperNode("narrowedType", node.NarrowedType, null), 17488new TreeDumperNode("narrowedType", node.NarrowedType, null), 17503new TreeDumperNode("narrowedType", node.NarrowedType, null), 17518new TreeDumperNode("narrowedType", node.NarrowedType, null), 17529new TreeDumperNode("narrowedType", node.NarrowedType, null), 17539new TreeDumperNode("narrowedType", node.NarrowedType, null), 17572new TreeDumperNode("narrowedType", node.NarrowedType, null), 17582new TreeDumperNode("narrowedType", node.NarrowedType, null), 17590new TreeDumperNode("narrowedType", node.NarrowedType, null), 17601new TreeDumperNode("narrowedType", node.NarrowedType, null),
Operations\CSharpOperationFactory.cs (12)
2587TypeSymbol narrowedType = boundConstantPattern.NarrowedType; 2598TypeSymbol narrowedType = boundRelationalPattern.NarrowedType; 2611ITypeSymbol narrowedType = boundDeclarationPattern.NarrowedType.GetPublicSymbol(); 2635boundRecursivePattern.NarrowedType.GetPublicSymbol(), 2654boundITuplePattern.NarrowedType.GetPublicSymbol(), 2663matchedType: boundTypePattern.NarrowedType.GetPublicSymbol(), 2665narrowedType: boundTypePattern.NarrowedType.GetPublicSymbol(), 2678narrowedType: boundNode.NarrowedType.GetPublicSymbol(), 2692narrowedType: boundNode.NarrowedType.GetPublicSymbol(), 2703boundNegatedPattern.NarrowedType.GetPublicSymbol(), 2743boundBinaryPattern.NarrowedType.GetPublicSymbol(), 2912narrowedType: boundNode.NarrowedType.GetPublicSymbol(),