110 references to NotNull
Microsoft.CodeAnalysis.CSharp (110)
Binder\Semantics\BestTypeInferrer.cs (1)
38NullableFlowState result = NullableFlowState.NotNull;
FlowAnalysis\NullableWalker.cs (83)
210private static readonly TypeWithState _invalidType = TypeWithState.Create(new UnsupportedMetadataTypeSymbol(), NullableFlowState.NotNull); 1931return NullableFlowState.NotNull; 1964return NullableFlowState.NotNull; 1994return NullableFlowState.NotNull; 2340case NullableFlowState.NotNull: 2712NullableFlowState.NotNull; 2744/// and the new state is not <see cref="NullableFlowState.NotNull"/>, this method should be called to perform the 2752if (newState != NullableFlowState.NotNull && NonMonotonicState.HasValue) 2933return TypeWithState.Create(parameterType.Type, NullableFlowState.NotNull); 3236SetState(ref state, slot, NullableFlowState.NotNull); 3735SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3743SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 3866return NullableFlowState.NotNull; 3980Debug.Assert(resultState == NullableFlowState.NotNull); 4019return (-1, NullableFlowState.NotNull, inferInitialObjectStateAsContinuation(node, arguments, argumentResults)); 4027var resultState = NullableFlowState.NotNull; 4091Debug.Assert(resultState == NullableFlowState.NotNull); 4225var result = new VisitResult(objectInitializer.Type, NullableAnnotation.NotAnnotated, NullableFlowState.NotNull); 4414SetAnalyzedNullability(node.ImplicitReceiverOpt, new VisitResult(node.ImplicitReceiverOpt.Type, NullableAnnotation.NotAnnotated, NullableFlowState.NotNull)); 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)); 4898NullableFlowState resultState = NullableFlowState.NotNull; 4929resultState = NullableFlowState.NotNull; 5461SetState(ref stateToUpdate, slot, NullableFlowState.NotNull); 5490SetState(ref state, slot, NullableFlowState.NotNull); 5515if (GetState(ref state, slot) == NullableFlowState.NotNull) 5547SetState(ref state, childSlot, NullableFlowState.NotNull); 5626SetState(ref this.State, leftSlot, NullableFlowState.NotNull); 5681BoundNullCoalescingOperatorResultKind.NoCommonType => (node.Type, NullableFlowState.NotNull), 5686BoundNullCoalescingOperatorResultKind.RightDynamicType => (rightResultType!, NullableFlowState.NotNull), 5703return (rightType, NullableFlowState.NotNull); 5708return (leftType, NullableFlowState.NotNull); 5723TypeWithState.Create(leftType, NullableFlowState.NotNull), 5734return (rightType, NullableFlowState.NotNull); 6229SetResultType(node, TypeWithState.Create(rvalueType, NullableFlowState.NotNull)); 6578return NullableFlowState.NotNull; 6707return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7266SetState(ref state, memberSlot, NullableFlowState.NotNull); 7701return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7720return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 7739return TypeWithState.Create(typeWithState.Type, NullableFlowState.NotNull); 8486SetResultType(node, TypeWithState.Create(null, NullableFlowState.NotNull)); 8493SetState(ref this.State, slot, NullableFlowState.NotNull); 8511SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.NotNull)); 8633SetState(ref this.State, targetFieldSlot, NullableFlowState.NotNull); 8650SetState(ref this.State, targetFieldSlot, NullableFlowState.NotNull); 8886NullableFlowState resultState = NullableFlowState.NotNull; 8918resultState = NullableFlowState.NotNull; 8942return TypeWithState.Create(targetType, NullableFlowState.NotNull); 8948resultState = NullableFlowState.NotNull; 8952resultState = NullableFlowState.NotNull; 8957resultState = NullableFlowState.NotNull; 8997resultState = NullableFlowState.NotNull; 9121resultState = NullableFlowState.NotNull; 9195resultState = NullableFlowState.NotNull; 9412var resultType = TypeWithState.Create(targetType, NullableFlowState.NotNull); 9692var result = TypeWithState.Create(delegateType, NullableFlowState.NotNull); 9977var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.NotNull); 10380var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.NotNull); 10856SetState(ref this.StateWhenTrue, containingSlot, NullableFlowState.NotNull); 11074if (enumeratorReturnType.State != NullableFlowState.NotNull) 11155var state = NullableFlowState.NotNull; 11351TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.NotNull); 11398return TypeWithState.Create(node.Type, NullableFlowState.NotNull); 11516SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.NotNull)); 11553SetState(ref this.State, slot, NullableFlowState.NotNull); 11599NullableFlowState resultState = NullableFlowState.NotNull; 11652SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 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)); 12074SetState(ref this.State, slot, NullableFlowState.NotNull); 12163Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull }); 12468SetValue(Id, index, useNotNullsAsDefault ? NullableFlowState.NotNull : walker.GetDefaultState(ref this, slot)); 12500return NullableFlowState.NotNull; 12509(false, false) => NullableFlowState.NotNull, // Should not be reachable 12512(true, true) => NullableFlowState.NotNull 12541NullableFlowState.NotNull => (true, true), 12595var oldValue = oldReachable ? GetValue(i) : NullableFlowState.NotNull;
FlowAnalysis\NullableWalker_Patterns.cs (2)
481SetState(ref State, outputSlot, NullableFlowState.NotNull); 577SetState(ref this.State, outputSlot, NullableFlowState.NotNull); // Slice value is assumed to be never null
Symbols\ConstraintsHelper.cs (5)
1204return NullableFlowState.NotNull; 1208return type.IsNullableTypeOrTypeParameter() ? NullableFlowState.MaybeNull : NullableFlowState.NotNull; 1215return NullableFlowState.NotNull; 1220return NullableFlowState.NotNull; 1240if (state == NullableFlowState.NotNull)
Symbols\NullableFlowState.cs (1)
11/// When in doubt we conservatively use <see cref="NullableFlowState.NotNull"/>
Symbols\NullableFlowStateExtensions.cs (6)
13public static bool MayBeNull(this NullableFlowState state) => state != NullableFlowState.NotNull; 15public static bool IsNotNull(this NullableFlowState state) => state == NullableFlowState.NotNull; 25/// The result is <see cref="NullableFlowState.NotNull"/> if either operand is that. 32CSharp.NullableFlowState.NotNull => CodeAnalysis.NullableFlowState.NotNull, 42CodeAnalysis.NullableFlowState.None => CSharp.NullableFlowState.NotNull, 43CodeAnalysis.NullableFlowState.NotNull => CSharp.NullableFlowState.NotNull,
Symbols\TypeWithAnnotations.cs (4)
817return annotation.IsAnnotated() ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull; 821return annotation switch { NullableAnnotation.Annotated => NullableFlowState.MaybeDefault, NullableAnnotation.NotAnnotated => NullableFlowState.MaybeNull, _ => NullableFlowState.NotNull }; 825return annotation switch { NullableAnnotation.Annotated => NullableFlowState.MaybeDefault, _ => NullableFlowState.NotNull }; 831return annotation switch { NullableAnnotation.Annotated => NullableFlowState.MaybeNull, _ => NullableFlowState.NotNull };
Symbols\TypeWithState.cs (8)
21public bool IsNotNull => State == NullableFlowState.NotNull; 36var state = defaultState != NullableFlowState.NotNull && type?.CanContainNull() != false ? NullableFlowState.MaybeNull : NullableFlowState.NotNull; 54state = NullableFlowState.NotNull; 63state = NullableFlowState.NotNull; 71Debug.Assert(state == NullableFlowState.NotNull || type?.CanContainNull() != false); 81public TypeWithState WithNotNullState() => new TypeWithState(Type, NullableFlowState.NotNull); 83public TypeWithState WithSuppression(bool suppress) => suppress ? new TypeWithState(Type, NullableFlowState.NotNull) : this;