1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74State = state;
59 references to State
Microsoft.CodeAnalysis.CSharp (59)
FlowAnalysis\NullableWalker.cs (53)
402_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.State.ToPublicFlowState()), 1978return localType.ToTypeWithState().State; 1987return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2374if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2418valueType.State == NullableFlowState.MaybeDefault; 2509valueState.State)) 2600var newState = valueType.State; 2700NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2800=> ApplyUnconditionalAnnotations(symbol.GetTypeOrReturnType().ToTypeWithState(), GetRValueAnnotations(symbol)).State; 2890var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3004EnforceNotNullIfNotNull(node.Syntax, this.State, method.Parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 3862return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4452TypeWithState.Create(containingType, receiverResult.RValueType.State), 4905return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 4923resultState = leftType.State.Meet(rightType.State); 4936resultState = leftType.State.Join(rightType.State); 5028return resultType.State.IsNotNull() 5637TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5656SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5690SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5731return (conversionResult.Type!, conversionResult.State); 5961var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6090resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6103resultState = consequenceRValue.State.Join(alternativeRValue.State); 6588var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 6595var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7020TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 8677SetState(ref this.State, targetFieldSlot, convertedType.State); 9023calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 9044resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 9070resultState = operandType.State; 9209var state = operandType.State; 9243var state = operandType.State; 9271var state = operandType.State; 9281var state = operandType.State; 9455NullableFlowState operandState = operandType.State; 9579NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 10039SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10646SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 11074if (enumeratorReturnType.State != NullableFlowState.NotNull) 11207state = result.State; 11336resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 11351TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11610resultState = argumentType.State; 11760node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 11865if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 12163Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
Symbols\NullableAnnotationExtensions.cs (1)
104var flowState = TypeWithAnnotations.Create(type, annotation).ToTypeWithState().State;
Symbols\TypeWithState.cs (5)
20public bool MayBeNull => State == NullableFlowState.MaybeNull; 21public bool IsNotNull => State == NullableFlowState.NotNull; 77public string GetDebuggerDisplay() => $"{{Type:{Type?.GetDebuggerDisplay()}, State:{State}{"}"}"; 90return (State == NullableFlowState.MaybeDefault || asAnnotatedType) ? type.SetIsAnnotated(compilation) : type; 94(State.IsNotNull() || Type?.CanContainNull() == false ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated);