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