Introduce redundant enum CoroutineSingletons in experimental.intrinsics
This commit is contained in:
@@ -115,6 +115,11 @@ private inline fun <T> buildContinuationByInvokeCall(
|
|||||||
* the execution was suspended and will not return any result immediately.
|
* the execution was suspended and will not return any result immediately.
|
||||||
*/
|
*/
|
||||||
@SinceKotlin("1.1")
|
@SinceKotlin("1.1")
|
||||||
public actual val COROUTINE_SUSPENDED: Any get() = CoroutineSuspendedMarker
|
public actual val COROUTINE_SUSPENDED: Any get() = CoroutineSingletons.COROUTINE_SUSPENDED
|
||||||
|
|
||||||
private object CoroutineSuspendedMarker
|
// 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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user