1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74
State
= state;
61 references to State
Microsoft.CodeAnalysis.CSharp (61)
Binder\Semantics\BestTypeInferrer.cs (1)
41
result = result.Join(type.
State
);
FlowAnalysis\NullableWalker.cs (54)
433
_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.
State
.ToPublicFlowState()),
2039
return localType.ToTypeWithState().
State
;
2048
return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2435
if (value == null || !ShouldReportNullableAssignment(targetType, valueType.
State
))
2479
valueType.
State
== NullableFlowState.MaybeDefault;
2570
valueState.
State
))
2661
var newState = valueType.
State
;
2764
NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().
State
;
2919
return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).
State
;
3010
var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
3125
EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.
State
, outputParam: null);
4029
return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().
State
;
4664
TypeWithState.Create(containingType, receiverResult.RValueType.
State
),
5119
return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.
State
.Join(rightType.
State
));
5137
resultState = leftType.
State
.Meet(rightType.
State
);
5150
resultState = leftType.
State
.Join(rightType.
State
);
5242
return resultType.
State
.IsNotNull()
5908
TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.
State
);
5927
SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.
State
));
5961
SetResultType(node, TypeWithState.Create(resultType, rightResult.
State
.Join(leftState)));
6002
return (conversionResult.Type!, conversionResult.
State
);
6233
var rValueState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
6362
resultState = convertedConsequenceResult.
State
.Join(convertedAlternativeResult.
State
);
6375
resultState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
7042
var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.
State
;
7049
var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.
State
;
7498
TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.
State
), argument as BoundConversion, argumentNoConversion);
9253
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
9599
calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.
State
, isSuppressed, targetType),
9620
resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.
State
;
9646
resultState = operandType.
State
;
9785
var state = operandType.
State
;
9819
var state = operandType.
State
;
9847
var state = operandType.
State
;
9857
var state = operandType.
State
;
10039
NullableFlowState operandState = operandType.
State
;
10163
NullableFlowState state = returnType.ToTypeWithState().
State
.Join(operandState);
10649
SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.
State
), leftLValueType);
11226
resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.
State
);
11403
SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.
State
));
11860
if (enumeratorReturnType.
State
!= NullableFlowState.NotNull)
11993
state = result.
State
;
12130
resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.
State
);
12145
TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.
State
: NullableFlowState.NotNull);
12507
resultState = argumentType.
State
;
12657
node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.
State
) : NullableFlowState.MaybeNull);
12762
if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.
State
, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic))
13062
Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { },
State
: NullableFlowState.NotNull });
Symbols\NullableAnnotationExtensions.cs (1)
104
var flowState = TypeWithAnnotations.Create(type, annotation).ToTypeWithState().
State
;
Symbols\TypeWithState.cs (5)
20
public bool MayBeNull =>
State
== NullableFlowState.MaybeNull;
21
public bool IsNotNull =>
State
== NullableFlowState.NotNull;
77
public string GetDebuggerDisplay() => $"{{Type:{Type?.GetDebuggerDisplay()}, State:{
State
}{"}"}";
90
return (
State
== NullableFlowState.MaybeDefault || asAnnotatedType) ? type.SetIsAnnotated(compilation) : type;
94
(
State
.IsNotNull() || Type?.CanContainNull() == false ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated);