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) 210private static readonly TypeWithState _invalidType = TypeWithState.Create(new UnsupportedMetadataTypeSymbol(), NullableFlowState.NotNull); 231private PooledDictionary<BoundExpression, TypeWithState>? _methodGroupReceiverMapOpt; 242private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt; 247/// 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;)"/>. 249private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion 250=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 291private TypeWithState ResultType 296private void SetResultType(BoundExpression? expression, TypeWithState type, bool updateAnalyzedNullability = true) 301private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState type) 335private void SetResult(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null) 355private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null) 2278private TypeWithState VisitRvalueWithState(BoundExpression? node) 2322/// This should often be checked together with <seealso cref="IsDisallowedNullAssignment(TypeWithState, FlowAnalysisAnnotations)"/> 2362TypeWithState valueType, 2417static bool isMaybeDefaultValue(TypeWithState valueType) 2454var valueState = GetParameterState( 2493var valueWhen = ApplyUnconditionalAnnotations( 2507static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2585TypeWithState valueType, 2626static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 2912var resultType = VisitOptionalImplicitConversion( 2926internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 2930return TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault); 2935return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull); 2966TypeWithState returnState; 2983var result = VisitRvalueWithState(expr); 3014private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 3017TypeWithState resultType = ResultType; 3086SetResultType(node, TypeWithState.ForType(node.Type)); 3455var resultState = ApplyUnconditionalAnnotations(resultType.ToTypeWithState(), GetRValueAnnotations(withExpr.CloneMethod)); 3556TypeWithState valueType; 3605TypeWithState resultType = ResultType; 3615var result = resultType.WithNotNullState(); 3737SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3745SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3758var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 3823var visitResult = new VisitResult(TypeWithState.Create(resultType), resultType, 3829TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions) 3851var resultTypeWithState = TypeWithState.Create(strippedTargetCollectionType, resultState); 3941TypeWithState result = setAnalyzedNullability(node, type, argumentResults, argumentsCompletion, initialStateInferenceCompletion, initializerCompletion, resultState, isTargetTyped); 3945TypeWithState setAnalyzedNullability( 3955var result = TypeWithState.Create(type, resultState); 4316Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4329(TypeWithState resultType, conversionCompletion) = 4349Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4457TypeWithState.Create(containingType, receiverResult.RValueType.State), 4476SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4481var resultType = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 4589SetResultType(node, TypeWithState.Create(anonymousType, NullableFlowState.NotNull)); 4621SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4626SetResultType(node, TypeWithState.Create(arrayType, NullableFlowState.NotNull)); 4660var expressionTypes = ArrayBuilder<TypeWithState>.GetInstance(n); 4669var expressionType = VisitRvalueWithState(expressionNoConversion); 4703inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4901private TypeWithState InferResultNullability(BinaryOperatorKind operatorKind, MethodSymbol? methodOpt, TypeSymbol resultType, TypeWithState leftType, TypeWithState rightType) 4913var resultTypeWithState = GetReturnTypeWithState(methodOpt); 4944return TypeWithState.Create(resultType, resultState); 4961var leftType = ResultType; 4988var rightType = VisitRvalueWithState(rightOperand); 5031static bool isKnownNullOrNotNull(BoundExpression expr, TypeWithState resultType) 5066var leftResult = ResultType; 5119SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 5127TypeWithState leftType, 5130TypeWithState rightType, 5133var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.OperatorKind, binary.Method, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType); 5137private TypeWithState ReinferAndVisitBinaryOperator( 5145TypeWithState leftType, 5149TypeWithState rightType) 5161TypeWithState leftUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, leftType); 5162TypeWithState rightUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, rightType); 5178TypeWithState operandType) 5188var resultType = VisitConversion( 5218TypeWithState operandType) 5251var inferredResult = InferResultNullability(operatorKind, method, returnType, leftType, rightType); 5278var leftType = ResultType; 5283var rightType = ResultType; 5637TypeWithState rightResult = VisitOptionalImplicitConversion(rightOperand, targetType, useLegacyWarnings: UseLegacyWarnings(leftOperand), trackMembers: false, AssignmentKind.Assignment); 5642TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5658var rightUnconditionalResult = ResultType; 5661SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5666TypeWithState leftResult = ResultType; 5677TypeWithState rightResult = ResultType; 5695SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5721var conversionResult = VisitConversion( 5728TypeWithState.Create(leftType, NullableFlowState.NotNull), 5760var operandType = ResultType; 5765var result = VisitConversion(boundConversion, 5911SetResultType(node, TypeWithState.Create(resultType, NullableFlowState.MaybeDefault)); 5947TypeWithState consequenceRValue; 5948TypeWithState alternativeRValue; 5987SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 6051SetResultType(node, TypeWithState.Create(resultType, default)); 6062TypeWithState typeWithState = convertArms( 6069TypeWithState convertArms( 6071TypeWithState consequenceRValue, TypeWithState alternativeRValue, BoundExpression consequence, Conversion consequenceConversion, bool consequenceEndReachable, 6077TypeWithState convertedConsequenceResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6086TypeWithState convertedAlternativeResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6096var typeWithState = TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6109return TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6119TypeWithState consequenceRValue, 6120TypeWithState alternativeRValue, 6138(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6151(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6168private TypeWithState ConvertConditionalOperandOrSwitchExpressionArmResult( 6173TypeWithState operandType, 6190var resultType = VisitConversion( 6234SetResultType(node, TypeWithState.Create(rvalueType, NullableFlowState.NotNull)); 6260TypeWithState receiverType = visitAndCheckReceiver(node); 6300TypeWithState receiverType = visitAndCheckReceiver(node); 6328TypeWithState visitAndCheckReceiver(BoundCall node) 6330TypeWithState receiverType = default; 6341void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null) 6360var returnState = GetReturnTypeWithState(method); 6371private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results) 6507void learnFromEqualsMethodArguments(BoundExpression left, TypeWithState leftType, BoundExpression right, TypeWithState rightType) 6608private void CheckCallReceiver(BoundExpression? receiverOpt, TypeWithState receiverType, MethodSymbol method) 6636private TypeWithState GetReturnTypeWithState(MethodSymbol method) 6638return TypeWithState.Create(method.ReturnTypeWithAnnotations, GetRValueAnnotations(method)); 6708private static TypeWithState ApplyUnconditionalAnnotations(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 6712return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 6717return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7025TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 7430var resultType = result.RValueType; 7448var stateAfterConversion = VisitConversion( 7503private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7521private static bool IsDisallowedNullAssignment(TypeWithState valueState, FlowAnalysisAnnotations targetAnnotations) 7579var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7583parameterWithState = TypeWithState.Create(parameterType.Type, adjustedState); 7606var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7609var worstCaseParameterWithState = applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations); 7670void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7701static TypeWithState applyPostConditionsUnconditionally(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7706return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7712return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7718static TypeWithState applyPostConditionsWhenTrue(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7727return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7731return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7737static TypeWithState applyPostConditionsWhenFalse(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7746return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7750return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7987if (_walker.TryGetMethodGroupReceiverNullability(group.ReceiverOpt, out TypeWithState receiverType)) 8220private TypeWithState GetAdjustedResult(TypeWithState type, int slot) 8225return TypeWithState.Create(type.Type, state); 8379private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8391private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8401var operandType = VisitRvalueWithState(operand); 8405(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8410Conversion conversion, TypeWithState operandType, 8415return (TypeWithState.Create(targetTypeOpt), visitConversionAsContinuation(expr, useLegacyWarnings, trackMembers, assignmentKind, operand, conversion, operandType)); 8425var resultType = VisitConversion( 8442Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8492ImmutableArray<TypeWithState> elementTypes = arguments.SelectAsArray((a, w) => w.VisitRvalueWithState(a), this); 8497SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 8522SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.NotNull)); 8535ImmutableArray<TypeWithState> types, 8565void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType) 8579private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot) 8673var convertedType = VisitUserDefinedConversion( 8846private TypeWithState VisitConversion( 8851TypeWithState operandType, 8871if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 8953return TypeWithState.Create(targetType, NullableFlowState.NotNull); 9168TypeWithState resultType = calculateResultType(targetTypeWithNullability, fromExplicitCast, resultState, isSuppressed, targetType); 9202static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9214var resultType = TypeWithState.Create(targetType, resultState); 9218static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9252static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9280static NullableFlowState getUnboxingConversionResultState(TypeWithState operandType) 9290static NullableFlowState getConversionResultState(TypeWithState operandType) 9398private TypeWithState VisitUserDefinedConversion( 9403TypeWithState operandType, 9423var resultType = TypeWithState.Create(targetType, NullableFlowState.NotNull); 9455TypeWithState underlyingOperandType = default; 9563private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 9586private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 9591return TypeWithState.Create(type, state); 9594private static TypeWithState GetNullableUnderlyingTypeIfNecessary(bool isLifted, TypeWithState typeWithState) 9607private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 9619private TypeWithState ClassifyAndVisitConversion( 9622TypeWithState operandType, 9697TypeWithState result = setAnalyzedNullability(node, delegateType, analysisCompletion, node.WasTargetTyped); 9701TypeWithState setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped) 9703var result = TypeWithState.Create(delegateType, NullableFlowState.NotNull); 9803var argState = VisitRvalueWithState(arg); 9856private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type) 9871private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type) 9873_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance(); 9880if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 9988var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 9998var typeWithState = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations); 10027TypeWithState rightState; 10050SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10070var rValueType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), annotations); 10079private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState) 10173private BoundNode? VisitDeconstructionAssignmentOperator(BoundDeconstructionAssignmentOperator node, TypeWithState? rightResultOpt) 10203private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null) 10217private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt) 10226var rightResult = ResultType; 10315private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt) 10338TypeWithState operandType; 10339TypeWithState valueType; 10391var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull); 10448private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt) 10488var operandType = VisitRvalueWithState(node.Operand); 10518TypeWithState resultOfOperandConversionType; 10542TypeWithState resultOfIncrementType; 10568TypeWithState resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType; 10593var leftTypeWithState = ResultType; 10601var rightTypeWithState = VisitRvalueWithState(rightConversionOperand); 10604var resultTypeWithState = ReinferAndVisitBinaryOperator( 10657SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 10670private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter) 10774var resultType = ApplyUnconditionalAnnotations(indexer.TypeWithAnnotations.ToTypeWithState(), GetRValueAnnotations(indexer)); 10831var receiverType = (receiverOpt != null) ? VisitRvalueWithState(receiverOpt) : default; 10846var resultType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), memberAnnotations); 10856resultType = TypeWithState.Create(resultType.Type, state); 10960var resultTypeWithState = VisitRvalueWithState(expr); 11025var convertedResult = VisitConversion( 11042TypeWithState currentPropertyGetterTypeWithState; 11083var enumeratorReturnType = GetReturnTypeWithState(reinferredGetEnumeratorMethod); 11139var sourceState = node.EnumeratorInfoOpt == null ? default : ResultType; 11156VisitDeconstructionAssignmentOperator(assignment, sourceState.HasNullType ? (TypeWithState?)null : sourceState); 11170TypeWithState result = sourceState; 11171TypeWithState resultForType = sourceState; 11297TypeWithState resultType; 11329var operandResult = ResultType; 11331var operandType = GetNullableUnderlyingTypeIfNecessary(isLifted, operandResult); 11361TypeWithState adjustForLifting(TypeWithState argumentResult) => 11362TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11403private TypeWithState InferResultNullability(BoundUserDefinedConditionalLogicalOperator node) 11409return TypeWithState.Create(node.Type, NullableFlowState.NotNull); 11427TypeWithState leftType = ResultType; 11471TypeWithState rightType = ResultType; 11483private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType) 11527SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11549SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.MaybeDefault)); 11569SetResultType(node, TypeWithState.ForType(type)); 11609var argumentType = VisitRvalueWithState(node.Operand); 11631SetResultType(node, TypeWithState.Create(type, resultState)); 11663SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 11738if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 11840SetResultType(expression, TypeWithState.Create(expression.Type, default)); 11862private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType) 11906private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result) 11947SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11962SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12011SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12017SetResultType(node, TypeWithState.Create(type, NullableFlowState.NotNull)); 12024var rValueType = TypeWithState.ForType(node.Type); 12046var result = VisitRvalueWithState(expr); 12174Debug.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;