Make experimental/release COROUTINE_SUSPENDED reference the same instance

It's necessary when mixing experimental/release coroutines together

 #KT-25683 In Progress
This commit is contained in:
Denis Zharkov
2018-08-20 13:40:46 +03:00
parent db34555800
commit 20c7a97bcd
@@ -47,11 +47,11 @@ public suspend inline fun <T> suspendCoroutineUninterceptedOrReturn(crossinline
// It is implemented as property with getter to avoid ProGuard <clinit> problem with multifile IntrinsicsKt class
@SinceKotlin("1.3")
public val COROUTINE_SUSPENDED: Any
get() = CoroutineSingletons.COROUTINE_SUSPENDED
get() = kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
// Using enum here ensures two important properties:
// 1. It makes SafeContinuation serializable with all kinds of serialization frameworks (since all of them natively support enums)
// 2. It improves debugging experience, since you clearly see toString() value of those objects and what package they come from
@SinceKotlin("1.3")
@PublishedApi // This class is Published API via serialized representation of SafeContinuation, don't rename/move
internal enum class CoroutineSingletons { COROUTINE_SUSPENDED, UNDECIDED, RESUMED }
internal enum class CoroutineSingletons { UNDECIDED, RESUMED }