次の方法で共有


NullableContext Enum

Definition

Represents the state of the nullable analysis at a specific point in a file. Bits one and two correspond to whether the nullable feature is enabled. Bits three and four correspond to whether the context was inherited from the global context.

This enumeration supports a bitwise combination of its member values.

[System.Flags]
public enum NullableContext
[<System.Flags>]
type NullableContext = 
Public Enum NullableContext
Inheritance
NullableContext
Attributes

Fields

Name Value Description
Disabled 0

Nullable warnings and annotations are explicitly turned off at this location.

WarningsEnabled 1

Nullable warnings are enabled and will be reported at this file location.

AnnotationsEnabled 2

Nullable annotations are enabled and will be shown when APIs defined at this location are used in other contexts.

Enabled 3

The nullable feature is fully enabled.

WarningsContextInherited 4

The nullable warning state is inherited from the project default.

The project default can change depending on the file type. Generated files have nullable off by default, regardless of the project-level default setting.

AnnotationsContextInherited 8

The nullable annotation state is inherited from the project default.

The project default can change depending on the file type. Generated files have nullable off by default, regardless of the project-level default setting.

ContextInherited 12

The current state of both warnings and annotations are inherited from the project default.

This flag is set by default at the start of all files.

The project default can change depending on the file type. Generated files have nullable off by default, regardless of the project-level default setting.

Applies to