1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74
State
= state;
60 references to State
Microsoft.CodeAnalysis.CSharp (60)
Binder\Semantics\BestTypeInferrer.cs (1)
41
result = result.Join(type.
State
);
FlowAnalysis\NullableWalker.cs (53)
369
_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.
State
.ToPublicFlowState()),
1869
return localType.ToTypeWithState().
State
;
1878
return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2246
!ShouldReportNullableAssignment(targetType, valueType.
State
))
2290
valueType.
State
== NullableFlowState.MaybeDefault;
2381
valueState.
State
))
2472
var newState = valueType.
State
;
2572
NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().
State
;
2658
=> ApplyUnconditionalAnnotations(symbol.GetTypeOrReturnType().ToTypeWithState(), GetRValueAnnotations(symbol)).
State
;
2751
var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2865
EnforceNotNullIfNotNull(node.Syntax, this.State, method.Parameters, method.ReturnNotNullIfParameterNotNull, ResultType.
State
, outputParam: null);
3992
TypeWithState.Create(containingType, receiverResult.RValueType.
State
), receiverResult.LValueType.WithType(containingType)),
4417
return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.
State
.Join(rightType.
State
));
4435
resultState = leftType.
State
.Meet(rightType.
State
);
4448
resultState = leftType.
State
.Join(rightType.
State
);
4540
return resultType.
State
.IsNotNull()
5115
TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.
State
);
5134
SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.
State
));
5168
SetResultType(node, TypeWithState.Create(resultType, rightResult.
State
.Join(leftState)));
5209
return (conversionResult.Type!, conversionResult.
State
);
5445
var rValueState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
5543
resultState = convertedConsequenceResult.
State
.Join(convertedAlternativeResult.
State
);
5556
resultState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
5937
var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.
State
;
5944
var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.
State
;
6324
TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.
State
), argument as BoundConversion, argumentNoConversion);
7762
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
8095
calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.
State
, isSuppressed, targetType),
8116
resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.
State
;
8142
resultState = operandType.
State
;
8255
var state = operandType.
State
;
8289
var state = operandType.
State
;
8317
var state = operandType.
State
;
8327
var state = operandType.
State
;
8500
NullableFlowState operandState = operandType.
State
;
8610
new VisitResult(TypeWithState.Create(newType, visitResult.RValueType.
State
),
8621
NullableFlowState state = returnType.ToTypeWithState().
State
.Join(operandState);
9096
SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.
State
), leftLValueType);
9716
SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.
State
));
10097
if (enumeratorReturnType.
State
!= NullableFlowState.NotNull)
10228
state = result.
State
;
10357
resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.
State
);
10372
TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.
State
: NullableFlowState.NotNull);
10633
resultState = argumentType.
State
;
10783
node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.
State
) : NullableFlowState.MaybeNull);
10888
if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.
State
, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic))
11186
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);