52 references to NotNull
Microsoft.CodeAnalysis.CSharp (37)
FlowAnalysis\NullableWalker.cs (25)
822var badState = symbolType.Type.IsPossiblyNullableReferenceTypeTypeParameter() && (annotations & FlowAnalysisAnnotations.NotNull) == 0 1319var hasNotNull = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull; 1383bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenTrue; 1391bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenFalse; 2524bool overridingHasNotNull = (overridingAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull; 2525bool overriddenHasNotNull = (overriddenAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull; 2590var unconditionalAnnotationWhenTrue = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenTrue, FlowAnalysisAnnotations.NotNull); 2594var unconditionalAnnotationWhenFalse = makeUnconditionalAnnotationCore(annotations, FlowAnalysisAnnotations.NotNullWhenFalse, FlowAnalysisAnnotations.NotNull); 7109return annotations & (FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull); 7126bool hasNotNullWhenTrue = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenTrue; 7127bool hasNotNullWhenFalse = (annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNullWhenFalse; 7130annotations &= ~FlowAnalysisAnnotations.NotNull; 7168if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 7188if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 8145return FlowAnalysisAnnotations.NotNull; 8192if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull) 10714=> ToInwardAnnotations(GetParameterAnnotations(parameter) & ~FlowAnalysisAnnotations.NotNull), // NotNull is enforced upon method exit 10750if ((outwardAnnotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull)
Symbols\Metadata\PE\PEFieldSymbol.cs (4)
55Debug.Assert((value & ~(FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull | FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull)) == 0); 61if ((value & FlowAnalysisAnnotations.NotNull) != 0) bitsToSet |= PackedFlags.HasNotNullAttribute; 73if ((theBits & PackedFlags.HasNotNullAttribute) != 0) value |= FlowAnalysisAnnotations.NotNull; 421if (module.HasAttribute(handle, AttributeDescription.NotNullAttribute)) annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
811annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
256if (attributeData.HasNotNullAttribute) annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
180annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1637annotations |= FlowAnalysisAnnotations.NotNull;
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
371result |= FlowAnalysisAnnotations.NotNull; 810if ((annotations & FlowAnalysisAnnotations.NotNull) != 0)
Symbols\TypeWithState.cs (2)
52else if ((annotations & FlowAnalysisAnnotations.NotNull) == FlowAnalysisAnnotations.NotNull)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\LambdaTests.cs (1)
4214Assert.Equal(FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull, lambdas[0].ReturnTypeFlowAnalysisAnnotations);
Semantics\NullableReferenceTypesTests.cs (14)
20678VerifyAnnotationsAndMetadata(c, "C.op_Equality", NotNull, None); 20724VerifyAnnotationsAndMetadata(c, "C.op_Equality", None, NotNull); 30312Assert.Equal(FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull, getter.ReturnTypeFlowAnalysisAnnotations); 38612VerifyAnnotationsAndMetadata(c, "C.MyIsNullOrEmpty", NotNullWhenFalse, NotNull); 38641VerifyAnnotationsAndMetadata(c, "C.MyIsNullOrEmpty", NotNull); 38662VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", None, NotNull); 38906VerifyAnnotationsAndMetadata(c, "Interface.ThrowIfNull", None, NotNull); 38944VerifyAnnotationsAndMetadata(c, "Interface.ThrowIfNull", None, NotNull); 38977VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", None, NotNull); 39221VerifyAnnotations(c, "C.Bad", NotNull); 39222VerifyAnnotations(c, "C.ThrowIfNull", NotNull); 39248VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", NotNull); 39499VerifyAnnotationsAndMetadata(c, "C.ThrowIfNull", NotNull, None); 48006Assert.Equal(FlowAnalysisAnnotations.NotNull, getter.ReturnTypeFlowAnalysisAnnotations);