Skip to content

Commit

Permalink
Mark the ignoreRemainingEventsException as SharedImmutable so it …
Browse files Browse the repository at this point in the history
…can be used from different threads on iOS.
  • Loading branch information
PaulWoitaschek authored and JakeWharton committed Jun 3, 2021
1 parent 4a4535f commit 56e2224
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commonMain/kotlin/app/cash/turbine/FlowTurbine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package app.cash.turbine

import kotlin.native.concurrent.SharedImmutable
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
import kotlinx.coroutines.CancellationException
Expand Down Expand Up @@ -177,6 +178,7 @@ public interface FlowTurbine<T> {
public suspend fun expectError(): Throwable
}

@SharedImmutable
private val ignoreRemainingEventsException = CancellationException("Ignore remaining events")

public sealed class Event<out T> {
Expand Down

1 comment on commit 56e2224

@fabiosanto
Copy link

@fabiosanto fabiosanto commented on 56e2224 Jun 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this guys 👍 I encountered this yesterday having kotlin.native.IncorrectDereferenceException when testing against iOS with Kotlin Multiplatform.
Thank you

Please sign in to comment.