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 (58)
433
_analyzedNullabilityMapOpt[expr] = (new NullabilityInfo(result.LValueType.ToPublicAnnotation(), result.RValueType.
State
.ToPublicFlowState()),
2094
return localType.ToTypeWithState().
State
;
2102
return GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
2516
if (value == null || !ShouldReportNullableAssignment(targetType, valueType.
State
))
2560
valueType.
State
== NullableFlowState.MaybeDefault;
2651
valueState.
State
))
2742
var newState = valueType.
State
;
2853
NullableFlowState value = isDefaultValue ? NullableFlowState.MaybeNull : fieldOrPropertyType.ToTypeWithState().
State
;
3008
return ApplyUnconditionalAnnotations(GetTypeOrReturnTypeWithAnnotations(symbol).ToTypeWithState(), GetRValueAnnotations(symbol)).
State
;
3099
var state = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations).
State
;
3214
EnforceNotNullIfNotNull(node.Syntax, this.State, parameters, method.ReturnNotNullIfParameterNotNull, ResultType.
State
, outputParam: null);
4279
return ApplyUnconditionalAnnotations(createMethod.ReturnTypeWithAnnotations, annotations).ToTypeWithState().
State
;
4557
operandState = argumentTypeWithState.
State
;
4974
TypeWithState.Create(containingType, receiverResult.RValueType.
State
),
5429
return GetLiftedReturnType(methodOpt.ReturnTypeWithAnnotations, leftType.
State
.Join(rightType.
State
));
5447
resultState = leftType.
State
.Meet(rightType.
State
);
5460
resultState = leftType.
State
.Join(rightType.
State
);
5552
return resultType.
State
.IsNotNull()
6234
TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.
State
);
6253
SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.
State
));
6287
SetResultType(node, TypeWithState.Create(resultType, rightResult.
State
.Join(leftState)));
6330
return (conversionResult.Type!, conversionResult.
State
);
6561
var rValueState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
6690
resultState = convertedConsequenceResult.
State
.Join(convertedAlternativeResult.
State
);
6703
resultState = consequenceRValue.
State
.Join(alternativeRValue.
State
);
7397
var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.
State
;
7404
var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.
State
;
7861
TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.
State
), argument as BoundConversion, argumentNoConversion);
9668
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
9700
SetState(ref this.State, conversionOperandSlot, valueFieldType.
State
);
9720
SetState(ref this.State, targetFieldSlot, convertedType.
State
);
10105
calculateResultType(targetTypeWithNullability, fromExplicitCast, operandType.
State
, isSuppressed, targetType),
10130
resultState = conversion.IsReference ? getReferenceConversionResultState(targetTypeWithNullability, operandType) : operandType.
State
;
10156
resultState = operandType.
State
;
10317
var state = operandType.
State
;
10351
var state = operandType.
State
;
10379
var state = operandType.
State
;
10389
var state = operandType.
State
;
10570
NullableFlowState operandState = operandType.
State
;
10777
unionTypeWithState = GetConversionReturnTypeWithState(factory, isLiftedConversion: false, operandType.
State
);
10870
NullableFlowState state = returnType.ToTypeWithState().
State
.Join(operandState);
11356
SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.
State
), leftLValueType);
11956
resultOfIncrementType = GetLiftedReturnTypeIfNecessary(isLifted, incrementOperator.ReturnTypeWithAnnotations, operandType.
State
);
12137
SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.
State
));
12671
if (enumeratorReturnType.
State
!= NullableFlowState.NotNull)
12794
state = result.
State
;
12931
resultType = GetLiftedReturnTypeIfNecessary(isLifted, method.ReturnTypeWithAnnotations, operandResult.
State
);
12946
TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.
State
: NullableFlowState.NotNull);
13306
resultState = argumentType.
State
;
13456
node.IsAddition ? GetState(ref this.State, memberSlot).Meet(ResultType.
State
) : NullableFlowState.MaybeNull);
13561
if (!ReportPossibleNullReceiverIfNeeded(resultTypeSymbol, resultType.
State
, checkNullableValueType, receiverOpt.Syntax, out reportedDiagnostic))
13912
Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { },
State
: NullableFlowState.NotNull });
Symbols\NamedTypeSymbol.cs (1)
2693
result = result.Join(NullableWalker.GetParameterState(parameter.TypeWithAnnotations, parameter.FlowAnalysisAnnotations).
State
);
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);