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) 2276private TypeWithState VisitRvalueWithState(BoundExpression? node) 2320/// This should often be checked together with <seealso cref="IsDisallowedNullAssignment(TypeWithState, FlowAnalysisAnnotations)"/> 2360TypeWithState valueType, 2415static bool isMaybeDefaultValue(TypeWithState valueType) 2452var valueState = GetParameterState( 2491var valueWhen = ApplyUnconditionalAnnotations( 2505static bool isBadAssignment(TypeWithState valueState, TypeWithAnnotations destinationType, FlowAnalysisAnnotations destinationAnnotations) 2583TypeWithState valueType, 2624static bool areEquivalentTypes(TypeWithAnnotations target, TypeWithState assignedValue) => 2910var resultType = VisitOptionalImplicitConversion( 2924internal static TypeWithState GetParameterState(TypeWithAnnotations parameterType, FlowAnalysisAnnotations parameterAnnotations) 2928return TypeWithState.Create(parameterType.Type, NullableFlowState.MaybeDefault); 2933return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull); 2964TypeWithState returnState; 2981var result = VisitRvalueWithState(expr); 3012private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType) 3015TypeWithState resultType = ResultType; 3084SetResultType(node, TypeWithState.ForType(node.Type)); 3453var resultState = ApplyUnconditionalAnnotations(resultType.ToTypeWithState(), GetRValueAnnotations(withExpr.CloneMethod)); 3554TypeWithState valueType; 3603TypeWithState resultType = ResultType; 3613var result = resultType.WithNotNullState(); 3735SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3743SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3756var elementConversionCompletions = ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>>.GetInstance(); 3821var visitResult = new VisitResult(TypeWithState.Create(resultType), resultType, 3827TypeWithState convertCollection(BoundCollectionExpression node, TypeWithAnnotations targetCollectionType, ArrayBuilder<Func<TypeWithAnnotations, TypeWithState>> completions) 3849var resultTypeWithState = TypeWithState.Create(strippedTargetCollectionType, resultState); 3938TypeWithState result = setAnalyzedNullability(node, type, argumentResults, argumentsCompletion, initialStateInferenceCompletion, initializerCompletion, resultState, isTargetTyped); 3942TypeWithState setAnalyzedNullability( 3952var result = TypeWithState.Create(type, resultState); 4311Action<int, Symbol>? visitMemberAssignment(BoundAssignmentOperator node, int containingSlot, Symbol symbol, bool delayCompletionForType, Func<TypeWithAnnotations, TypeWithState>? conversionCompletion = null) 4324(TypeWithState resultType, conversionCompletion) = 4344Action<int, Symbol>? visitMemberAssignmentAsContinuation(BoundAssignmentOperator node, Func<TypeWithAnnotations, TypeWithState> conversionCompletion) 4452TypeWithState.Create(containingType, receiverResult.RValueType.State), 4471SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4476var resultType = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 4584SetResultType(node, TypeWithState.Create(anonymousType, NullableFlowState.NotNull)); 4616SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 4621SetResultType(node, TypeWithState.Create(arrayType, NullableFlowState.NotNull)); 4655var expressionTypes = ArrayBuilder<TypeWithState>.GetInstance(n); 4664var expressionType = VisitRvalueWithState(expressionNoConversion); 4698inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4896private TypeWithState InferResultNullability(BinaryOperatorKind operatorKind, MethodSymbol? methodOpt, TypeSymbol resultType, TypeWithState leftType, TypeWithState rightType) 4908var resultTypeWithState = GetReturnTypeWithState(methodOpt); 4939return TypeWithState.Create(resultType, resultState); 4956var leftType = ResultType; 4983var rightType = VisitRvalueWithState(rightOperand); 5026static bool isKnownNullOrNotNull(BoundExpression expr, TypeWithState resultType) 5061var leftResult = ResultType; 5114SetResult(binary, TypeWithState.ForType(binary.Type), TypeWithAnnotations.Create(binary.Type)); 5122TypeWithState leftType, 5125TypeWithState rightType, 5128var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.OperatorKind, binary.Method, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType); 5132private TypeWithState ReinferAndVisitBinaryOperator( 5140TypeWithState leftType, 5144TypeWithState rightType) 5156TypeWithState leftUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, leftType); 5157TypeWithState rightUnderlyingType = GetNullableUnderlyingTypeIfNecessary(isLifted, rightType); 5173TypeWithState operandType) 5183var resultType = VisitConversion( 5213TypeWithState operandType) 5246var inferredResult = InferResultNullability(operatorKind, method, returnType, leftType, rightType); 5273var leftType = ResultType; 5278var rightType = ResultType; 5632TypeWithState rightResult = VisitOptionalImplicitConversion(rightOperand, targetType, useLegacyWarnings: UseLegacyWarnings(leftOperand), trackMembers: false, AssignmentKind.Assignment); 5637TypeWithState resultType = TypeWithState.Create(targetType.Type, rightResult.State); 5653var rightUnconditionalResult = ResultType; 5656SetResultType(node, TypeWithState.Create(node.Type, rightUnconditionalResult.State)); 5661TypeWithState leftResult = ResultType; 5672TypeWithState rightResult = ResultType; 5690SetResultType(node, TypeWithState.Create(resultType, rightResult.State.Join(leftState))); 5716var conversionResult = VisitConversion( 5723TypeWithState.Create(leftType, NullableFlowState.NotNull), 5755var operandType = ResultType; 5760var result = VisitConversion(boundConversion, 5906SetResultType(node, TypeWithState.Create(resultType, NullableFlowState.MaybeDefault)); 5942TypeWithState consequenceRValue; 5943TypeWithState alternativeRValue; 5982SetResult(node, TypeWithState.Create(refResultType, rValueState), TypeWithAnnotations.Create(refResultType, lValueAnnotation)); 6046SetResultType(node, TypeWithState.Create(resultType, default)); 6057TypeWithState typeWithState = convertArms( 6064TypeWithState convertArms( 6066TypeWithState consequenceRValue, TypeWithState alternativeRValue, BoundExpression consequence, Conversion consequenceConversion, bool consequenceEndReachable, 6072TypeWithState convertedConsequenceResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6081TypeWithState convertedAlternativeResult = ConvertConditionalOperandOrSwitchExpressionArmResult( 6091var typeWithState = TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6104return TypeWithState.Create(resultTypeWithAnnotations.Type, resultState); 6114TypeWithState consequenceRValue, 6115TypeWithState alternativeRValue, 6133(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand) 6146(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand) 6163private TypeWithState ConvertConditionalOperandOrSwitchExpressionArmResult( 6168TypeWithState operandType, 6185var resultType = VisitConversion( 6229SetResultType(node, TypeWithState.Create(rvalueType, NullableFlowState.NotNull)); 6255TypeWithState receiverType = visitAndCheckReceiver(node); 6295TypeWithState receiverType = visitAndCheckReceiver(node); 6323TypeWithState visitAndCheckReceiver(BoundCall node) 6325TypeWithState receiverType = default; 6336void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null) 6355var returnState = GetReturnTypeWithState(method); 6366private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results) 6502void learnFromEqualsMethodArguments(BoundExpression left, TypeWithState leftType, BoundExpression right, TypeWithState rightType) 6603private void CheckCallReceiver(BoundExpression? receiverOpt, TypeWithState receiverType, MethodSymbol method) 6631private TypeWithState GetReturnTypeWithState(MethodSymbol method) 6633return TypeWithState.Create(method.ReturnTypeWithAnnotations, GetRValueAnnotations(method)); 6703private static TypeWithState ApplyUnconditionalAnnotations(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 6707return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 6712return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7020TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 7419var resultType = result.RValueType; 7437var stateAfterConversion = VisitConversion( 7492private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7510private static bool IsDisallowedNullAssignment(TypeWithState valueState, FlowAnalysisAnnotations targetAnnotations) 7568var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7572parameterWithState = TypeWithState.Create(parameterType.Type, adjustedState); 7595var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7598var worstCaseParameterWithState = applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations); 7659void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7690static TypeWithState applyPostConditionsUnconditionally(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7695return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7701return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7707static TypeWithState applyPostConditionsWhenTrue(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7716return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7720return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7726static TypeWithState applyPostConditionsWhenFalse(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7735return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7739return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7976if (_walker.TryGetMethodGroupReceiverNullability(group.ReceiverOpt, out TypeWithState receiverType)) 8209private TypeWithState GetAdjustedResult(TypeWithState type, int slot) 8214return TypeWithState.Create(type.Type, state); 8368private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8380private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8390var operandType = VisitRvalueWithState(operand); 8394(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8399Conversion conversion, TypeWithState operandType, 8404return (TypeWithState.Create(targetTypeOpt), visitConversionAsContinuation(expr, useLegacyWarnings, trackMembers, assignmentKind, operand, conversion, operandType)); 8414var resultType = VisitConversion( 8431Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8481ImmutableArray<TypeWithState> elementTypes = arguments.SelectAsArray((a, w) => w.VisitRvalueWithState(a), this); 8486SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 8511SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.NotNull)); 8524ImmutableArray<TypeWithState> types, 8554void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType) 8568private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot) 8662var convertedType = VisitUserDefinedConversion( 8835private TypeWithState VisitConversion( 8840TypeWithState operandType, 8860if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 8942return TypeWithState.Create(targetType, NullableFlowState.NotNull); 9157TypeWithState resultType = calculateResultType(targetTypeWithNullability, fromExplicitCast, resultState, isSuppressed, targetType); 9191static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9203var resultType = TypeWithState.Create(targetType, resultState); 9207static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9241static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9269static NullableFlowState getUnboxingConversionResultState(TypeWithState operandType) 9279static NullableFlowState getConversionResultState(TypeWithState operandType) 9387private TypeWithState VisitUserDefinedConversion( 9392TypeWithState operandType, 9412var resultType = TypeWithState.Create(targetType, NullableFlowState.NotNull); 9444TypeWithState underlyingOperandType = default; 9552private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 9575private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 9580return TypeWithState.Create(type, state); 9583private static TypeWithState GetNullableUnderlyingTypeIfNecessary(bool isLifted, TypeWithState typeWithState) 9596private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 9608private TypeWithState ClassifyAndVisitConversion( 9611TypeWithState operandType, 9686TypeWithState result = setAnalyzedNullability(node, delegateType, analysisCompletion, node.WasTargetTyped); 9690TypeWithState setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped) 9692var result = TypeWithState.Create(delegateType, NullableFlowState.NotNull); 9792var argState = VisitRvalueWithState(arg); 9845private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type) 9860private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type) 9862_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance(); 9869if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 9977var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 9987var typeWithState = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations); 10016TypeWithState rightState; 10039SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10059var rValueType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), annotations); 10068private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState) 10162private BoundNode? VisitDeconstructionAssignmentOperator(BoundDeconstructionAssignmentOperator node, TypeWithState? rightResultOpt) 10192private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null) 10206private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt) 10215var rightResult = ResultType; 10304private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt) 10327TypeWithState operandType; 10328TypeWithState valueType; 10380var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull); 10437private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt) 10477var operandType = VisitRvalueWithState(node.Operand); 10507TypeWithState resultOfOperandConversionType; 10531TypeWithState resultOfIncrementType; 10557TypeWithState resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType; 10582var leftTypeWithState = ResultType; 10590var rightTypeWithState = VisitRvalueWithState(rightConversionOperand); 10593var resultTypeWithState = ReinferAndVisitBinaryOperator( 10646SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 10659private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter) 10763var resultType = ApplyUnconditionalAnnotations(indexer.TypeWithAnnotations.ToTypeWithState(), GetRValueAnnotations(indexer)); 10820var receiverType = (receiverOpt != null) ? VisitRvalueWithState(receiverOpt) : default; 10835var resultType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), memberAnnotations); 10845resultType = TypeWithState.Create(resultType.Type, state); 10949var resultTypeWithState = VisitRvalueWithState(expr); 11014var convertedResult = VisitConversion( 11031TypeWithState currentPropertyGetterTypeWithState; 11072var enumeratorReturnType = GetReturnTypeWithState(reinferredGetEnumeratorMethod); 11128var sourceState = node.EnumeratorInfoOpt == null ? default : ResultType; 11145VisitDeconstructionAssignmentOperator(assignment, sourceState.HasNullType ? (TypeWithState?)null : sourceState); 11159TypeWithState result = sourceState; 11160TypeWithState resultForType = sourceState; 11286TypeWithState resultType; 11318var operandResult = ResultType; 11320var operandType = GetNullableUnderlyingTypeIfNecessary(isLifted, operandResult); 11350TypeWithState adjustForLifting(TypeWithState argumentResult) => 11351TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11392private TypeWithState InferResultNullability(BoundUserDefinedConditionalLogicalOperator node) 11398return TypeWithState.Create(node.Type, NullableFlowState.NotNull); 11416TypeWithState leftType = ResultType; 11460TypeWithState rightType = ResultType; 11472private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType) 11516SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11538SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.MaybeDefault)); 11558SetResultType(node, TypeWithState.ForType(type)); 11598var argumentType = VisitRvalueWithState(node.Operand); 11620SetResultType(node, TypeWithState.Create(type, resultState)); 11652SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 11727if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 11829SetResultType(expression, TypeWithState.Create(expression.Type, default)); 11851private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType) 11895private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result) 11936SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11951SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12000SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12006SetResultType(node, TypeWithState.Create(type, NullableFlowState.NotNull)); 12013var rValueType = TypeWithState.ForType(node.Type); 12035var result = VisitRvalueWithState(expr); 12163Debug.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;