52 references to NotNull
Microsoft.CodeAnalysis.CSharp (37)
FlowAnalysis\NullableWalker.cs (25)
797
var badState = symbolType.Type.IsPossiblyNullableReferenceTypeTypeParameter() && (annotations & FlowAnalysisAnnotations.
NotNull
) == 0
1294
var hasNotNull = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
;
1358
bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.NotNullWhenTrue;
1366
bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.NotNullWhenFalse;
2498
bool overridingHasNotNull = (overridingAnnotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
;
2499
bool overriddenHasNotNull = (overriddenAnnotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
;
2564
var unconditionalAnnotationWhenTrue = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenTrue, FlowAnalysisAnnotations.
NotNull
);
2568
var unconditionalAnnotationWhenFalse = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenFalse, FlowAnalysisAnnotations.
NotNull
);
7005
return annotations & (FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
);
7022
bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.NotNullWhenTrue;
7023
bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.NotNullWhenFalse;
7026
annotations &= ~FlowAnalysisAnnotations.
NotNull
;
7064
if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
7084
if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
8046
return FlowAnalysisAnnotations.
NotNull
;
8093
if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
10560
=> ToInwardAnnotations(GetParameterAnnotations(parameter) & ~FlowAnalysisAnnotations.
NotNull
), // NotNull is enforced upon method exit
10596
if ((outwardAnnotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
Symbols\Metadata\PE\PEFieldSymbol.cs (4)
55
Debug.Assert((value & ~(FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull | FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
)) == 0);
61
if ((value & FlowAnalysisAnnotations.
NotNull
) != 0) bitsToSet |= PackedFlags.HasNotNullAttribute;
73
if ((theBits & PackedFlags.HasNotNullAttribute) != 0) value |= FlowAnalysisAnnotations.
NotNull
;
421
if (module.HasAttribute(handle, AttributeDescription.NotNullAttribute)) annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
809
annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
255
if (attributeData.HasNotNullAttribute) annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
176
annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1625
annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
371
result |= FlowAnalysisAnnotations.
NotNull
;
810
if ((annotations & FlowAnalysisAnnotations.
NotNull
) != 0)
Symbols\TypeWithState.cs (2)
52
else if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\LambdaTests.cs (1)
4214
Assert.Equal(FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
, lambdas[0].ReturnTypeFlowAnalysisAnnotations);
Semantics\NullableReferenceTypesTests.cs (14)
20678
VerifyAnnotationsAndMetadata(c, "C.op_Equality",
NotNull
, None);
20724
VerifyAnnotationsAndMetadata(c, "C.op_Equality", None,
NotNull
);
30308
Assert.Equal(FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
, getter.ReturnTypeFlowAnalysisAnnotations);
38608
VerifyAnnotationsAndMetadata(c, "C.MyIsNullOrEmpty", NotNullWhenFalse,
NotNull
);
38637
VerifyAnnotationsAndMetadata(c, "C.MyIsNullOrEmpty",
NotNull
);
38658
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", None,
NotNull
);
38902
VerifyAnnotationsAndMetadata(c, "Interface.ThrowIfNull", None,
NotNull
);
38940
VerifyAnnotationsAndMetadata(c, "Interface.ThrowIfNull", None,
NotNull
);
38973
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", None,
NotNull
);
39217
VerifyAnnotations(c, "C.Bad",
NotNull
);
39218
VerifyAnnotations(c, "C.ThrowIfNull",
NotNull
);
39244
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull",
NotNull
);
39495
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull",
NotNull
, None);
48002
Assert.Equal(FlowAnalysisAnnotations.
NotNull
, getter.ReturnTypeFlowAnalysisAnnotations);