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;
313 references to TypeWithState
Microsoft.CodeAnalysis.CSharp (313)
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 (288)
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); 7254TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 7665var resultType = result.RValueType; 7683var stateAfterConversion = VisitConversion( 7738private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7756private static bool IsDisallowedNullAssignment(TypeWithState valueState, FlowAnalysisAnnotations targetAnnotations) 7814var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7818parameterWithState = TypeWithState.Create(parameterType.Type, adjustedState); 7841var parameterWithState = TypeWithState.Create(parameterType, parameterAnnotations); 7844var worstCaseParameterWithState = applyPostConditionsUnconditionally(parameterWithState, parameterAnnotations); 7905void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7936static TypeWithState applyPostConditionsUnconditionally(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7941return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7947return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7953static TypeWithState applyPostConditionsWhenTrue(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7962return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7966return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7972static TypeWithState applyPostConditionsWhenFalse(TypeWithState typeWithState, FlowAnalysisAnnotations annotations) 7981return TypeWithState.Create(typeWithState.Type, NullableFlowState.MaybeDefault); 7985return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 8227if (_walker.TryGetMethodGroupReceiverNullability(group.ReceiverOpt, out TypeWithState receiverType)) 8493private TypeWithState GetAdjustedResult(TypeWithState type, int slot) 8498return TypeWithState.Create(type.Type, state); 8653private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8665private (TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) VisitOptionalImplicitConversion( 8675var operandType = VisitRvalueWithState(operand); 8679(TypeWithState resultType, Func<TypeWithAnnotations, TypeWithState>? completion) visitConversion( 8684Conversion conversion, TypeWithState operandType, 8689return (TypeWithState.Create(targetTypeOpt), visitConversionAsContinuation(expr, useLegacyWarnings, trackMembers, assignmentKind, operand, conversion, operandType)); 8699var resultType = VisitConversion( 8716Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8766ImmutableArray<TypeWithState> elementTypes = arguments.SelectAsArray((a, w) => w.VisitRvalueWithState(a), this); 8771SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 8796SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.NotNull)); 8809ImmutableArray<TypeWithState> types, 8839void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType) 8853private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot) 8947var convertedType = VisitUserDefinedConversion( 9120private TypeWithState VisitConversion( 9125TypeWithState operandType, 9145if (TargetTypedAnalysisCompletion.TryGetValue(conversionOperand, out Func<TypeWithAnnotations, TypeWithState>? completion)) 9227return TypeWithState.Create(targetType, NullableFlowState.NotNull); 9442TypeWithState resultType = calculateResultType(targetTypeWithNullability, fromExplicitCast, resultState, isSuppressed, targetType); 9476static TypeWithState calculateResultType(TypeWithAnnotations targetTypeWithNullability, bool fromExplicitCast, NullableFlowState resultState, bool isSuppressed, TypeSymbol targetType) 9488var resultType = TypeWithState.Create(targetType, resultState); 9492static NullableFlowState getReferenceConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9526static NullableFlowState getBoxingConversionResultState(TypeWithAnnotations targetType, TypeWithState operandType) 9554static NullableFlowState getUnboxingConversionResultState(TypeWithState operandType) 9564static NullableFlowState getConversionResultState(TypeWithState operandType) 9672private TypeWithState VisitUserDefinedConversion( 9677TypeWithState operandType, 9697var resultType = TypeWithState.Create(targetType, NullableFlowState.NotNull); 9729TypeWithState underlyingOperandType = default; 9837private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 9860private TypeWithState GetLiftedReturnType(TypeWithAnnotations returnType, NullableFlowState operandState) 9865return TypeWithState.Create(type, state); 9868private static TypeWithState GetNullableUnderlyingTypeIfNecessary(bool isLifted, TypeWithState typeWithState) 9881private TypeWithState GetLiftedReturnTypeIfNecessary(bool isLifted, TypeWithAnnotations returnType, NullableFlowState operandState) 9893private TypeWithState ClassifyAndVisitConversion( 9896TypeWithState operandType, 9971TypeWithState result = setAnalyzedNullability(node, delegateType, analysisCompletion, node.WasTargetTyped); 9975TypeWithState setAnalyzedNullability(BoundDelegateCreationExpression node, NamedTypeSymbol delegateType, Action<NamedTypeSymbol>? analysisCompletion, bool isTargetTyped) 9977var result = TypeWithState.Create(delegateType, NullableFlowState.NotNull); 10077var argState = VisitRvalueWithState(arg); 10130private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type) 10145private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type) 10147_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance(); 10156if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 10274var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 10284var typeWithState = GetParameterState(parameterType, parameter.FlowAnalysisAnnotations); 10327TypeWithState rightState; 10350SetResult(node, TypeWithState.Create(leftLValueType.Type, rightState.State), leftLValueType); 10370var rValueType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), annotations); 10379private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState) 10473private BoundNode? VisitDeconstructionAssignmentOperator(BoundDeconstructionAssignmentOperator node, TypeWithState? rightResultOpt) 10503private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null) 10517private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt) 10526var rightResult = ResultType; 10618private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt) 10641TypeWithState operandType; 10642TypeWithState valueType; 10694var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull); 10751private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt) 10791var operandType = VisitRvalueWithState(node.Operand); 10830TypeWithState resultOfOperandConversionType; 10854TypeWithState resultOfIncrementType; 10880TypeWithState resultType = (op == UnaryOperatorKind.PrefixIncrement || op == UnaryOperatorKind.PrefixDecrement) ? resultOfIncrementType : operandType; 10901var leftTypeWithState = ResultType; 10909var rightTypeWithState = VisitRvalueWithState(rightConversionOperand); 10939var resultTypeWithState = ReinferAndVisitBinaryOperator( 10992SetResultType(node.Expression, TypeWithState.Create(node.Expression.Type, ResultType.State)); 11005private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter) 11096TypeWithState typeWithState = ApplyUnconditionalAnnotations(typeWithAnnotations.ToTypeWithState(), memberAnnotations); 11139var resultType = ApplyUnconditionalAnnotations(indexer.TypeWithAnnotations.ToTypeWithState(), GetRValueAnnotations(indexer)); 11197var receiverType = (receiverOpt != null) ? VisitRvalueWithState(receiverOpt) : default; 11212var resultType = ApplyUnconditionalAnnotations(type.ToTypeWithState(), memberAnnotations); 11222resultType = TypeWithState.Create(resultType.Type, state); 11326var resultTypeWithState = VisitRvalueWithState(expr); 11391var convertedResult = VisitConversion( 11408TypeWithState currentPropertyGetterTypeWithState; 11449var enumeratorReturnType = GetReturnTypeWithState(reinferredGetEnumeratorMethod); 11505var sourceState = node.EnumeratorInfoOpt == null ? default : ResultType; 11522VisitDeconstructionAssignmentOperator(assignment, sourceState.HasNullType ? (TypeWithState?)null : sourceState); 11536TypeWithState result = sourceState; 11537TypeWithState resultForType = sourceState; 11663TypeWithState resultType; 11695var operandResult = ResultType; 11697var operandType = GetNullableUnderlyingTypeIfNecessary(isLifted, operandResult); 11727TypeWithState adjustForLifting(TypeWithState argumentResult) => 11728TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11769private TypeWithState InferResultNullability(BoundUserDefinedConditionalLogicalOperator node) 11775return TypeWithState.Create(node.Type, NullableFlowState.NotNull); 11793TypeWithState leftType = ResultType; 11837TypeWithState rightType = ResultType; 11849private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType) 11893SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11915SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.MaybeDefault)); 11935SetResultType(node, TypeWithState.ForType(type)); 11975var argumentType = VisitRvalueWithState(node.Operand); 11997SetResultType(node, TypeWithState.Create(type, resultState)); 12029SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 12104if (TryGetMethodGroupReceiverNullability(receiverOpt, out TypeWithState receiverType)) 12206SetResultType(expression, TypeWithState.Create(expression.Type, default)); 12228private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType) 12272private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result) 12313SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12328SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12377SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 12383SetResultType(node, TypeWithState.Create(type, NullableFlowState.NotNull)); 12390var rValueType = TypeWithState.ForType(node.Type); 12412var result = VisitRvalueWithState(expr); 12540Debug.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;