1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74State = state;
61 references to State
Microsoft.CodeAnalysis.CSharp (61)
Binder\Semantics\BestTypeInferrer.cs (1)
41result = result.Join(type.State);
FlowAnalysis\NullableWalker.cs (54)
414_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.State.ToPublicFlowState()), 2021return localType.ToTypeWithState().State; 2030return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2417if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2461valueType.State == NullableFlowState.MaybeDefault; 2552valueState.State)) 2643var newState = valueType.State; 2746NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2901return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).State; 2992var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3107EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 4014return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4613TypeWithState.Create(containingType, receiverResult.RValueType.State), 5068return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5086resultState = leftType.State.Meet(rightType.State); 5099resultState = leftType.State.Join(rightType.State); 5191return resultType.State.IsNotNull() 5857TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5876SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5910SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5951return (conversionResult.Type!, conversionResult.State); 6182var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6311resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6324resultState = consequenceRValue.State.Join(alternativeRValue.State); 6950var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 6957var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7406TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9115SetState(ref this.State, targetFieldSlot, convertedType.State); 9461calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 9482resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 9508resultState = operandType.State; 9647var state = operandType.State; 9681var state = operandType.State; 9709var state = operandType.State; 9719var state = operandType.State; 9901NullableFlowState operandState = operandType.State; 10025NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 10511SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11091resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 11269SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 11729if (enumeratorReturnType.State != NullableFlowState.NotNull) 11862state = result.State; 11992resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 12007TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 12369resultState = argumentType.State; 12519node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 12624if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 12922Debug.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);