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)
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); 4008return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().State; 4606TypeWithState.Create(containingType, receiverResult.RValueType.State), 5061return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.State.Join(rightType.State)); 5079resultState = leftType.State.Meet(rightType.State); 5092resultState = leftType.State.Join(rightType.State); 5184return resultType.State.IsNotNull() 5850TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5869SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5903SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5944return (conversionResult.Type!, conversionResult.State); 6175var rValueState = consequenceRValue.State.Join(alternativeRValue.State); 6304resultState = convertedConsequenceResult.State.Join(convertedAlternativeResult.State); 6317resultState = consequenceRValue.State.Join(alternativeRValue.State); 6942var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 6949var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 7403TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 9111SetState(ref this.State, targetFieldSlot, convertedType.State); 9457calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.State, isSuppressed, targetType), 9478resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.State; 9504resultState = operandType.State; 9643var state = operandType.State; 9677var state = operandType.State; 9705var state = operandType.State; 9715var state = operandType.State; 9889NullableFlowState operandState = operandType.State; 10013NullableFlowState state = returnType.ToTypeWithState().State.Join(operandState); 10499SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 11079resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.State); 11257SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 11705if (enumeratorReturnType.State != NullableFlowState.NotNull) 11838state = result.State; 11968resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.State); 11983TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 12345resultState = argumentType.State; 12495node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.State) : NullableFlowState.MaybeNull); 12600if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.State, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic)) 12898Debug.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);