csharpstandard
csharpstandard copied to clipboard
[Nullable Reference Types] Compiler directives for nullable reference types
Specify the compiler directive #nullable that controls the interpretation of reference types and nullability. The effect of the directives is as follows:
-
#nullable disable: Sets the nullable annotation and warning contexts to disabled. -
#nullable enable: Sets the nullable annotation and warning contexts to enabled. -
#nullable restore: Restores the nullable annotation and warning contexts to project settings. -
#nullable disable annotations: Sets the nullable annotation context to disabled. -
#nullable enable annotations: Sets the nullable annotation context to enabled. -
#nullable restore annotations: Restores the nullable annotation context to project settings. -
#nullable disable warnings: Sets the nullable warning context to disabled. -
#nullable enable warnings: Sets the nullable warning context to enabled. -
#nullable restore warnings: Restores the nullable warning context to project settings.
In addition, the spec should define the behavior of reference types in those contexts.