ReturnValueStatus

Represents a status associated with a return type of the callable. This status is used by the 'Unused return value' diagnostic to help it decide whether a warning should be issued.

There are three main sources of this status:

  • Ignorability annotations: @MustUseReturnValues or @IgnorableReturnValue.

  • -Xreturn-value-checker=full compiler flag

  • For overrides, status is copied from the base function unless explicitly changed by annotation.

Note that status is not the only factor to decide whether to report the warning on a particular callable. Checker implementations should also consider other factors, such as the expression's return type or shape. For example, it is typical for Unit-returning functions to have MUST_USE return value status if they were compiled with -Xreturn-value-checker=full compiler flag. However, they should not be reported as unused.

Entries

Link copied to clipboard

Signifies that the corresponding callable does not have status associated with its return value.

Link copied to clipboard

Signifies that the corresponding callable has a must-use status associated with its return value. A compiler might issue a warning if the return value is not used.

Link copied to clipboard

Signifies that the corresponding callable has an explicitly ignorable status associated with its return value. A compiler will not issue a warning if the return value is not used.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.