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:
+1
-8
@@ -116,11 +116,4 @@ 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() = CoroutineSingletons.COROUTINE_SUSPENDED
|
public actual val COROUTINE_SUSPENDED: Any get() = kotlin.coroutines.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
|
|
||||||
private enum class CoroutineSingletons {
|
|
||||||
COROUTINE_SUSPENDED
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -127,3 +127,6 @@ private inline fun <T> createCoroutineFromSuspendFunction(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SinceKotlin("1.3")
|
||||||
|
public actual val COROUTINE_SUSPENDED: Any = CoroutineSingletons.COROUTINE_SUSPENDED
|
||||||
@@ -195,3 +195,12 @@ private inline fun <T> createCoroutineFromSuspendFunction(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This value is used as a return value of [suspendCoroutineOrReturn] `block` argument to state that
|
||||||
|
* the execution was suspended and will not return any result immediately.
|
||||||
|
*/
|
||||||
|
// It is implemented as property with getter to avoid ProGuard <clinit> problem with multifile IntrinsicsKt class
|
||||||
|
@SinceKotlin("1.3")
|
||||||
|
public actual val COROUTINE_SUSPENDED: Any
|
||||||
|
get() = CoroutineSingletons.COROUTINE_SUSPENDED
|
||||||
|
|||||||
@@ -45,12 +45,11 @@ public suspend inline fun <T> suspendCoroutineUninterceptedOrReturn(crossinline
|
|||||||
*/
|
*/
|
||||||
// It is implemented as property with getter to avoid ProGuard <clinit> problem with multifile IntrinsicsKt class
|
// It is implemented as property with getter to avoid ProGuard <clinit> problem with multifile IntrinsicsKt class
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
public val COROUTINE_SUSPENDED: Any
|
public expect val COROUTINE_SUSPENDED: Any
|
||||||
get() = kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
|
||||||
|
|
||||||
// Using enum here ensures two important properties:
|
// 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)
|
// 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
|
// 2. It improves debugging experience, since you clearly see toString() value of those objects and what package they come from
|
||||||
@SinceKotlin("1.3")
|
@SinceKotlin("1.3")
|
||||||
@PublishedApi // This class is Published API via serialized representation of SafeContinuation, don't rename/move
|
@PublishedApi // This class is Published API via serialized representation of SafeContinuation, don't rename/move
|
||||||
internal enum class CoroutineSingletons { UNDECIDED, RESUMED }
|
internal enum class CoroutineSingletons { COROUTINE_SUSPENDED, UNDECIDED, RESUMED }
|
||||||
|
|||||||
+1
@@ -2812,6 +2812,7 @@ public final class kotlin/coroutines/experimental/migration/CoroutinesMigrationK
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class kotlin/coroutines/intrinsics/CoroutineSingletons : java/lang/Enum {
|
public final class kotlin/coroutines/intrinsics/CoroutineSingletons : java/lang/Enum {
|
||||||
|
public static final field COROUTINE_SUSPENDED Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
||||||
public static final field RESUMED Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
public static final field RESUMED Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
||||||
public static final field UNDECIDED Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
public static final field UNDECIDED Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
||||||
public static fun valueOf (Ljava/lang/String;)Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
public static fun valueOf (Ljava/lang/String;)Lkotlin/coroutines/intrinsics/CoroutineSingletons;
|
||||||
|
|||||||
Reference in New Issue
Block a user