4 instantiations of TypeWithState
Microsoft.CodeAnalysis.CSharp (4)
Symbols\TypeWithState.cs (4)
34return new TypeWithState(type, defaultState); 37return new TypeWithState(type, state); 81public TypeWithState WithNotNullState() => new TypeWithState(Type, NullableFlowState.NotNull); 83public TypeWithState WithSuppression(bool suppress) => suppress ? new TypeWithState(Type, NullableFlowState.NotNull) : this;
312 references to TypeWithState
Microsoft.CodeAnalysis.CSharp (312)
Binder\Binder_Patterns.cs (1)
1357var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
Binder\Semantics\BestTypeInferrer.cs (1)
36public static NullableFlowState GetNullableState(ArrayBuilder<TypeWithState> types)
FlowAnalysis\NullableWalker.cs (287)
99public readonly TypeWithState RValueType; 111public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType) 120public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, Optional<LocalState> stateForLambda) 128RValueType = TypeWithState.Create(type, state); 137public VisitResult(TypeWithState rValueType, TypeWithAnnotations lValueType, VisitResult[] nestedVisitResults) 216private static readonly TypeWithState _invalidType = TypeWithState.Create(new UnsupportedMetadataTypeSymbol(), NullableFlowState.NotNull); 237private PooledDictionary<BoundExpression, TypeWithState>? _methodGroupReceiverMapOpt; 248private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt; 253/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, bool, Optional&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 255private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion 256=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 297private TypeWithState ResultType 302private void SetResultType(BoundExpression? expression, TypeWithState type, bool updateAnalyzedNullability = true) 307private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState type) 341private void SetResult(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null) 361private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null) 2313private TypeWithState VisitRvalueWithState(BoundExpression? node) 2357/// This should often be checked together with <seealso cref="IsDisallowedNullAssignment(TypeWithState, FlowAnalysisAnnotations)"/> 2397TypeWithState valueType, 2452static bool isMaybeDefaultValue(TypeWithState valueType) 2489var valueState = GetParameterState( 2528var valueWhen = ApplyUnconditionalAnnotations( 2542static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2620TypeWithState valueType, 2661static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 3006var resultType = VisitOptionalImplicitConversion( 3020internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 3024return TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault); 3029return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull); 3060TypeWithState returnState; 3077var result = VisitRvalueWithState(expr); 3109private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 3112TypeWithState resultType = ResultType; 3181SetResultType(node, TypeWithState.ForType(node.Type)); 3550var resultState = ApplyUnconditionalAnnotations(resultType.ToTypeWithState(), GetRValueAnnotations(withExpr.CloneMethod)); 3651TypeWithState valueType; 3700TypeWithState resultType = ResultType; 3710var result = resultType.WithNotNullState(); 3832SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3840SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3853var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 3918var visitResult = new VisitResult(TypeWithState.Create(resultType), resultType, 3924TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions) 3946var resultTypeWithState = TypeWithState.Create(strippedTargetCollectionType, resultState); 4036TypeWithState result = setAnalyzedNullability(node, type, argumentResults, argumentsCompletion, initialStateInferenceCompletion, initializerCompletion, resultState, isTargetTyped); 4040TypeWithState setAnalyzedNullability( 4050var result = TypeWithState.Create(type, resultState); 4411Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4424(TypeWithState resultType, conversionCompletion) = 4444Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4552TypeWithState.Create(containingType, receiverResult.RValueType.State), 4572SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4577var resultType = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 4685SetResultType(node, TypeWithState.Create(anonymousType, NullableFlowState.NotNull)); 4717SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4722SetResultType(node, TypeWithState.Create(arrayType, NullableFlowState.NotNull)); 4756var expressionTypes = ArrayBuilder<TypeWithState>.GetInstance(n); 4765var expressionType = VisitRvalueWithState(expressionNoConversion); 4799inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4998private TypeWithState InferResultNullability(BinaryOperatorKind operatorKind, MethodSymbol? methodOpt, TypeSymbol resultType, TypeWithState leftType, TypeWithState rightType) 5010var resultTypeWithState = GetReturnTypeWithState(methodOpt); 5041return TypeWithState.Create(resultType, resultState); 5058var leftType = ResultType; 5085var rightType = VisitRvalueWithState(rightOperand); 5128static bool isKnownNullOrNotNull(BoundExpression expr, TypeWithState resultType) 5163var leftResult = ResultType; 5216SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 5224TypeWithState leftType, 5227TypeWithState rightType, 5230var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.OperatorKind, binary.Method, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType); 5234private TypeWithState ReinferAndVisitBinaryOperator( 5242TypeWithState leftType, 5246TypeWithState rightType) 5258TypeWithState leftUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, leftType); 5259TypeWithState rightUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, rightType); 5280TypeWithState operandType) 5313var inferredResult = InferResultNullability(operatorKind, method, returnType, leftType, rightType); 5334private void VisitBinaryOperatorOperandConversionAndPostConditions(BoundExpression expr, BoundExpression operand, Conversion conversion, ParameterSymbol parameter, TypeWithState operandType, bool isLifted) 5344var resultType = VisitConversion( 5370var leftType = ResultType; 5375var rightType = ResultType; 5729TypeWithState rightResult = VisitOptionalImplicitConversion(rightOperand, targetType, useLegacyWarnings: UseLegacyWarnings(leftOperand), trackMembers: false, AssignmentKind.Assignment); 5734TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5750var rightUnconditionalResult = ResultType; 5753SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5758TypeWithState leftResult = ResultType; 5769TypeWithState rightResult = ResultType; 5787SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5813var conversionResult = VisitConversion( 5820TypeWithState.Create(leftType, NullableFlowState.NotNull), 5852var operandType = ResultType; 5857var result = VisitConversion(boundConversion, 6004SetResultType(node, TypeWithState.Create(resultType, NullableFlowState.MaybeDefault)); 6040TypeWithState consequenceRValue; 6041TypeWithState alternativeRValue; 6080SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 6144SetResultType(node, TypeWithState.Create(resultType, default)); 6155TypeWithState typeWithState = convertArms( 6162TypeWithState convertArms( 6164TypeWithState consequenceRValue, TypeWithState alternativeRValue, BoundExpression consequence, Conversion consequenceConversion, bool consequenceEndReachable, 6170TypeWithState convertedConsequenceResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6179TypeWithState convertedAlternativeResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6189var typeWithState = TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6202return TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6212TypeWithState consequenceRValue, 6213TypeWithState alternativeRValue, 6231(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6244(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6261private TypeWithState ConvertConditionalOperandOrSwitchExpressionArmResult( 6266TypeWithState operandType, 6283var resultType = VisitConversion( 6327SetResultType(node, TypeWithState.Create(rvalueType, NullableFlowState.NotNull)); 6353TypeWithState receiverType = visitAndCheckReceiver(node); 6408TypeWithState receiverType = visitAndCheckReceiver(node); 6436TypeWithState visitAndCheckReceiver(BoundCall node) 6438TypeWithState receiverType = default; 6450void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null) 6479var returnState = GetReturnTypeWithState(method); 6571private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results) 6707void learnFromEqualsMethodArguments(BoundExpression left, TypeWithState leftType, BoundExpression right, TypeWithState rightType) 6808private void CheckCallReceiver(BoundExpression? receiverOpt, TypeWithState receiverType, MethodSymbol method) 6841private TypeWithState GetReturnTypeWithState(MethodSymbol method) 6843return TypeWithState.Create(method.ReturnTypeWithAnnotations, GetRValueAnnotations(method)); 6913private static TypeWithState ApplyUnconditionalAnnotations(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 6917return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 6922return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7235TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 7646var resultType = result.RValueType; 7664var stateAfterConversion = VisitConversion( 7719private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7737private static bool IsDisallowedNullAssignment(TypeWithState valueState, FlowAnalysisAnnotations targetAnnotations) 7795var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7799parameterWithState = TypeWithState.Create(parameterType.Type, adjustedState); 7822var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7825var worstCaseParameterWithState = applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations); 7886void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7917static TypeWithState applyPostConditionsUnconditionally(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7922return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7928return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7934static TypeWithState applyPostConditionsWhenTrue(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7943return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7947return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7953static TypeWithState applyPostConditionsWhenFalse(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7962return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7966return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 8207if (_walker.TryGetMethodGroupReceiverNullability(group.ReceiverOpt, out TypeWithState receiverType)) 8443private TypeWithState GetAdjustedResult(TypeWithState type, int slot) 8448return TypeWithState.Create(type.Type, state); 8603private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8615private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8625var operandType = VisitRvalueWithState(operand); 8629(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8634Conversion conversion, TypeWithState operandType, 8639return (TypeWithState.Create(targetTypeOpt), visitConversionAsContinuation(expr, useLegacyWarnings, trackMembers, assignmentKind, operand, conversion, operandType)); 8649var resultType = VisitConversion( 8666Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8716ImmutableArray<TypeWithState> elementTypes = arguments.SelectAsArray((a, w) => w.VisitRvalueWithState(a), this); 8721SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 8746SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.NotNull)); 8759ImmutableArray<TypeWithState> types, 8789void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType) 8803private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot) 8897var convertedType = VisitUserDefinedConversion( 9070private TypeWithState VisitConversion( 9075TypeWithState operandType, 9095if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 9177return TypeWithState.Create(targetType, NullableFlowState.NotNull); 9392TypeWithState resultType = calculateResultType(targetTypeWithNullability, fromExplicitCast, resultState, isSuppressed, targetType); 9426static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9438var resultType = TypeWithState.Create(targetType, resultState); 9442static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9476static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9504static NullableFlowState getUnboxingConversionResultState(TypeWithState operandType) 9514static NullableFlowState getConversionResultState(TypeWithState operandType) 9622private TypeWithState VisitUserDefinedConversion( 9627TypeWithState operandType, 9647var resultType = TypeWithState.Create(targetType, NullableFlowState.NotNull); 9679TypeWithState underlyingOperandType = default; 9787private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 9810private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 9815return TypeWithState.Create(type, state); 9818private static TypeWithState GetNullableUnderlyingTypeIfNecessary(bool isLifted, TypeWithState typeWithState) 9831private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 9843private TypeWithState ClassifyAndVisitConversion( 9846TypeWithState operandType, 9921TypeWithState result = setAnalyzedNullability(node, delegateType, analysisCompletion, node.WasTargetTyped); 9925TypeWithState setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped) 9927var result = TypeWithState.Create(delegateType, NullableFlowState.NotNull); 10027var argState = VisitRvalueWithState(arg); 10080private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type) 10095private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type) 10097_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance(); 10106if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 10224var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 10234var typeWithState = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations); 10277TypeWithState rightState; 10300SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10320var rValueType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), annotations); 10329private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState) 10423private BoundNode? VisitDeconstructionAssignmentOperator(BoundDeconstructionAssignmentOperator node, TypeWithState? rightResultOpt) 10453private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null) 10467private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt) 10476var rightResult = ResultType; 10568private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt) 10591TypeWithState operandType; 10592TypeWithState valueType; 10644var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull); 10701private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt) 10741var operandType = VisitRvalueWithState(node.Operand); 10780TypeWithState resultOfOperandConversionType; 10804TypeWithState resultOfIncrementType; 10830TypeWithState resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType; 10851var leftTypeWithState = ResultType; 10859var rightTypeWithState = VisitRvalueWithState(rightConversionOperand); 10889var resultTypeWithState = ReinferAndVisitBinaryOperator( 10942SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 10955private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter) 11060var resultType = ApplyUnconditionalAnnotations(indexer.TypeWithAnnotations.ToTypeWithState(), GetRValueAnnotations(indexer)); 11118var receiverType = (receiverOpt != null) ? VisitRvalueWithState(receiverOpt) : default; 11133var resultType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), memberAnnotations); 11143resultType = TypeWithState.Create(resultType.Type, state); 11247var resultTypeWithState = VisitRvalueWithState(expr); 11312var convertedResult = VisitConversion( 11329TypeWithState currentPropertyGetterTypeWithState; 11370var enumeratorReturnType = GetReturnTypeWithState(reinferredGetEnumeratorMethod); 11426var sourceState = node.EnumeratorInfoOpt == null ? default : ResultType; 11443VisitDeconstructionAssignmentOperator(assignment, sourceState.HasNullType ? (TypeWithState?)null : sourceState); 11457TypeWithState result = sourceState; 11458TypeWithState resultForType = sourceState; 11584TypeWithState resultType; 11616var operandResult = ResultType; 11618var operandType = GetNullableUnderlyingTypeIfNecessary(isLifted, operandResult); 11648TypeWithState adjustForLifting(TypeWithState argumentResult) => 11649TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11690private TypeWithState InferResultNullability(BoundUserDefinedConditionalLogicalOperator node) 11696return TypeWithState.Create(node.Type, NullableFlowState.NotNull); 11714TypeWithState leftType = ResultType; 11758TypeWithState rightType = ResultType; 11770private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType) 11814SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11836SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.MaybeDefault)); 11856SetResultType(node, TypeWithState.ForType(type)); 11896var argumentType = VisitRvalueWithState(node.Operand); 11918SetResultType(node, TypeWithState.Create(type, resultState)); 11950SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 12025if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 12127SetResultType(expression, TypeWithState.Create(expression.Type, default)); 12149private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType) 12193private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result) 12234SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12249SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12298SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12304SetResultType(node, TypeWithState.Create(type, NullableFlowState.NotNull)); 12311var rValueType = TypeWithState.ForType(node.Type); 12333var result = VisitRvalueWithState(expr); 12461Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
FlowAnalysis\NullableWalker_Patterns.cs (16)
298var expressionState = ResultType; 378TypeWithState expressionTypeWithState, 683var value = TypeWithState.Create(tempType, tempState); 695TrackNullableStateForAssignment(valueOpt: null, inferredType, localSlot, TypeWithState.Create(tempType, tempState), tempSlot); 891var expressionState = ResultType; 914var resultTypes = ArrayBuilder<TypeWithState>.GetInstance(numSwitchArms); 935var armType = VisitRvalueWithState(expression); 957TypeWithState resultType; 970resultType = TypeWithState.Create(inferredType, inferredState); 985TypeWithState convertArms( 989ArrayBuilder<TypeWithState> resultTypes, 1020TypeWithState resultType = TypeWithState.Create(inferredTypeWithAnnotations.Type, inferredState); 1034ArrayBuilder<TypeWithState> resultTypes, 1059var expressionState = ResultType;
Symbols\TypeWithAnnotations.cs (2)
805internal TypeWithState ToTypeWithState() 811return TypeWithState.Create(Type, getFlowState(Type, NullableAnnotation));
Symbols\TypeWithState.cs (5)
23public static TypeWithState ForType(TypeSymbol? type) 28public static TypeWithState Create(TypeSymbol? type, NullableFlowState defaultState) 40public static TypeWithState Create(TypeWithAnnotations typeWithAnnotations, FlowAnalysisAnnotations annotations = FlowAnalysisAnnotations.None) 81public TypeWithState WithNotNullState() => new TypeWithState(Type, NullableFlowState.NotNull); 83public TypeWithState WithSuppression(bool suppress) => suppress ? new TypeWithState(Type, NullableFlowState.NotNull) : this;