1 write to Type
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
73Type = type;
94 references to Type
Microsoft.CodeAnalysis.CSharp (94)
FlowAnalysis\NullableWalker.cs (82)
130Debug.Assert(TypeSymbol.Equals(RValueType.Type, LValueType.Type, TypeCompareKind.ConsiderEverything)); 344Debug.Assert(TypeAllowsConditionalState(visitResult.RValueType.Type) 405expr.Type?.Equals(result.RValueType.Type, TypeCompareKind.AllIgnoreOptions) == true ? result.RValueType.Type : expr.Type); 539Debug.Assert(AreCloseEnough(placeholder.Type, result.RValueType.Type)); 2369!targetType.Type.Equals(valueType.Type, TypeCompareKind.AllIgnoreOptions)) 2417return valueType.Type?.TypeKind == TypeKind.TypeParameter && 2625target.Type.Equals(assignedValue.Type, TypeCompareKind.AllIgnoreOptions); 3607Debug.Assert((object?)resultType.Type != _invalidType.Type); 3608Debug.Assert(AreCloseEnough(resultType.Type, node.Type)); 4388Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4446Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4851var type = ResultType.Type as ArrayTypeSymbol; 4877var expressionType = VisitRvalueWithState(node.Expression).Type; 5158TypeSymbol asMemberOfType = getTypeIfContainingType(methodContainer, leftUnderlyingType.Type, leftOperand) ?? 5159getTypeIfContainingType(methodContainer, rightUnderlyingType.Type, rightOperand) ?? methodContainer; 5633Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions)); 5676var leftResultType = leftResult.Type; 5677var rightResultType = rightResult.Type; 5730Debug.Assert(conversionResult.Type is not null); 5731return (conversionResult.Type!, conversionResult.State); 5979refResultType = consequenceRValue.Type!.MergeEquivalentTypes(alternativeRValue.Type, VarianceKind.None); 6007resultType = alternativeRValue.Type; 6011resultType = consequenceRValue.Type; 6224var rvalueType = _currentConditionalReceiverVisitResult.RValueType.Type; 6343method = (MethodSymbol)AsMemberOfType(receiverType.Type, method); 6386isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 6397isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 6610var type = receiverType.Type; 6707return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 6712return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7428var argumentResultType = resultType.Type; 7513hasNoNonNullableCounterpart(valueState.Type) && 7695return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7701return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7716return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7720return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7735return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7739return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7980method = (MethodSymbol)AsMemberOfType(receiverType.Type, method); 8214return TypeWithState.Create(type.Type, state); 9029if (operandType.Type?.IsTupleType == true || conversionOperand.Kind == BoundKind.TupleLiteral) 9040conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9051if (AreNullableAndUnderlyingTypes(targetType, operandType.Type, out TypeWithAnnotations underlyingType)) 9066conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9074if (operandType.Type?.IsNullableType() == true && !targetType.IsNullableType()) 9108TrackNullableStateOfTupleConversion(conversionOpt, conversionOperand, conversion, targetType, operandType.Type, slot, valueSlot, assignmentKind, parameterOpt, reportWarnings: reportRemainingWarnings); 9118conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9136conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9146conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9170ReportNullabilityMismatchInArgument(getDiagnosticLocation(), operandType.Type, parameterOpt, targetType, forOutput: false); 9174ReportNullabilityMismatchInAssignment(getDiagnosticLocation(), GetTypeAsDiagnosticArgument(operandType.Type), targetType); 9215var type = operandType.Type; 9246var type = operandType.Type; 9439Debug.Assert(operandType.Type is object); 9447if (operandType.Type.IsNullableType() && !parameterType.IsNullableType()) 9449var underlyingOperandTypeWithAnnotations = operandType.Type.GetNullableUnderlyingTypeWithAnnotations(); 9587var type = typeWithState.Type; 9619Debug.Assert(operandType.Type is object); 9622var conversion = _conversions.ClassifyStandardConversion(operandType.Type, targetType.Type, ref discardedUseSiteInfo); 9627ReportNullabilityMismatchInArgument(diagnosticLocation, operandType.Type, parameterOpt, targetType.Type, forOutput: false); 9631ReportNullabilityMismatchInAssignment(diagnosticLocation, operandType.Type, targetType.Type); 9874method = (MethodSymbol)AsMemberOfType(receiverType.Type, method); 10223Debug.Assert(rightResult.Type is object); 10233deconstructMethod = (MethodSymbol)AsMemberOfType(rightResult.Type, deconstructMethod); 10375AreNullableAndUnderlyingTypes(lvalueType.Type, operandType.Type, out TypeWithAnnotations underlyingType)) 10664if (argumentType.Type is { } argType && IsNullabilityMismatch(paramType.Type, argType)) 10749var receiverType = VisitRvalueWithState(receiverOpt).Type; 10825member = AsMemberOfType(receiverType.Type, member); 10839if (PossiblyNullableType(resultType.Type)) 10845resultType = TypeWithState.Create(resultType.Type, state); 10950var resultType = resultTypeWithState.Type; 11062getEnumeratorType = spanType.Construct(ImmutableArray.Create(convertedResult.Type!.TryGetInlineArrayElementField()!.TypeWithAnnotations)); 11066getEnumeratorType = convertedResult.Type; 11082var currentPropertyGetter = (MethodSymbol)AsMemberOfType(enumeratorReturnType.Type, enumeratorInfoOpt.CurrentPropertyGetter); 11322method = (MethodSymbol)AsMemberOfType(operandType.Type!.StrippedType(), method); 11503var reinferredGetResult = _visitResult.RValueType.Type is NamedTypeSymbol taskAwaiterType 11748@event = (EventSymbol)AsMemberOfType(ResultType.Type, @event); 11857var resultTypeSymbol = resultType.Type; 12163Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
FlowAnalysis\NullableWalker_Patterns.cs (2)
410Debug.Assert(isDerivedType(NominalSlotType(originalInputSlot), expressionTypeWithState.Type)); 411tempMap.Add(rootTemp, (originalInputSlot, expressionTypeWithState.Type));
Symbols\TypeWithState.cs (10)
18[MemberNotNullWhen(false, nameof(Type))] 19public bool HasNullType => Type is null; 77public string GetDebuggerDisplay() => $"{{Type:{Type?.GetDebuggerDisplay()}, State:{State}{"}"}"; 81public TypeWithState WithNotNullState() => new TypeWithState(Type, NullableFlowState.NotNull); 83public TypeWithState WithSuppression(bool suppress) => suppress ? new TypeWithState(Type, NullableFlowState.NotNull) : this; 87if (Type?.IsTypeParameterDisallowingAnnotationInCSharp8() == true) 89var type = TypeWithAnnotations.Create(Type, NullableAnnotation.NotAnnotated); 93(Type?.IsValueType == true ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated) : 94(State.IsNotNull() || Type?.CanContainNull() == false ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated); 95return TypeWithAnnotations.Create(this.Type, annotation);