49 references to NotNull
Microsoft.CodeAnalysis.CSharp (34)
FlowAnalysis\NullableWalker.cs (22)
748
var badState = symbolType.Type.IsPossiblyNullableReferenceTypeTypeParameter() && (annotations & FlowAnalysisAnnotations.
NotNull
) == 0
1159
var hasNotNull = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
;
1223
bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.NotNullWhenTrue;
1231
bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.NotNullWhenFalse;
2333
bool overridingHasNotNull = (overridingAnnotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
;
2334
bool overriddenHasNotNull = (overriddenAnnotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
;
2399
var unconditionalAnnotationWhenTrue = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenTrue, FlowAnalysisAnnotations.
NotNull
);
2403
var unconditionalAnnotationWhenFalse = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenFalse, FlowAnalysisAnnotations.
NotNull
);
6006
return annotations & (FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
);
6039
if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
6059
if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
6796
return FlowAnalysisAnnotations.
NotNull
;
6843
if ((annotations & FlowAnalysisAnnotations.
NotNull
) == FlowAnalysisAnnotations.
NotNull
)
9154
=> ToInwardAnnotations(GetParameterAnnotations(parameter) & ~FlowAnalysisAnnotations.
NotNull
), // NotNull is enforced upon method exit
9190
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
;
419
if (module.HasAttribute(handle, AttributeDescription.NotNullAttribute)) annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
792
annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
254
if (attributeData.HasNotNullAttribute) annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
169
annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1184
annotations |= FlowAnalysisAnnotations.
NotNull
;
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
371
result |= FlowAnalysisAnnotations.
NotNull
;
775
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)
4199
Assert.Equal(FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
, lambdas[0].ReturnTypeFlowAnalysisAnnotations);
Semantics\NullableReferenceTypesTests.cs (14)
20639
VerifyAnnotationsAndMetadata(c, "C.op_Equality",
NotNull
, None);
20685
VerifyAnnotationsAndMetadata(c, "C.op_Equality", None,
NotNull
);
28370
Assert.Equal(FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.
NotNull
, getter.ReturnTypeFlowAnalysisAnnotations);
36542
VerifyAnnotationsAndMetadata(c, "C.MyIsNullOrEmpty", NotNullWhenFalse,
NotNull
);
36571
VerifyAnnotationsAndMetadata(c, "C.MyIsNullOrEmpty",
NotNull
);
36592
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", None,
NotNull
);
36836
VerifyAnnotationsAndMetadata(c, "Interface.ThrowIfNull", None,
NotNull
);
36874
VerifyAnnotationsAndMetadata(c, "Interface.ThrowIfNull", None,
NotNull
);
36907
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", None,
NotNull
);
37151
VerifyAnnotations(c, "C.Bad",
NotNull
);
37152
VerifyAnnotations(c, "C.ThrowIfNull",
NotNull
);
37178
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull",
NotNull
);
37429
VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull",
NotNull
, None);
45881
Assert.Equal(FlowAnalysisAnnotations.
NotNull
, getter.ReturnTypeFlowAnalysisAnnotations);