Skip to content

Commit 88f7edb

Browse files
committed
update: implementing small additional review comments
1 parent 4dd5624 commit 88f7edb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/topics/unused-return-value-checker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ It has the following modes:
5151

5252
* `disable` disables the unused return value checker. (Default)
5353
* `check` enables the checker, and reports warnings for ignored results from [marked functions](#mark-functions-to-check-ignored-results).
54-
* `full` enables the checker, and treats all functions in your project as [marked](#mark-functions-to-check-ignored-results) and reports warnings for ignored results.
54+
* `full` enables the checker, treats all functions in your project as [marked](#mark-functions-to-check-ignored-results), and reports warnings for ignored results.
5555

5656
> All marked functions are propagated as such, and ignored results are reported if the checker is enabled in projects that use your code as a dependency.
5757
>
@@ -129,7 +129,7 @@ fun someFunction(): Int = ...
129129

130130
## Suppress reports for ignored results
131131

132-
You can suppress reports on specific functions by marking them with the [`@IgnorableReturnValue`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-ignorable-return-value/) annotation.
132+
You can suppress reports on specific functions by annotating them with [`@IgnorableReturnValue`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-ignorable-return-value/).
133133
Annotate functions where ignoring the result is common and expected, such as `MutableList.add`:
134134

135135
```kotlin
@@ -139,7 +139,7 @@ fun <T> MutableList<T>.addAndIgnoreResult(element: T): Boolean {
139139
}
140140
```
141141

142-
You can suppress a warning without marking the function itself.
142+
You can suppress a warning without annotating the function itself.
143143
To do this, assign the result to a special unnamed variable with an underscore syntax (`_`):
144144

145145
```kotlin
@@ -161,7 +161,7 @@ fun main() {
161161
When you override a function, the override inherits the reporting rules defined by the annotations on the base declaration.
162162
This also applies when the base declaration is part of the Kotlin standard library or of other library dependencies, so the checker reports ignored results for overrides of functions like `Any.hashCode()`.
163163

164-
Additionally, you can't override a class or interface marked with `@IgnorableReturnValue` with one that [requires its return values to be used](#mark-functions-to-check-ignored-results).
164+
Additionally, you can't override a function marked with `@IgnorableReturnValue` with one that [requires its return value to be used](#mark-functions-to-check-ignored-results).
165165
However, you can mark an override with `@IgnorableReturnValue` in a class or interface annotated with `@MustUseReturnValues` when its result can be safely ignored:
166166

167167
```kotlin

0 commit comments

Comments
 (0)