4 instantiations of TypeWithState
Microsoft.CodeAnalysis.CSharp (4)
Symbols\TypeWithState.cs (4)
34
return new
TypeWithState
(type, defaultState);
37
return new
TypeWithState
(type, state);
81
public TypeWithState WithNotNullState() => new
TypeWithState
(Type, NullableFlowState.NotNull);
83
public TypeWithState WithSuppression(bool suppress) => suppress ? new
TypeWithState
(Type, NullableFlowState.NotNull) : this;
303 references to TypeWithState
Microsoft.CodeAnalysis.CSharp (302)
Binder\Binder_Patterns.cs (1)
1348
var declType =
TypeWithState
.ForType(inputType).ToTypeWithAnnotations(Compilation);
Binder\Semantics\BestTypeInferrer.cs (2)
36
public static NullableFlowState GetNullableState(ArrayBuilder<
TypeWithState
> types)
39
foreach (
var
type in types)
FlowAnalysis\NullableWalker.cs (276)
99
public readonly
TypeWithState
RValueType;
102
public VisitResult(
TypeWithState
rValueType, TypeWithAnnotations lValueType)
113
RValueType =
TypeWithState
.Create(type, state);
132
public
TypeWithState
RValueType => VisitResult.RValueType;
187
private static readonly
TypeWithState
_invalidType =
TypeWithState
.Create(ErrorTypeSymbol.UnknownResultType, NullableFlowState.NotNull);
208
private PooledDictionary<BoundExpression,
TypeWithState
>? _methodGroupReceiverMapOpt;
219
private PooledDictionary<BoundExpression, Func<TypeWithAnnotations,
TypeWithState
>>? _targetTypedAnalysisCompletionOpt;
224
/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations,
TypeWithState
, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, Optional<LocalState>,bool, Location, ArrayBuilder<VisitResult>)"/>.
226
private PooledDictionary<BoundExpression, Func<TypeWithAnnotations,
TypeWithState
>> TargetTypedAnalysisCompletion
227
=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations,
TypeWithState
>>.GetInstance();
268
private
TypeWithState
ResultType
273
private void SetResultType(BoundExpression? expression,
TypeWithState
type, bool updateAnalyzedNullability = true)
278
private void SetAnalyzedNullability(BoundExpression? expression,
TypeWithState
type)
311
private void SetResult(BoundExpression? expression,
TypeWithState
resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null)
320
private void SetAnalyzedNullability(BoundExpression? expression,
TypeWithState
resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null)
2143
private
TypeWithState
VisitRvalueWithState(BoundExpression? node)
2187
/// This should often be checked together with <seealso cref="IsDisallowedNullAssignment(
TypeWithState
, FlowAnalysisAnnotations)"/>
2227
TypeWithState
valueType,
2287
static bool isMaybeDefaultValue(
TypeWithState
valueType)
2324
var
valueState = GetParameterState(
2363
var
valueWhen = ApplyUnconditionalAnnotations(
2377
static bool isBadAssignment(
TypeWithState
valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations)
2455
TypeWithState
valueType,
2496
static bool areEquivalentTypes(TypeWithAnnotations target,
TypeWithState
assignedValue) =>
2771
var
resultType = VisitOptionalImplicitConversion(
2785
internal static
TypeWithState
GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations)
2789
return
TypeWithState
.Create(parameterType.Type, NullableFlowState.MaybeDefault);
2794
return
TypeWithState
.Create(parameterType.Type, NullableFlowState.NotNull);
2825
TypeWithState
returnState;
2842
var
result = VisitRvalueWithState(expr);
2873
private
TypeWithState
VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType)
2876
TypeWithState
resultType = ResultType;
2945
SetResultType(node,
TypeWithState
.ForType(node.Type));
3193
var
resultState = ApplyUnconditionalAnnotations(resultType.ToTypeWithState(), GetRValueAnnotations(withExpr.CloneMethod));
3294
TypeWithState
valueType;
3332
TypeWithState
resultType = ResultType;
3342
var
result = resultType.WithNotNullState();
3448
SetResultType(node,
TypeWithState
.Create(null, NullableFlowState.NotNull));
3476
TypeWithState
result = setAnalyzedNullability(node, type, argumentResults, argumentsCompletion, initialStateInferenceCompletion, initializerCompletion, resultState, isTargetTyped);
3480
TypeWithState
setAnalyzedNullability(
3490
var
result =
TypeWithState
.Create(type, resultState);
3850
Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations,
TypeWithState
>? conversionCompletion = null)
3863
(
TypeWithState
resultType, conversionCompletion) =
3883
Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations,
TypeWithState
> conversionCompletion)
3992
TypeWithState
.Create(containingType, receiverResult.RValueType.State), receiverResult.LValueType.WithType(containingType)),
4010
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.NotNull));
4097
var
argumentType = argumentTypes[i];
4116
SetResultType(node,
TypeWithState
.Create(anonymousType, NullableFlowState.NotNull));
4148
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.NotNull));
4153
SetResultType(node,
TypeWithState
.Create(arrayType, NullableFlowState.NotNull));
4187
var expressionTypes = ArrayBuilder<
TypeWithState
>.GetInstance(n);
4196
var
expressionType = VisitRvalueWithState(expressionNoConversion);
4231
inferredType =
TypeWithState
.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation);
4408
private
TypeWithState
InferResultNullability(BinaryOperatorKind operatorKind, MethodSymbol? methodOpt, TypeSymbol resultType,
TypeWithState
leftType,
TypeWithState
rightType)
4420
var
resultTypeWithState = GetReturnTypeWithState(methodOpt);
4451
return
TypeWithState
.Create(resultType, resultState);
4468
var
leftType = ResultType;
4495
var
rightType = VisitRvalueWithState(rightOperand);
4538
static bool isKnownNullOrNotNull(BoundExpression expr,
TypeWithState
resultType)
4573
var
leftResult = ResultType;
4626
SetResult(binary,
TypeWithState
.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type));
4634
TypeWithState
leftType,
4637
TypeWithState
rightType,
4652
TypeWithState
leftUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, leftType);
4653
TypeWithState
rightUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, rightType);
4669
TypeWithState
operandType)
4679
var
resultType = VisitConversion(
4705
TypeWithState
operandType)
4738
var
inferredResult = InferResultNullability(binary.OperatorKind, method, binary.Type, leftType, rightType);
4766
var
leftType = ResultType;
4771
var
rightType = ResultType;
5112
TypeWithState
rightResult = VisitOptionalImplicitConversion(rightOperand, targetType, useLegacyWarnings: UseLegacyWarnings(leftOperand), trackMembers: false, AssignmentKind.Assignment);
5115
TypeWithState
resultType =
TypeWithState
.Create(targetType.Type, rightResult.State);
5131
var
rightUnconditionalResult = ResultType;
5134
SetResultType(node,
TypeWithState
.Create(node.Type, rightUnconditionalResult.State));
5139
TypeWithState
leftResult = ResultType;
5150
TypeWithState
rightResult = ResultType;
5168
SetResultType(node,
TypeWithState
.Create(resultType, rightResult.State.Join(leftState)));
5194
var
conversionResult = VisitConversion(
5201
TypeWithState
.Create(leftType, NullableFlowState.NotNull),
5233
var
operandType = ResultType;
5238
var
result = VisitConversion(boundConversion,
5384
SetResultType(node,
TypeWithState
.Create(resultType, NullableFlowState.MaybeDefault));
5420
TypeWithState
consequenceRValue;
5421
TypeWithState
alternativeRValue;
5447
SetResult(node,
TypeWithState
.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation));
5499
SetResultType(node,
TypeWithState
.Create(resultType, default));
5510
TypeWithState
typeWithState = convertArms(
5517
TypeWithState
convertArms(
5519
TypeWithState
consequenceRValue,
TypeWithState
alternativeRValue, BoundExpression consequence, Conversion consequenceConversion, bool consequenceEndReachable,
5525
TypeWithState
convertedConsequenceResult = ConvertConditionalOperandOrSwitchExpressionArmResult(
5534
TypeWithState
convertedAlternativeResult = ConvertConditionalOperandOrSwitchExpressionArmResult(
5544
var
typeWithState =
TypeWithState
.Create(resultTypeWithAnnotations.Type, resultState);
5557
return
TypeWithState
.Create(resultTypeWithAnnotations.Type, resultState);
5567
TypeWithState
consequenceRValue,
5568
TypeWithState
alternativeRValue,
5586
(BoundExpression, Conversion,
TypeWithState
) visitConditionalOperand(LocalState state, BoundExpression operand)
5599
(TypeWithAnnotations LValueType,
TypeWithState
RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand)
5608
private
TypeWithState
ConvertConditionalOperandOrSwitchExpressionArmResult(
5613
TypeWithState
operandType,
5630
var
resultType = VisitConversion(
5674
SetResultType(node,
TypeWithState
.Create(rvalueType, NullableFlowState.NotNull));
5681
TypeWithState
receiverType = VisitCallReceiver(node);
5686
private void ReinferMethodAndVisitArguments(BoundCall node,
TypeWithState
receiverType)
5705
var
returnState = GetReturnTypeWithState(method);
5715
private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node,
TypeWithState
receiverType, ImmutableArray<VisitArgumentResult> results)
5851
void learnFromEqualsMethodArguments(BoundExpression left,
TypeWithState
leftType, BoundExpression right,
TypeWithState
rightType)
5952
private
TypeWithState
VisitCallReceiver(BoundCall node)
5955
TypeWithState
receiverType = default;
5991
private
TypeWithState
GetReturnTypeWithState(MethodSymbol method)
5993
return
TypeWithState
.Create(method.ReturnTypeWithAnnotations, GetRValueAnnotations(method));
6037
private static
TypeWithState
ApplyUnconditionalAnnotations(
TypeWithState
typeWithState, FlowAnalysisAnnotations annotations)
6041
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.NotNull);
6046
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.MaybeDefault);
6324
TrackAnalyzedNullabilityThroughConversionGroup(
TypeWithState
.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion);
6564
var
resultType = result.RValueType;
6582
var
stateAfterConversion = VisitConversion(
6637
private bool CheckDisallowedNullAssignment(
TypeWithState
state, FlowAnalysisAnnotations annotations, Location location, BoundExpression? boundValueOpt = null)
6655
private static bool IsDisallowedNullAssignment(
TypeWithState
valueState, FlowAnalysisAnnotations targetAnnotations)
6713
var
parameterWithState =
TypeWithState
.Create(parameterType, parameterAnnotations);
6717
parameterWithState =
TypeWithState
.Create(parameterType.Type, adjustedState);
6740
var
parameterWithState =
TypeWithState
.Create(parameterType, parameterAnnotations);
6743
var
worstCaseParameterWithState = applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations);
6804
void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot,
TypeWithState
parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations)
6835
static
TypeWithState
applyPostConditionsUnconditionally(
TypeWithState
typeWithState, FlowAnalysisAnnotations annotations)
6840
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.MaybeDefault);
6846
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.NotNull);
6852
static
TypeWithState
applyPostConditionsWhenTrue(
TypeWithState
typeWithState, FlowAnalysisAnnotations annotations)
6861
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.MaybeDefault);
6865
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.NotNull);
6871
static
TypeWithState
applyPostConditionsWhenFalse(
TypeWithState
typeWithState, FlowAnalysisAnnotations annotations)
6880
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.MaybeDefault);
6884
return
TypeWithState
.Create(typeWithState.Type, NullableFlowState.NotNull);
7113
if (_walker.TryGetMethodGroupReceiverNullability(group.ReceiverOpt, out
TypeWithState
receiverType))
7308
private
TypeWithState
GetAdjustedResult(
TypeWithState
type, int slot)
7313
return
TypeWithState
.Create(type.Type, state);
7434
TypeWithState
operandType = VisitRvalueWithState(operand);
7459
private
TypeWithState
VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind)
7471
private (
TypeWithState
resultType, Func<TypeWithAnnotations,
TypeWithState
>? completion) VisitOptionalImplicitConversion(
7481
var
operandType = VisitRvalueWithState(operand);
7485
(
TypeWithState
resultType, Func<TypeWithAnnotations,
TypeWithState
>? completion) visitConversion(
7490
Conversion conversion,
TypeWithState
operandType,
7495
return (
TypeWithState
.Create(targetTypeOpt), visitConversionAsContinuation(expr, useLegacyWarnings, trackMembers, assignmentKind, operand, conversion, operandType));
7505
var
resultType = VisitConversion(
7522
Func<TypeWithAnnotations,
TypeWithState
> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion,
TypeWithState
operandType)
7572
ImmutableArray<
TypeWithState
> elementTypes = arguments.SelectAsArray((a, w) => w.VisitRvalueWithState(a), this);
7577
SetResultType(node,
TypeWithState
.Create(null, NullableFlowState.NotNull));
7596
SetResultType(node,
TypeWithState
.Create(tupleOpt, NullableFlowState.NotNull));
7609
ImmutableArray<
TypeWithState
> types,
7639
void trackState(BoundExpression value, FieldSymbol field,
TypeWithState
valueType)
7653
private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value,
TypeWithState
valueType, int valueSlot)
7747
var
convertedType = VisitUserDefinedConversion(
7907
private
TypeWithState
VisitConversion(
7912
TypeWithState
operandType,
7931
if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations,
TypeWithState
>? completion))
8015
return
TypeWithState
.Create(targetType, NullableFlowState.NotNull);
8210
TypeWithState
resultType = calculateResultType(targetTypeWithNullability, fromExplicitCast, resultState, isSuppressed, targetType);
8237
static
TypeWithState
calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType)
8249
var
resultType =
TypeWithState
.Create(targetType, resultState);
8253
static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType,
TypeWithState
operandType)
8287
static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType,
TypeWithState
operandType)
8315
static NullableFlowState getUnboxingConversionResultState(
TypeWithState
operandType)
8325
static NullableFlowState getConversionResultState(
TypeWithState
operandType)
8433
private
TypeWithState
VisitUserDefinedConversion(
8438
TypeWithState
operandType,
8457
var
resultType =
TypeWithState
.Create(targetType, NullableFlowState.NotNull);
8489
TypeWithState
underlyingOperandType = default;
8597
private void TrackAnalyzedNullabilityThroughConversionGroup(
TypeWithState
resultType, BoundConversion? conversionOpt, BoundExpression convertedNode)
8610
new VisitResult(
TypeWithState
.Create(newType, visitResult.RValueType.State),
8617
private
TypeWithState
GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState)
8622
return
TypeWithState
.Create(type, state);
8625
private static
TypeWithState
GetNullableUnderlyingTypeIfNecessary(bool isLifted,
TypeWithState
typeWithState)
8638
private
TypeWithState
GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState)
8650
private
TypeWithState
ClassifyAndVisitConversion(
8653
TypeWithState
operandType,
8728
TypeWithState
result = setAnalyzedNullability(node, delegateType, analysisCompletion, node.WasTargetTyped);
8732
TypeWithState
setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped)
8734
var
result =
TypeWithState
.Create(delegateType, NullableFlowState.NotNull);
8834
var
argState = VisitRvalueWithState(arg);
8887
private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out
TypeWithState
type)
8902
private void SetMethodGroupReceiverNullability(BoundExpression receiver,
TypeWithState
type)
8904
_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression,
TypeWithState
>.GetInstance();
8911
if (TryGetMethodGroupReceiverNullability(receiverOpt, out
TypeWithState
receiverType))
9019
var
rvalueResult =
TypeWithState
.Create(node.Type, NullableFlowState.NotNull);
9029
var
typeWithState = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations);
9070
TypeWithState
rightState;
9096
SetResult(node,
TypeWithState
.Create(leftLValueType.Type, rightState.State), leftLValueType);
9113
var
rValueType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), annotations);
9122
private void AdjustSetValue(BoundExpression left, ref
TypeWithState
rightState)
9217
private BoundNode? VisitDeconstructionAssignmentOperator(BoundDeconstructionAssignmentOperator node,
TypeWithState
? rightResultOpt)
9247
private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right,
TypeWithState
? rightResultOpt = null)
9261
private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right,
TypeWithState
? rightResultOpt)
9270
var
rightResult = ResultType;
9359
private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right,
TypeWithState
? rightResultOpt)
9382
TypeWithState
operandType;
9383
TypeWithState
valueType;
9435
var
valueBeforeNullableWrapping =
TypeWithState
.Create(underlyingType.Type, NullableFlowState.NotNull);
9492
private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr,
TypeWithState
? rightResultOpt)
9532
var
operandType = VisitRvalueWithState(node.Operand);
9562
TypeWithState
resultOfOperandConversionType;
9586
TypeWithState
resultOfIncrementType;
9612
TypeWithState
resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType;
9635
TypeWithState
leftResultType = ResultType;
9639
TypeWithState
leftOnRightType = GetAdjustedResult(leftResultType, MakeSlot(node.Left));
9663
TypeWithState
resultType;
9664
TypeWithState
rightType = VisitRvalueWithState(right);
9695
resultType =
TypeWithState
.Create(node.Type, NullableFlowState.NotNull);
9716
SetResultType(node.Expression,
TypeWithState
.Create(node.Expression.Type, ResultType.State));
9729
private void ReportArgumentWarnings(BoundExpression argument,
TypeWithState
argumentType, ParameterSymbol parameter)
9833
var
resultType = ApplyUnconditionalAnnotations(indexer.TypeWithAnnotations.ToTypeWithState(), GetRValueAnnotations(indexer));
9878
var
receiverType = (receiverOpt != null) ? VisitRvalueWithState(receiverOpt) : default;
9893
var
resultType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), memberAnnotations);
9903
resultType =
TypeWithState
.Create(resultType.Type, state);
9989
var
resultTypeWithState = VisitRvalueWithState(expr);
10054
var
convertedResult = VisitConversion(
10071
TypeWithState
currentPropertyGetterTypeWithState;
10095
var
enumeratorReturnType = GetReturnTypeWithState(reinferredGetEnumeratorMethod);
10151
var
sourceState = node.EnumeratorInfoOpt == null ? default : ResultType;
10168
VisitDeconstructionAssignmentOperator(assignment, sourceState.HasNullType ? (
TypeWithState
?)null : sourceState);
10182
TypeWithState
result = sourceState;
10183
TypeWithState
resultForType = sourceState;
10307
TypeWithState
resultType;
10339
var
operandResult = ResultType;
10341
var
operandType = GetNullableUnderlyingTypeIfNecessary(isLifted, operandResult);
10371
TypeWithState
adjustForLifting(
TypeWithState
argumentResult) =>
10372
TypeWithState
.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull);
10413
private
TypeWithState
InferResultNullability(BoundUserDefinedConditionalLogicalOperator node)
10419
return
TypeWithState
.Create(node.Type, NullableFlowState.NotNull);
10437
TypeWithState
leftType = ResultType;
10481
TypeWithState
rightType = ResultType;
10493
private
TypeWithState
InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node,
TypeWithState
leftType,
TypeWithState
rightType)
10537
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.NotNull));
10559
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.MaybeDefault));
10581
SetResultType(node,
TypeWithState
.ForType(type));
10621
var
argumentType = VisitRvalueWithState(node.Operand);
10643
SetResultType(node,
TypeWithState
.Create(type, resultState));
10675
SetResultType(node,
TypeWithState
.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull));
10750
if (TryGetMethodGroupReceiverNullability(receiverOpt, out
TypeWithState
receiverType))
10852
SetResultType(expression,
TypeWithState
.Create(expression.Type, default));
10874
private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt,
TypeWithState
resultType, bool checkNullableValueType)
10918
private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter,
TypeWithState
result)
10959
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.NotNull));
10974
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.NotNull));
11023
SetResultType(node,
TypeWithState
.Create(node.Type, NullableFlowState.NotNull));
11029
SetResultType(node,
TypeWithState
.Create(type, NullableFlowState.NotNull));
11036
var
rValueType =
TypeWithState
.ForType(node.Type);
11058
var
result = VisitRvalueWithState(expr);
11186
Debug.Assert(ResultType is
TypeWithState
{ Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
FlowAnalysis\NullableWalker_Patterns.cs (16)
260
var
expressionState = ResultType;
340
TypeWithState
expressionTypeWithState,
643
var
value =
TypeWithState
.Create(tempType, tempState);
655
TrackNullableStateForAssignment(valueOpt: null, inferredType, localSlot,
TypeWithState
.Create(tempType, tempState), tempSlot);
851
var
expressionState = ResultType;
874
var resultTypes = ArrayBuilder<
TypeWithState
>.GetInstance(numSwitchArms);
895
var
armType = VisitRvalueWithState(expression);
914
TypeWithState
resultType;
925
resultType =
TypeWithState
.Create(inferredType, inferredState);
940
TypeWithState
convertArms(
944
ArrayBuilder<
TypeWithState
> resultTypes,
975
TypeWithState
resultType =
TypeWithState
.Create(inferredTypeWithAnnotations.Type, inferredState);
989
ArrayBuilder<
TypeWithState
> resultTypes,
1014
var
expressionState = ResultType;
Symbols\TypeWithAnnotations.cs (2)
776
internal
TypeWithState
ToTypeWithState()
782
return
TypeWithState
.Create(Type, getFlowState(Type, NullableAnnotation));
Symbols\TypeWithState.cs (5)
23
public static
TypeWithState
ForType(TypeSymbol? type)
28
public static
TypeWithState
Create(TypeSymbol? type, NullableFlowState defaultState)
40
public static
TypeWithState
Create(TypeWithAnnotations typeWithAnnotations, FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None)
81
public
TypeWithState
WithNotNullState() => new TypeWithState(Type, NullableFlowState.NotNull);
83
public
TypeWithState
WithSuppression(bool suppress) => suppress ? new TypeWithState(Type, NullableFlowState.NotNull) : this;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
476
var type =
TypeWithState
.Create(