File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ internal expect class SafeCollector<T>(
18
18
internal val collectContext: CoroutineContext
19
19
internal val collectContextSize: Int
20
20
public fun releaseIntercepted ()
21
+ public override suspend fun emit (value : T )
21
22
}
22
23
23
24
@JvmName(" checkContext" ) // For prettier stack traces
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ internal actual class SafeCollector<T> actual constructor(
17
17
internal actual val collectContextSize = collectContext.fold(0 ) { count, _ -> count + 1 }
18
18
private var lastEmissionContext: CoroutineContext ? = null
19
19
20
- override suspend fun emit (value : T ) {
20
+ actual override suspend fun emit (value : T ) {
21
21
val currentContext = currentCoroutineContext()
22
22
currentContext.ensureActive()
23
23
if (lastEmissionContext != = currentContext) {
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ internal actual class SafeCollector<T> actual constructor(
60
60
* then just cache an instance of the completion in order to avoid extra allocation on each emit,
61
61
* making it effectively garbage-free on its hot-path.
62
62
*/
63
- override suspend fun emit (value : T ) {
63
+ actual override suspend fun emit (value : T ) {
64
64
return suspendCoroutineUninterceptedOrReturn sc@{ uCont ->
65
65
try {
66
66
emit(uCont, value)
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ internal actual class SafeCollector<T> actual constructor(
17
17
internal actual val collectContextSize = collectContext.fold(0 ) { count, _ -> count + 1 }
18
18
private var lastEmissionContext: CoroutineContext ? = null
19
19
20
- override suspend fun emit (value : T ) {
20
+ actual override suspend fun emit (value : T ) {
21
21
val currentContext = currentCoroutineContext()
22
22
currentContext.ensureActive()
23
23
if (lastEmissionContext != = currentContext) {
You can’t perform that action at this time.
0 commit comments