9 references to CanContainNull
Microsoft.CodeAnalysis.CSharp (9)
Binder\Binder_Operators.cs (1)
3437
operandType.
CanContainNull
() && // a non-nullable value type is never null
Binder\DecisionDagBuilder.cs (1)
437
if (input.Type.
CanContainNull
() &&
FlowAnalysis\NullableWalker.cs (3)
5394
private static bool PossiblyNullableType([NotNullWhen(true)] TypeSymbol? operandType) => operandType?.
CanContainNull
() == true;
11541
if (type.
CanContainNull
())
11591
SetResultType(node, TypeWithState.Create(node.Type, node.Type?.
CanContainNull
() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull));
Symbols\TypeWithState.cs (4)
36
var state = defaultState != NullableFlowState.NotNull && type?.
CanContainNull
() != false ? NullableFlowState.MaybeNull : NullableFlowState.NotNull;
46
if (type.
CanContainNull
())
71
Debug.Assert(state == NullableFlowState.NotNull || type?.
CanContainNull
() != false);
94
(State.IsNotNull() || Type?.
CanContainNull
() == false ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated);