MustUseReturnValue

Marks the scope (file or class) in which all the functions are non-ignorable. Kotlin's return value checker would report a warning in case the result of a non-ignorable function call is not used.

This annotation is usually placed by the Kotlin compiler itself when the corresponding 'Return value checker' feature is set to the 'full' mode. There is no need to place it manually except for certain migration scenarios.

This annotation only makes sense when used together with the 'Return value checker' feature. Placing it without enabling the corresponding feature would result in a compiler error.

Please note that this feature is currently experimental and this annotation may be changed without further notice or deprecation cycle. This, in particular, concerns annotation's target list.

Since Kotlin

2.2