@@ -61,14 +61,14 @@ public fun <T1, T2, R> Flow<T1>.combineLatest(other: Flow<T2>, transform: suspen
61
61
onReceive(firstIsClosed, firstChannel, { firstIsClosed = true }) { value ->
62
62
firstValue = value
63
63
if (secondValue != = null ) {
64
- emit(transform(NullSurrogate .unbox(firstValue), NullSurrogate .unbox(secondValue)))
64
+ emit(transform(NULL .unbox(firstValue), NULL .unbox(secondValue)))
65
65
}
66
66
}
67
67
68
68
onReceive(secondIsClosed, secondChannel, { secondIsClosed = true }) { value ->
69
69
secondValue = value
70
70
if (firstValue != = null ) {
71
- emit(transform(NullSurrogate .unbox(firstValue), NullSurrogate .unbox(secondValue)))
71
+ emit(transform(NULL .unbox(firstValue), NULL .unbox(secondValue)))
72
72
}
73
73
}
74
74
}
@@ -163,7 +163,7 @@ internal fun <T, R> Flow<T>.combineLatest(vararg others: Flow<T>, arrayFactory:
163
163
if (latestValues.all { it != = null }) {
164
164
val arguments = arrayFactory()
165
165
for (index in 0 until size) {
166
- arguments[index] = NullSurrogate .unbox(latestValues[index])
166
+ arguments[index] = NULL .unbox(latestValues[index])
167
167
}
168
168
emit(transform(arguments as Array <T >))
169
169
}
@@ -191,7 +191,7 @@ private inline fun SelectBuilder<Unit>.onReceive(
191
191
private fun CoroutineScope.asFairChannel (flow : Flow <* >): ReceiveChannel <Any > = produce {
192
192
val channel = channel as ChannelCoroutine <Any >
193
193
flow.collect { value ->
194
- channel.sendFair(value ? : NullSurrogate )
194
+ channel.sendFair(value ? : NULL )
195
195
}
196
196
}
197
197
@@ -235,8 +235,8 @@ public fun <T1, T2, R> Flow<T1>.zip(other: Flow<T2>, transform: suspend (T1, T2)
235
235
if (! otherIterator.hasNext()) {
236
236
return @consumeEach
237
237
}
238
- val secondValue = NullSurrogate .unbox<T2 >(otherIterator.next())
239
- emit(transform(NullSurrogate .unbox(value), NullSurrogate .unbox(secondValue)))
238
+ val secondValue = NULL .unbox<T2 >(otherIterator.next())
239
+ emit(transform(NULL .unbox(value), NULL .unbox(secondValue)))
240
240
}
241
241
} catch (e: AbortFlowException ) {
242
242
// complete
@@ -249,6 +249,6 @@ public fun <T1, T2, R> Flow<T1>.zip(other: Flow<T2>, transform: suspend (T1, T2)
249
249
// Channel has any type due to onReceiveOrNull. This will be fixed after receiveOrClosed
250
250
private fun CoroutineScope.asChannel (flow : Flow <* >): ReceiveChannel <Any > = produce {
251
251
flow.collect { value ->
252
- channel.send(value ? : NullSurrogate )
252
+ channel.send(value ? : NULL )
253
253
}
254
254
}
0 commit comments