NullableAnnotation Enum

Definition

Represents the nullability of values that can be assigned to an expression used as an lvalue.

C#
public enum NullableAnnotation
Inheritance
NullableAnnotation

Fields

Name Value Description
None 0

The expression has not been analyzed, or the syntax is not an expression (such as a statement).

There are a few different reasons the expression could have not been analyzed:

  1. The symbol producing the expression comes from a method that has not been annotated, such as invoking a C# 7.3 or earlier method, or a method in this compilation that is in a disabled context.
  2. Nullable is completely disabled in this compilation.
NotApplicable 0

The expression has not been analyzed, or the syntax is not an expression (such as a statement).

Disabled 1

The expression comes from a library not updated to C# 8 or nullable was disabled for the definition, and has no nullability information. Analysis is disabled.

NotAnnotated 1

The expression is not annotated (does not have a ?).

Annotated 2

The expression is annotated (does have a ?).

Applies to

Product Versions
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0