Make experimental COROUTINE_SUSPENDED refer to corresponding release one

Partially reverts commit 20c7a97.
Apply workaround for KT-25003 once again for the new COROUTINE_SUSPENDED
This commit is contained in:
Ilya Gorbunov
2018-08-31 20:54:46 +03:00
parent e22ca022d4
commit df9f77909b
5 changed files with 16 additions and 11 deletions
@@ -116,11 +116,4 @@ private inline fun <T> buildContinuationByInvokeCall(
* the execution was suspended and will not return any result immediately.
*/
@SinceKotlin("1.1")
public actual val COROUTINE_SUSPENDED: Any get() = CoroutineSingletons.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
private enum class CoroutineSingletons {
COROUTINE_SUSPENDED
}
public actual val COROUTINE_SUSPENDED: Any get() = kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED