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)); 350Debug.Assert(TypeAllowsConditionalState(visitResult.RValueType.Type) 411expr.Type?.Equals(result.RValueType.Type, TypeCompareKind.AllIgnoreOptions) == true ? result.RValueType.Type : expr.Type); 547Debug.Assert(AreCloseEnough(placeholder.Type, result.RValueType.Type)); 2391!targetType.Type.Equals(valueType.Type, TypeCompareKind.AllIgnoreOptions)) 2439return valueType.Type?.TypeKind == TypeKind.TypeParameter && 2647target.Type.Equals(assignedValue.Type, TypeCompareKind.AllIgnoreOptions); 3688Debug.Assert((object?)resultType.Type != _invalidType.Type); 3689Debug.Assert(AreCloseEnough(resultType.Type, node.Type)); 4472Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4530Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4937var type = ResultType.Type as ArrayTypeSymbol; 4963var expressionType = VisitRvalueWithState(node.Expression).Type; 5244TypeSymbol asMemberOfType = getTypeIfContainingType(methodContainer, leftUnderlyingType.Type, leftOperand) ?? 5245getTypeIfContainingType(methodContainer, rightUnderlyingType.Type, rightOperand) ?? methodContainer; 5719Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions)); 5762var leftResultType = leftResult.Type; 5763var rightResultType = rightResult.Type; 5816Debug.Assert(conversionResult.Type is not null); 5817return (conversionResult.Type!, conversionResult.State); 6065refResultType = consequenceRValue.Type!.MergeEquivalentTypes(alternativeRValue.Type, VarianceKind.None); 6093resultType = alternativeRValue.Type; 6097resultType = consequenceRValue.Type; 6310var rvalueType = _currentConditionalReceiverVisitResult.RValueType.Type; 6431method = (MethodSymbol)AsMemberOfType(receiverType.Type, method); 6474isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_Collections_Generic_IEqualityComparer_T__Equals)) 6485isWellKnownEqualityMethodOrImplementation(compilation, method, receiverType.Type, WellKnownMember.System_IEquatable_T__Equals))) 6698var type = receiverType.Type; 6801return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 6806return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7528var argumentResultType = resultType.Type; 7613hasNoNonNullableCounterpart(valueState.Type) && 7795return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7801return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7816return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7820return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7835return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7839return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 8080method = (MethodSymbol)AsMemberOfType(receiverType.Type, method); 8314return TypeWithState.Create(type.Type, state); 9133if (operandType.Type?.IsTupleType == true || conversionOperand.Kind == BoundKind.TupleLiteral) 9144conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9155if (AreNullableAndUnderlyingTypes(targetType, operandType.Type, out TypeWithAnnotations underlyingType)) 9170conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9178if (operandType.Type?.IsNullableType() == true && !targetType.IsNullableType()) 9212TrackNullableStateOfTupleConversion(conversionOpt, conversionOperand, conversion, targetType, operandType.Type, slot, valueSlot, assignmentKind, parameterOpt, reportWarnings: reportRemainingWarnings); 9222conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9240conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9250conversion = GenerateConversion(_conversions, conversionOperand, operandType.Type, targetType, fromExplicitCast, extensionMethodThisArgument, isChecked: conversionOpt?.Checked ?? false); 9274ReportNullabilityMismatchInArgument(getDiagnosticLocation(), operandType.Type, parameterOpt, targetType, forOutput: false); 9278ReportNullabilityMismatchInAssignment(getDiagnosticLocation(), GetTypeAsDiagnosticArgument(operandType.Type), targetType); 9319var type = operandType.Type; 9350var type = operandType.Type; 9543Debug.Assert(operandType.Type is object); 9551if (operandType.Type.IsNullableType() && !parameterType.IsNullableType()) 9553var underlyingOperandTypeWithAnnotations = operandType.Type.GetNullableUnderlyingTypeWithAnnotations(); 9691var type = typeWithState.Type; 9723Debug.Assert(operandType.Type is object); 9726var conversion = _conversions.ClassifyStandardConversion(operandType.Type, targetType.Type, ref discardedUseSiteInfo); 9731ReportNullabilityMismatchInArgument(diagnosticLocation, operandType.Type, parameterOpt, targetType.Type, forOutput: false); 9735ReportNullabilityMismatchInAssignment(diagnosticLocation, operandType.Type, targetType.Type); 9979method = (MethodSymbol)AsMemberOfType(receiverType.Type, method); 10342Debug.Assert(rightResult.Type is object); 10353deconstructMethod = (MethodSymbol)AsMemberOfType(rightResult.Type, deconstructMethod); 10495AreNullableAndUnderlyingTypes(lvalueType.Type, operandType.Type, out TypeWithAnnotations underlyingType)) 10784if (argumentType.Type is { } argType && IsNullabilityMismatch(paramType.Type, argType)) 10869var receiverType = VisitRvalueWithState(receiverOpt).Type; 10945member = AsMemberOfType(receiverType.Type, member); 10959if (PossiblyNullableType(resultType.Type)) 10965resultType = TypeWithState.Create(resultType.Type, state); 11070var resultType = resultTypeWithState.Type; 11182getEnumeratorType = spanType.Construct(ImmutableArray.Create(convertedResult.Type!.TryGetInlineArrayElementField()!.TypeWithAnnotations)); 11186getEnumeratorType = convertedResult.Type; 11202var currentPropertyGetter = (MethodSymbol)AsMemberOfType(enumeratorReturnType.Type, enumeratorInfoOpt.CurrentPropertyGetter); 11442method = (MethodSymbol)AsMemberOfType(operandType.Type!.StrippedType(), method); 11623var reinferredGetResult = _visitResult.RValueType.Type is NamedTypeSymbol taskAwaiterType 11868@event = (EventSymbol)AsMemberOfType(ResultType.Type, @event); 11977var resultTypeSymbol = resultType.Type; 12283Debug.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);