Skip to content

Commit 0d860b2

Browse files
Updated firstOrNull w/o arguments with Any lower bound
1 parent 8da2124 commit 0d860b2

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
@@ -125,7 +125,7 @@ public suspend fun <T> Flow<T>.first(predicate: suspend (T) -> Boolean): T {
125125
* The terminal operator that returns the first element emitted by the flow and then cancels flow's collection.
126126
* Returns [null] if the flow was empty.
127127
*/
128-
public suspend fun <T> Flow<T>.firstOrNull(): T? {
128+
public suspend fun <T : Any> Flow<T>.firstOrNull(): T? {
129129
var result: Any? = NULL
130130
try {
131131
collect { value ->

0 commit comments

Comments
 (0)