1 write to State
Microsoft.CodeAnalysis.CSharp (1)
Symbols\TypeWithState.cs (1)
74
State
= state;
66 references to State
Microsoft.CodeAnalysis.CSharp (66)
Binder\Semantics\BestTypeInferrer.cs (1)
41
result = result.Join(type.
State
);
FlowAnalysis\NullableWalker.cs (59)
433
_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.
State
.ToPublicFlowState()),
2057
return localType.ToTypeWithState().
State
;
2065
return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2079
result = result.Join(GetParameterState(parameter.TypeWithAnnotations, parameter.FlowAnalysisAnnotations).
State
);
2472
if (value == null || !ShouldReportNullableAssignment(targetType, valueType.
State
))
2516
valueType.
State
== NullableFlowState.MaybeDefault;
2607
valueState.
State
))
2698
var newState = valueType.
State
;
2802
NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().
State
;
2957
return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).
State
;
3048
var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
3163
EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.
State
, outputParam: null);
4228
return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().
State
;
4506
operandState = argumentTypeWithState.
State
;
4934
TypeWithState.Create(containingType, receiverResult.RValueType.
State
),
5389
return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.
State
.Join(rightType.
State
));
5407
resultState = leftType.
State
.Meet(rightType.
State
);
5420
resultState = leftType.
State
.Join(rightType.
State
);
5512
return resultType.
State
.IsNotNull()
6178
TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.
State
);
6197
SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.
State
));
6231
SetResultType(node, TypeWithState.Create(resultType, rightResult.
State
.Join(leftState)));
6274
return (conversionResult.Type!, conversionResult.
State
);
6505
var rValueState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
6634
resultState = convertedConsequenceResult.
State
.Join(convertedAlternativeResult.
State
);
6647
resultState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
7320
var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.
State
;
7327
var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.
State
;
7776
TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.
State
), argument as BoundConversion, argumentNoConversion);
9583
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
9615
SetState(ref this.State, conversionOperandSlot, valueFieldType.
State
);
9635
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
10020
calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.
State
, isSuppressed, targetType),
10045
resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.
State
;
10071
resultState = operandType.
State
;
10232
var state = operandType.
State
;
10266
var state = operandType.
State
;
10294
var state = operandType.
State
;
10304
var state = operandType.
State
;
10485
NullableFlowState operandState = operandType.
State
;
10686
unionTypeWithState = GetConversionReturnTypeWithState(factory, isLiftedConversion: false, operandType.
State
);
10779
NullableFlowState state = returnType.ToTypeWithState().
State
.Join(operandState);
11265
SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.
State
), leftLValueType);
11859
resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.
State
);
12040
SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.
State
));
12525
if (enumeratorReturnType.
State
!= NullableFlowState.NotNull)
12648
state = result.
State
;
12785
resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.
State
);
12800
TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.
State
: NullableFlowState.NotNull);
13160
resultState = argumentType.
State
;
13310
node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.
State
) : NullableFlowState.MaybeNull);
13415
if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.
State
, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic))
13766
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);