110 references to NotNull
Microsoft.CodeAnalysis.CSharp (110)
Binder\Semantics\BestTypeInferrer.cs (1)
38
NullableFlowState result = NullableFlowState.
NotNull
;
FlowAnalysis\NullableWalker.cs (83)
210
private static readonly TypeWithState _invalidType = TypeWithState.Create(new UnsupportedMetadataTypeSymbol(), NullableFlowState.
NotNull
);
1933
return NullableFlowState.
NotNull
;
1966
return NullableFlowState.
NotNull
;
1996
return NullableFlowState.
NotNull
;
2342
case NullableFlowState.
NotNull
:
2714
NullableFlowState.
NotNull
;
2746
/// and the new state is not <see cref="NullableFlowState.
NotNull
"/>, this method should be called to perform the
2754
if (newState != NullableFlowState.
NotNull
&& NonMonotonicState.HasValue)
2935
return TypeWithState.Create(parameterType.Type, NullableFlowState.
NotNull
);
3238
SetState(ref state, slot, NullableFlowState.
NotNull
);
3737
SetResultType(node, TypeWithState.Create(null, NullableFlowState.
NotNull
));
3745
SetResultType(node, TypeWithState.Create(null, NullableFlowState.
NotNull
));
3868
return NullableFlowState.
NotNull
;
3983
Debug.Assert(resultState == NullableFlowState.
NotNull
);
4023
return (-1, NullableFlowState.
NotNull
, inferInitialObjectStateAsContinuation(node, arguments, argumentResults, hasObjectInitializer));
4029
var resultState = NullableFlowState.
NotNull
;
4096
Debug.Assert(resultState == NullableFlowState.
NotNull
);
4230
var result = new VisitResult(objectInitializer.Type, NullableAnnotation.NotAnnotated, NullableFlowState.
NotNull
);
4419
SetAnalyzedNullability(node.ImplicitReceiverOpt, new VisitResult(node.ImplicitReceiverOpt.Type, NullableAnnotation.NotAnnotated, NullableFlowState.
NotNull
));
4476
SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.
NotNull
));
4481
var resultType = TypeWithState.Create(node.Type, NullableFlowState.
NotNull
);
4589
SetResultType(node, TypeWithState.Create(anonymousType, NullableFlowState.
NotNull
));
4621
SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.
NotNull
));
4626
SetResultType(node, TypeWithState.Create(arrayType, NullableFlowState.
NotNull
));
4903
NullableFlowState resultState = NullableFlowState.
NotNull
;
4934
resultState = NullableFlowState.
NotNull
;
5466
SetState(ref stateToUpdate, slot, NullableFlowState.
NotNull
);
5495
SetState(ref state, slot, NullableFlowState.
NotNull
);
5520
if (GetState(ref state, slot) == NullableFlowState.
NotNull
)
5552
SetState(ref state, childSlot, NullableFlowState.
NotNull
);
5631
SetState(ref this.State, leftSlot, NullableFlowState.
NotNull
);
5686
BoundNullCoalescingOperatorResultKind.NoCommonType => (node.Type, NullableFlowState.
NotNull
),
5691
BoundNullCoalescingOperatorResultKind.RightDynamicType => (rightResultType!, NullableFlowState.
NotNull
),
5708
return (rightType, NullableFlowState.
NotNull
);
5713
return (leftType, NullableFlowState.
NotNull
);
5728
TypeWithState.Create(leftType, NullableFlowState.
NotNull
),
5739
return (rightType, NullableFlowState.
NotNull
);
6234
SetResultType(node, TypeWithState.Create(rvalueType, NullableFlowState.
NotNull
));
6583
return NullableFlowState.
NotNull
;
6712
return TypeWithState.Create(typeWithState.Type, NullableFlowState.
NotNull
);
7277
SetState(ref state, memberSlot, NullableFlowState.
NotNull
);
7712
return TypeWithState.Create(typeWithState.Type, NullableFlowState.
NotNull
);
7731
return TypeWithState.Create(typeWithState.Type, NullableFlowState.
NotNull
);
7750
return TypeWithState.Create(typeWithState.Type, NullableFlowState.
NotNull
);
8497
SetResultType(node, TypeWithState.Create(null, NullableFlowState.
NotNull
));
8504
SetState(ref this.State, slot, NullableFlowState.
NotNull
);
8522
SetResultType(node, TypeWithState.Create(tupleOpt, NullableFlowState.
NotNull
));
8644
SetState(ref this.State, targetFieldSlot, NullableFlowState.
NotNull
);
8661
SetState(ref this.State, targetFieldSlot, NullableFlowState.
NotNull
);
8897
NullableFlowState resultState = NullableFlowState.
NotNull
;
8929
resultState = NullableFlowState.
NotNull
;
8953
return TypeWithState.Create(targetType, NullableFlowState.
NotNull
);
8959
resultState = NullableFlowState.
NotNull
;
8963
resultState = NullableFlowState.
NotNull
;
8968
resultState = NullableFlowState.
NotNull
;
9008
resultState = NullableFlowState.
NotNull
;
9132
resultState = NullableFlowState.
NotNull
;
9206
resultState = NullableFlowState.
NotNull
;
9423
var resultType = TypeWithState.Create(targetType, NullableFlowState.
NotNull
);
9703
var result = TypeWithState.Create(delegateType, NullableFlowState.
NotNull
);
9988
var rvalueResult = TypeWithState.Create(node.Type, NullableFlowState.
NotNull
);
10391
var valueBeforeNullableWrapping = TypeWithState.Create(underlyingType.Type, NullableFlowState.
NotNull
);
10867
SetState(ref this.StateWhenTrue, containingSlot, NullableFlowState.
NotNull
);
11085
if (enumeratorReturnType.State != NullableFlowState.
NotNull
)
11166
var state = NullableFlowState.
NotNull
;
11362
TypeWithState.Create(node.Type, node.OperatorKind.IsLifted() ? argumentResult.State : NullableFlowState.
NotNull
);
11409
return TypeWithState.Create(node.Type, NullableFlowState.
NotNull
);
11527
SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.
NotNull
));
11564
SetState(ref this.State, slot, NullableFlowState.
NotNull
);
11610
NullableFlowState resultState = NullableFlowState.
NotNull
;
11663
SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.
NotNull
));
11947
SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.
NotNull
));
11962
SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.
NotNull
));
12011
SetResultType(node, TypeWithState.Create(node.Type, NullableFlowState.
NotNull
));
12017
SetResultType(node, TypeWithState.Create(type, NullableFlowState.
NotNull
));
12085
SetState(ref this.State, slot, NullableFlowState.
NotNull
);
12174
Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.
NotNull
});
12479
SetValue(Id, index, useNotNullsAsDefault ? NullableFlowState.
NotNull
: walker.GetDefaultState(ref this, slot));
12511
return NullableFlowState.
NotNull
;
12520
(false, false) => NullableFlowState.
NotNull
, // Should not be reachable
12523
(true, true) => NullableFlowState.
NotNull
12552
NullableFlowState.
NotNull
=> (true, true),
12606
var oldValue = oldReachable ? GetValue(i) : NullableFlowState.
NotNull
;
FlowAnalysis\NullableWalker_Patterns.cs (2)
481
SetState(ref State, outputSlot, NullableFlowState.
NotNull
);
577
SetState(ref this.State, outputSlot, NullableFlowState.
NotNull
); // Slice value is assumed to be never null
Symbols\ConstraintsHelper.cs (5)
1204
return NullableFlowState.
NotNull
;
1208
return type.IsNullableTypeOrTypeParameter() ? NullableFlowState.MaybeNull : NullableFlowState.
NotNull
;
1215
return NullableFlowState.
NotNull
;
1220
return NullableFlowState.
NotNull
;
1240
if (state == NullableFlowState.
NotNull
)
Symbols\NullableFlowState.cs (1)
11
/// When in doubt we conservatively use <see cref="NullableFlowState.
NotNull
"/>
Symbols\NullableFlowStateExtensions.cs (6)
13
public static bool MayBeNull(this NullableFlowState state) => state != NullableFlowState.
NotNull
;
15
public static bool IsNotNull(this NullableFlowState state) => state == NullableFlowState.
NotNull
;
25
/// The result is <see cref="NullableFlowState.
NotNull
"/> if either operand is that.
32
CSharp.NullableFlowState.
NotNull
=> CodeAnalysis.NullableFlowState.NotNull,
42
CodeAnalysis.NullableFlowState.None => CSharp.NullableFlowState.
NotNull
,
43
CodeAnalysis.NullableFlowState.NotNull => CSharp.NullableFlowState.
NotNull
,
Symbols\TypeWithAnnotations.cs (4)
817
return annotation.IsAnnotated() ? NullableFlowState.MaybeDefault : NullableFlowState.
NotNull
;
821
return annotation switch { NullableAnnotation.Annotated => NullableFlowState.MaybeDefault, NullableAnnotation.NotAnnotated => NullableFlowState.MaybeNull, _ => NullableFlowState.
NotNull
};
825
return annotation switch { NullableAnnotation.Annotated => NullableFlowState.MaybeDefault, _ => NullableFlowState.
NotNull
};
831
return annotation switch { NullableAnnotation.Annotated => NullableFlowState.MaybeNull, _ => NullableFlowState.
NotNull
};
Symbols\TypeWithState.cs (8)
21
public bool IsNotNull => State == NullableFlowState.
NotNull
;
36
var state = defaultState != NullableFlowState.
NotNull
&& type?.CanContainNull() != false ? NullableFlowState.MaybeNull : NullableFlowState.
NotNull
;
54
state = NullableFlowState.
NotNull
;
63
state = NullableFlowState.
NotNull
;
71
Debug.Assert(state == NullableFlowState.
NotNull
|| type?.CanContainNull() != false);
81
public TypeWithState WithNotNullState() => new TypeWithState(Type, NullableFlowState.
NotNull
);
83
public TypeWithState WithSuppression(bool suppress) => suppress ? new TypeWithState(Type, NullableFlowState.
NotNull
) : this;