From d653ab9b021716959df9f5b694cb5e92c1834840 Mon Sep 17 00:00:00 2001 From: lukellmann <47486203+lukellmann@users.noreply.github.com> Date: Mon, 8 May 2023 11:28:32 +0200 Subject: [PATCH] Fix documented exception type for Flow.single() (#3741) require() throws IllegalArgumentException, not IllegalStateException. --- kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt b/kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt index 1794c9f41c..557c095ade 100644 --- a/kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt +++ b/kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt @@ -49,7 +49,7 @@ public suspend inline fun <T, R> Flow<T>.fold( /** * The terminal operator that awaits for one and only one value to be emitted. - * Throws [NoSuchElementException] for empty flow and [IllegalStateException] for flow + * Throws [NoSuchElementException] for empty flow and [IllegalArgumentException] for flow * that contains more than one element. */ public suspend fun <T> Flow<T>.single(): T {