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 (58)
433_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.State.ToPublicFlowState()), 2057return localType.ToTypeWithState().State; 2065return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2460if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2504valueType.State == NullableFlowState.MaybeDefault; 2595valueState.State)) 2686var newState = valueType.State; 2797NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 2952return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).State; 3043var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3158EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 4223return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4501operandState = argumentTypeWithState.State; 4918TypeWithState.Create(containingType, receiverResult.RValueType.State), 5373return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5391resultState = leftType.State.Meet(rightType.State); 5404resultState = leftType.State.Join(rightType.State); 5496return resultType.State.IsNotNull() 6162TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 6181SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 6215SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 6258return (conversionResult.Type!, conversionResult.State); 6489var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6618resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6631resultState = consequenceRValue.State.Join(alternativeRValue.State); 7325var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 7332var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7789TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9596SetState(ref this.State, targetFieldSlot, convertedType.State); 9628SetState(ref this.State, conversionOperandSlot, valueFieldType.State); 9648SetState(ref this.State, targetFieldSlot, convertedType.State); 10033calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 10058resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 10084resultState = operandType.State; 10245var state = operandType.State; 10279var state = operandType.State; 10307var state = operandType.State; 10317var state = operandType.State; 10498NullableFlowState operandState = operandType.State; 10705unionTypeWithState = GetConversionReturnTypeWithState(factory, isLiftedConversion: false, operandType.State); 10798NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 11284SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11877resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 12058SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 12592if (enumeratorReturnType.State != NullableFlowState.NotNull) 12715state = result.State; 12852resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 12867TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 13227resultState = argumentType.State; 13377node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 13482if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 13833Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
Symbols\NamedTypeSymbol.cs (1)
2693result = result.Join(NullableWalker.GetParameterState(parameter.TypeWithAnnotations, parameter.FlowAnalysisAnnotations).State);
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);