We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26e2d88 commit f3bdd56Copy full SHA for f3bdd56
kotlinx-coroutines-core/common/src/flow/terminal/Reduce.kt
@@ -142,7 +142,7 @@ public suspend fun <T> Flow<T>.firstOrNull(): T? {
142
* The terminal operator that returns the first element emitted by the flow and then cancels flow's collection.
143
* Returns [null] if the flow did not contain an element matching the [predicate].
144
*/
145
-public suspend fun <T> Flow<T>.firstOrNull(predicate: suspend (T) -> Boolean): T? {
+public suspend fun <T : Any> Flow<T>.firstOrNull(predicate: suspend (T) -> Boolean): T? {
146
var result: Any? = NULL
147
try {
148
collect { value ->
0 commit comments