Skip to content

Commit d653ab9

Browse files
authored
Fix documented exception type for Flow.single() (#3741)
require() throws IllegalArgumentException, not IllegalStateException.
1 parent 2e92d58 commit d653ab9

File tree

1 file changed

+1
-1
lines changed
  • kotlinx-coroutines-core/common/src/flow/terminal

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public suspend inline fun <T, R> Flow<T>.fold(
4949

5050
/**
5151
* The terminal operator that awaits for one and only one value to be emitted.
52-
* Throws [NoSuchElementException] for empty flow and [IllegalStateException] for flow
52+
* Throws [NoSuchElementException] for empty flow and [IllegalArgumentException] for flow
5353
* that contains more than one element.
5454
*/
5555
public suspend fun <T> Flow<T>.single(): T {

0 commit comments

Comments
 (0)