1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74
State
= state;
59 references to State
Microsoft.CodeAnalysis.CSharp (59)
FlowAnalysis\NullableWalker.cs (53)
402
_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.
State
.ToPublicFlowState()),
1917
return localType.ToTypeWithState().
State
;
1926
return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2313
if (value == null || !ShouldReportNullableAssignment(targetType, valueType.
State
))
2357
valueType.
State
== NullableFlowState.MaybeDefault;
2448
valueState.
State
))
2539
var newState = valueType.
State
;
2639
NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().
State
;
2739
=> ApplyUnconditionalAnnotations(symbol.GetTypeOrReturnType().ToTypeWithState(), GetRValueAnnotations(symbol)).
State
;
2829
var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2943
EnforceNotNullIfNotNull(node.Syntax, this.State, method.Parameters, method.ReturnNotNullIfParameterNotNull, ResultType.
State
, outputParam: null);
3801
return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().
State
;
4391
TypeWithState.Create(containingType, receiverResult.RValueType.
State
),
4844
return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.
State
.Join(rightType.
State
));
4862
resultState = leftType.
State
.Meet(rightType.
State
);
4875
resultState = leftType.
State
.Join(rightType.
State
);
4967
return resultType.
State
.IsNotNull()
5576
TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.
State
);
5595
SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.
State
));
5629
SetResultType(node, TypeWithState.Create(resultType, rightResult.
State
.Join(leftState)));
5670
return (conversionResult.Type!, conversionResult.
State
);
5900
var rValueState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
6029
resultState = convertedConsequenceResult.
State
.Join(convertedAlternativeResult.
State
);
6042
resultState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
6527
var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.
State
;
6534
var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.
State
;
6959
TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.
State
), argument as BoundConversion, argumentNoConversion);
8616
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
8962
calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.
State
, isSuppressed, targetType),
8983
resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.
State
;
9009
resultState = operandType.
State
;
9148
var state = operandType.
State
;
9182
var state = operandType.
State
;
9210
var state = operandType.
State
;
9220
var state = operandType.
State
;
9394
NullableFlowState operandState = operandType.
State
;
9518
NullableFlowState state = returnType.ToTypeWithState().
State
.Join(operandState);
9978
SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.
State
), leftLValueType);
10585
SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.
State
));
11013
if (enumeratorReturnType.
State
!= NullableFlowState.NotNull)
11146
state = result.
State
;
11275
resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.
State
);
11290
TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.
State
: NullableFlowState.NotNull);
11549
resultState = argumentType.
State
;
11699
node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.
State
) : NullableFlowState.MaybeNull);
11804
if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.
State
, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic))
12102
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);