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) 2298private TypeWithState VisitRvalueWithState(BoundExpression? node) 2342/// This should often be checked together with <seealso cref="IsDisallowedNullAssignment(TypeWithState, FlowAnalysisAnnotations)"/> 2382TypeWithState valueType, 2437static bool isMaybeDefaultValue(TypeWithState valueType) 2474var valueState = GetParameterState( 2513var valueWhen = ApplyUnconditionalAnnotations( 2527static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2605TypeWithState valueType, 2646static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 2991var resultType = VisitOptionalImplicitConversion( 3005internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 3009return TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault); 3014return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull); 3045TypeWithState returnState; 3062var result = VisitRvalueWithState(expr); 3093private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 3096TypeWithState resultType = ResultType; 3165SetResultType(node, TypeWithState.ForType(node.Type)); 3534var resultState = ApplyUnconditionalAnnotations(resultType.ToTypeWithState(), GetRValueAnnotations(withExpr.CloneMethod)); 3635TypeWithState valueType; 3684TypeWithState resultType = ResultType; 3694var result = resultType.WithNotNullState(); 3816SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3824SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3837var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 3902var visitResult = new VisitResult(TypeWithState.Create(resultType), resultType, 3908TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions) 3930var resultTypeWithState = TypeWithState.Create(strippedTargetCollectionType, resultState); 4020TypeWithState result = setAnalyzedNullability(node, type, argumentResults, argumentsCompletion, initialStateInferenceCompletion, initializerCompletion, resultState, isTargetTyped); 4024TypeWithState setAnalyzedNullability( 4034var result = TypeWithState.Create(type, resultState); 4395Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4408(TypeWithState resultType, conversionCompletion) = 4428Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4536TypeWithState.Create(containingType, receiverResult.RValueType.State), 4556SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4561var resultType = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 4669SetResultType(node, TypeWithState.Create(anonymousType, NullableFlowState.NotNull)); 4701SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4706SetResultType(node, TypeWithState.Create(arrayType, NullableFlowState.NotNull)); 4740var expressionTypes = ArrayBuilder<TypeWithState>.GetInstance(n); 4749var expressionType = VisitRvalueWithState(expressionNoConversion); 4783inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4982private TypeWithState InferResultNullability(BinaryOperatorKind operatorKind, MethodSymbol? methodOpt, TypeSymbol resultType, TypeWithState leftType, TypeWithState rightType) 4994var resultTypeWithState = GetReturnTypeWithState(methodOpt); 5025return TypeWithState.Create(resultType, resultState); 5042var leftType = ResultType; 5069var rightType = VisitRvalueWithState(rightOperand); 5112static bool isKnownNullOrNotNull(BoundExpression expr, TypeWithState resultType) 5147var leftResult = ResultType; 5200SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 5208TypeWithState leftType, 5211TypeWithState rightType, 5214var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.OperatorKind, binary.Method, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType); 5218private TypeWithState ReinferAndVisitBinaryOperator( 5226TypeWithState leftType, 5230TypeWithState rightType) 5242TypeWithState leftUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, leftType); 5243TypeWithState rightUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, rightType); 5259TypeWithState operandType) 5269var resultType = VisitConversion( 5299TypeWithState operandType) 5332var inferredResult = InferResultNullability(operatorKind, method, returnType, leftType, rightType); 5359var leftType = ResultType; 5364var rightType = ResultType; 5718TypeWithState rightResult = VisitOptionalImplicitConversion(rightOperand, targetType, useLegacyWarnings: UseLegacyWarnings(leftOperand), trackMembers: false, AssignmentKind.Assignment); 5723TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5739var rightUnconditionalResult = ResultType; 5742SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5747TypeWithState leftResult = ResultType; 5758TypeWithState rightResult = ResultType; 5776SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5802var conversionResult = VisitConversion( 5809TypeWithState.Create(leftType, NullableFlowState.NotNull), 5841var operandType = ResultType; 5846var result = VisitConversion(boundConversion, 5992SetResultType(node, TypeWithState.Create(resultType, NullableFlowState.MaybeDefault)); 6028TypeWithState consequenceRValue; 6029TypeWithState alternativeRValue; 6068SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 6132SetResultType(node, TypeWithState.Create(resultType, default)); 6143TypeWithState typeWithState = convertArms( 6150TypeWithState convertArms( 6152TypeWithState consequenceRValue, TypeWithState alternativeRValue, BoundExpression consequence, Conversion consequenceConversion, bool consequenceEndReachable, 6158TypeWithState convertedConsequenceResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6167TypeWithState convertedAlternativeResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6177var typeWithState = TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6190return TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6200TypeWithState consequenceRValue, 6201TypeWithState alternativeRValue, 6219(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6232(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6249private TypeWithState ConvertConditionalOperandOrSwitchExpressionArmResult( 6254TypeWithState operandType, 6271var resultType = VisitConversion( 6315SetResultType(node, TypeWithState.Create(rvalueType, NullableFlowState.NotNull)); 6341TypeWithState receiverType = visitAndCheckReceiver(node); 6382TypeWithState receiverType = visitAndCheckReceiver(node); 6410TypeWithState visitAndCheckReceiver(BoundCall node) 6412TypeWithState receiverType = default; 6423void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null) 6443var returnState = GetReturnTypeWithState(method); 6454private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results) 6590void learnFromEqualsMethodArguments(BoundExpression left, TypeWithState leftType, BoundExpression right, TypeWithState rightType) 6691private void CheckCallReceiver(BoundExpression? receiverOpt, TypeWithState receiverType, MethodSymbol method) 6719private TypeWithState GetReturnTypeWithState(MethodSymbol method) 6721return TypeWithState.Create(method.ReturnTypeWithAnnotations, GetRValueAnnotations(method)); 6797private static TypeWithState ApplyUnconditionalAnnotations(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 6801return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 6806return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7114TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 7519var resultType = result.RValueType; 7537var stateAfterConversion = VisitConversion( 7592private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7610private static bool IsDisallowedNullAssignment(TypeWithState valueState, FlowAnalysisAnnotations targetAnnotations) 7668var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7672parameterWithState = TypeWithState.Create(parameterType.Type, adjustedState); 7695var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7698var worstCaseParameterWithState = applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations); 7759void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7790static TypeWithState applyPostConditionsUnconditionally(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7795return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7801return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7807static TypeWithState applyPostConditionsWhenTrue(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7816return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7820return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7826static TypeWithState applyPostConditionsWhenFalse(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7835return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7839return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 8076if (_walker.TryGetMethodGroupReceiverNullability(group.ReceiverOpt, out TypeWithState receiverType)) 8309private TypeWithState GetAdjustedResult(TypeWithState type, int slot) 8314return TypeWithState.Create(type.Type, state); 8470private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8482private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8492var operandType = VisitRvalueWithState(operand); 8496(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8501Conversion conversion, TypeWithState operandType, 8506return (TypeWithState.Create(targetTypeOpt), visitConversionAsContinuation(expr, useLegacyWarnings, trackMembers, assignmentKind, operand, conversion, operandType)); 8516var resultType = VisitConversion( 8533Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8583ImmutableArray<TypeWithState> elementTypes = arguments.SelectAsArray((a, w) => w.VisitRvalueWithState(a), this); 8588SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 8613SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.NotNull)); 8626ImmutableArray<TypeWithState> types, 8656void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType) 8670private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot) 8764var convertedType = VisitUserDefinedConversion( 8937private TypeWithState VisitConversion( 8942TypeWithState operandType, 8962if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 9046return TypeWithState.Create(targetType, NullableFlowState.NotNull); 9261TypeWithState resultType = calculateResultType(targetTypeWithNullability, fromExplicitCast, resultState, isSuppressed, targetType); 9295static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9307var resultType = TypeWithState.Create(targetType, resultState); 9311static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9345static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9373static NullableFlowState getUnboxingConversionResultState(TypeWithState operandType) 9383static NullableFlowState getConversionResultState(TypeWithState operandType) 9491private TypeWithState VisitUserDefinedConversion( 9496TypeWithState operandType, 9516var resultType = TypeWithState.Create(targetType, NullableFlowState.NotNull); 9548TypeWithState underlyingOperandType = default; 9656private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 9679private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 9684return TypeWithState.Create(type, state); 9687private static TypeWithState GetNullableUnderlyingTypeIfNecessary(bool isLifted, TypeWithState typeWithState) 9700private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 9712private TypeWithState ClassifyAndVisitConversion( 9715TypeWithState operandType, 9790TypeWithState result = setAnalyzedNullability(node, delegateType, analysisCompletion, node.WasTargetTyped); 9794TypeWithState setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped) 9796var result = TypeWithState.Create(delegateType, NullableFlowState.NotNull); 9896var argState = VisitRvalueWithState(arg); 9949private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type) 9964private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type) 9966_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance(); 9973if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 10082var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 10092var typeWithState = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations); 10135TypeWithState rightState; 10158SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10178var rValueType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), annotations); 10187private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState) 10281private BoundNode? VisitDeconstructionAssignmentOperator(BoundDeconstructionAssignmentOperator node, TypeWithState? rightResultOpt) 10311private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null) 10325private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt) 10334var rightResult = ResultType; 10424private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt) 10447TypeWithState operandType; 10448TypeWithState valueType; 10500var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull); 10557private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt) 10597var operandType = VisitRvalueWithState(node.Operand); 10627TypeWithState resultOfOperandConversionType; 10651TypeWithState resultOfIncrementType; 10677TypeWithState resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType; 10702var leftTypeWithState = ResultType; 10710var rightTypeWithState = VisitRvalueWithState(rightConversionOperand); 10713var resultTypeWithState = ReinferAndVisitBinaryOperator( 10766SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 10779private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter) 10883var resultType = ApplyUnconditionalAnnotations(indexer.TypeWithAnnotations.ToTypeWithState(), GetRValueAnnotations(indexer)); 10940var receiverType = (receiverOpt != null) ? VisitRvalueWithState(receiverOpt) : default; 10955var resultType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), memberAnnotations); 10965resultType = TypeWithState.Create(resultType.Type, state); 11069var resultTypeWithState = VisitRvalueWithState(expr); 11134var convertedResult = VisitConversion( 11151TypeWithState currentPropertyGetterTypeWithState; 11192var enumeratorReturnType = GetReturnTypeWithState(reinferredGetEnumeratorMethod); 11248var sourceState = node.EnumeratorInfoOpt == null ? default : ResultType; 11265VisitDeconstructionAssignmentOperator(assignment, sourceState.HasNullType ? (TypeWithState?)null : sourceState); 11279TypeWithState result = sourceState; 11280TypeWithState resultForType = sourceState; 11406TypeWithState resultType; 11438var operandResult = ResultType; 11440var operandType = GetNullableUnderlyingTypeIfNecessary(isLifted, operandResult); 11470TypeWithState adjustForLifting(TypeWithState argumentResult) => 11471TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11512private TypeWithState InferResultNullability(BoundUserDefinedConditionalLogicalOperator node) 11518return TypeWithState.Create(node.Type, NullableFlowState.NotNull); 11536TypeWithState leftType = ResultType; 11580TypeWithState rightType = ResultType; 11592private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType) 11636SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11658SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.MaybeDefault)); 11678SetResultType(node, TypeWithState.ForType(type)); 11718var argumentType = VisitRvalueWithState(node.Operand); 11740SetResultType(node, TypeWithState.Create(type, resultState)); 11772SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 11847if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 11949SetResultType(expression, TypeWithState.Create(expression.Type, default)); 11971private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType) 12015private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result) 12056SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12071SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12120SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12126SetResultType(node, TypeWithState.Create(type, NullableFlowState.NotNull)); 12133var rValueType = TypeWithState.ForType(node.Type); 12155var result = VisitRvalueWithState(expr); 12283Debug.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;