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)
433_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.State.ToPublicFlowState()), 2039return localType.ToTypeWithState().State; 2048return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2435if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2479valueType.State == NullableFlowState.MaybeDefault; 2570valueState.State)) 2661var newState = valueType.State; 2764NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2919return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).State; 3010var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3125EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 4029return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4689TypeWithState.Create(containingType, receiverResult.RValueType.State), 5144return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5162resultState = leftType.State.Meet(rightType.State); 5175resultState = leftType.State.Join(rightType.State); 5267return resultType.State.IsNotNull() 5933TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5952SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5986SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 6027return (conversionResult.Type!, conversionResult.State); 6258var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6387resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6400resultState = consequenceRValue.State.Join(alternativeRValue.State); 7073var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 7080var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7522TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9277SetState(ref this.State, targetFieldSlot, convertedType.State); 9623calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 9644resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 9670resultState = operandType.State; 9809var state = operandType.State; 9843var state = operandType.State; 9871var state = operandType.State; 9881var state = operandType.State; 10062NullableFlowState operandState = operandType.State; 10186NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 10672SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11253resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 11434SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 11894if (enumeratorReturnType.State != NullableFlowState.NotNull) 12027state = result.State; 12164resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 12179TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 12541resultState = argumentType.State; 12691node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 12796if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 13096Debug.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);