1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74State = state;
66 references to State
Microsoft.CodeAnalysis.CSharp (66)
Binder\Semantics\BestTypeInferrer.cs (1)
41result = result.Join(type.State);
FlowAnalysis\NullableWalker.cs (59)
433_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.State.ToPublicFlowState()), 2057return localType.ToTypeWithState().State; 2065return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2080result = result.Join(GetParameterState(parameter.TypeWithAnnotations, parameter.FlowAnalysisAnnotations).State); 2474if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2518valueType.State == NullableFlowState.MaybeDefault; 2609valueState.State)) 2700var newState = valueType.State; 2811NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2966return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).State; 3057var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3172EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 4237return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4515operandState = argumentTypeWithState.State; 4932TypeWithState.Create(containingType, receiverResult.RValueType.State), 5387return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5405resultState = leftType.State.Meet(rightType.State); 5418resultState = leftType.State.Join(rightType.State); 5510return resultType.State.IsNotNull() 6176TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 6195SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 6229SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 6272return (conversionResult.Type!, conversionResult.State); 6503var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6632resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6645resultState = consequenceRValue.State.Join(alternativeRValue.State); 7339var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 7346var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7803TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9610SetState(ref this.State, targetFieldSlot, convertedType.State); 9642SetState(ref this.State, conversionOperandSlot, valueFieldType.State); 9662SetState(ref this.State, targetFieldSlot, convertedType.State); 10047calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 10072resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 10098resultState = operandType.State; 10259var state = operandType.State; 10293var state = operandType.State; 10321var state = operandType.State; 10331var state = operandType.State; 10512NullableFlowState operandState = operandType.State; 10715unionTypeWithState = GetConversionReturnTypeWithState(factory, isLiftedConversion: false, operandType.State); 10808NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 11294SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11887resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 12068SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 12593if (enumeratorReturnType.State != NullableFlowState.NotNull) 12716state = result.State; 12853resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 12868TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 13228resultState = argumentType.State; 13378node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 13483if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 13834Debug.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);