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()), 2094return localType.ToTypeWithState().State; 2102return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 2509if (value == null || !ShouldReportNullableAssignment(targetType, valueType.State)) 2553valueType.State == NullableFlowState.MaybeDefault; 2644valueState.State)) 2735var newState = valueType.State; 2846NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().State; 3001return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(containingSlot, receiverTypeForMemberAccessOpt: null, symbol)).State; 3092var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).State; 3207EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.State, outputParam: null); 4272return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4562operandState = argumentTypeWithState.State; 4984TypeWithState.Create(containingType, receiverResult.RValueType.State), 5439return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5457resultState = leftType.State.Meet(rightType.State); 5470resultState = leftType.State.Join(rightType.State); 5562return resultType.State.IsNotNull() 6244TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 6263SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 6297SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 6340return (conversionResult.Type!, conversionResult.State); 6571var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6700resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6713resultState = consequenceRValue.State.Join(alternativeRValue.State); 7407var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 7414var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7878TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9685SetState(ref this.State, targetFieldSlot, convertedType.State); 9717SetState(ref this.State, conversionOperandSlot, valueFieldType.State); 9737SetState(ref this.State, targetFieldSlot, convertedType.State); 10122calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 10147resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 10173resultState = operandType.State; 10334var state = operandType.State; 10368var state = operandType.State; 10396var state = operandType.State; 10406var state = operandType.State; 10587NullableFlowState operandState = operandType.State; 10794unionTypeWithState = GetConversionReturnTypeWithState(factory, isLiftedConversion: false, operandType.State); 10887NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 11373SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11973resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 12154SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 12688if (enumeratorReturnType.State != NullableFlowState.NotNull) 12811state = result.State; 12948resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 12963TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 13323resultState = argumentType.State; 13473node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 13578if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 13937Debug.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);