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; 2079result = result.Join(GetParameterState(parameter.TypeWithAnnotations, parameter.FlowAnalysisAnnotations).State); 2472if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2516valueType.State == NullableFlowState.MaybeDefault; 2607valueState.State)) 2698var newState = valueType.State; 2802NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2957return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).State; 3048var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3163EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 4228return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4506operandState = argumentTypeWithState.State; 4934TypeWithState.Create(containingType, receiverResult.RValueType.State), 5389return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5407resultState = leftType.State.Meet(rightType.State); 5420resultState = leftType.State.Join(rightType.State); 5512return resultType.State.IsNotNull() 6178TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 6197SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 6231SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 6274return (conversionResult.Type!, conversionResult.State); 6505var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6634resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6647resultState = consequenceRValue.State.Join(alternativeRValue.State); 7320var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 7327var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7776TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9583SetState(ref this.State, targetFieldSlot, convertedType.State); 9615SetState(ref this.State, conversionOperandSlot, valueFieldType.State); 9635SetState(ref this.State, targetFieldSlot, convertedType.State); 10020calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 10045resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 10071resultState = operandType.State; 10232var state = operandType.State; 10266var state = operandType.State; 10294var state = operandType.State; 10304var state = operandType.State; 10485NullableFlowState operandState = operandType.State; 10686unionTypeWithState = GetConversionReturnTypeWithState(factory, isLiftedConversion: false, operandType.State); 10779NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 11265SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11859resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 12040SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 12525if (enumeratorReturnType.State != NullableFlowState.NotNull) 12648state = result.State; 12785resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 12800TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 13160resultState = argumentType.State; 13310node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 13415if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 13766Debug.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);