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)
408_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.State.ToPublicFlowState()), 2015return localType.ToTypeWithState().State; 2024return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2411if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2455valueType.State == NullableFlowState.MaybeDefault; 2546valueState.State)) 2637var newState = valueType.State; 2740NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2895return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).State; 2986var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3101EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 3959return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4552TypeWithState.Create(containingType, receiverResult.RValueType.State), 5007return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5025resultState = leftType.State.Meet(rightType.State); 5038resultState = leftType.State.Join(rightType.State); 5130return resultType.State.IsNotNull() 5734TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5753SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5787SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5828return (conversionResult.Type!, conversionResult.State); 6059var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6188resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6201resultState = consequenceRValue.State.Join(alternativeRValue.State); 6793var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 6800var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7235TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 8912SetState(ref this.State, targetFieldSlot, convertedType.State); 9258calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 9279resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 9305resultState = operandType.State; 9444var state = operandType.State; 9478var state = operandType.State; 9506var state = operandType.State; 9516var state = operandType.State; 9690NullableFlowState operandState = operandType.State; 9814NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 10300SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10942SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 11372if (enumeratorReturnType.State != NullableFlowState.NotNull) 11505state = result.State; 11634resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 11649TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11908resultState = argumentType.State; 12058node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 12163if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 12461Debug.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);