From 627af332b19e15f875c63bd9cf2932f88048ac84 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Tue, 3 Aug 2021 16:15:42 +0300 Subject: [PATCH] [JS IR] Use PublishedApi for intrinsic ^KT-46204 fixed --- .../src/kotlin/coroutines_13/IntrinsicsJs.kt | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libraries/stdlib/js-ir/src/kotlin/coroutines_13/IntrinsicsJs.kt b/libraries/stdlib/js-ir/src/kotlin/coroutines_13/IntrinsicsJs.kt index 0fcef920ef0..453f862d3b5 100644 --- a/libraries/stdlib/js-ir/src/kotlin/coroutines_13/IntrinsicsJs.kt +++ b/libraries/stdlib/js-ir/src/kotlin/coroutines_13/IntrinsicsJs.kt @@ -7,7 +7,10 @@ package kotlin.coroutines.intrinsics -import kotlin.coroutines.* +import kotlin.coroutines.Continuation +import kotlin.coroutines.ContinuationInterceptor +import kotlin.coroutines.CoroutineContext +import kotlin.coroutines.CoroutineImpl import kotlin.internal.InlineOnly /** @@ -16,8 +19,8 @@ import kotlin.internal.InlineOnly * necessary to call it in special way, not in synamic way */ @Suppress("UNUSED_PARAMETER", "unused") -@SinceKotlin("1.5") -public fun (suspend () -> T).invokeSuspendSuperType( +@PublishedApi +internal fun (suspend () -> T).invokeSuspendSuperType( completion: Continuation ): Any? { throw NotImplementedError("It is intrinsic method") @@ -29,8 +32,8 @@ public fun (suspend () -> T).invokeSuspendSuperType( * necessary to call it in special way, not in synamic way */ @Suppress("UNUSED_PARAMETER", "unused") -@SinceKotlin("1.5") -public fun (suspend R.() -> T).invokeSuspendSuperTypeWithReceiver( +@PublishedApi +internal fun (suspend R.() -> T).invokeSuspendSuperTypeWithReceiver( receiver: R, completion: Continuation ): Any? { @@ -43,8 +46,8 @@ public fun (suspend R.() -> T).invokeSuspendSuperTypeWithReceiver( * necessary to call it in special way, not in synamic way */ @Suppress("UNUSED_PARAMETER", "unused") -@SinceKotlin("1.5") -public fun (suspend R.(P) -> T).invokeSuspendSuperTypeWithReceiverAndParam( +@PublishedApi +internal fun (suspend R.(P) -> T).invokeSuspendSuperTypeWithReceiverAndParam( receiver: R, param: P, completion: Continuation @@ -64,7 +67,7 @@ public fun (suspend R.(P) -> T).invokeSuspendSuperTypeWithReceiverAndP * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of a suspended * coroutine using a reference to the suspending function. */ -@SinceKotlin("1.5") +@SinceKotlin("1.3") @InlineOnly public actual inline fun (suspend () -> T).startCoroutineUninterceptedOrReturn( completion: Continuation @@ -86,7 +89,7 @@ public actual inline fun (suspend () -> T).startCoroutineUninterceptedOrRetu * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of a suspended * coroutine using a reference to the suspending function. */ -@SinceKotlin("1.5") +@SinceKotlin("1.3") @InlineOnly public actual inline fun (suspend R.() -> T).startCoroutineUninterceptedOrReturn( receiver: R, @@ -124,7 +127,7 @@ internal actual inline fun (suspend R.(P) -> T).startCoroutineUninterc * Repeated invocation of any resume function on the resulting continuation corrupts the * state machine of the coroutine and may result in arbitrary behaviour or exception. */ -@SinceKotlin("1.5") +@SinceKotlin("1.3") public actual fun (suspend () -> T).createCoroutineUnintercepted( completion: Continuation ): Continuation = @@ -150,7 +153,7 @@ public actual fun (suspend () -> T).createCoroutineUnintercepted( * Repeated invocation of any resume function on the resulting continuation corrupts the * state machine of the coroutine and may result in arbitrary behaviour or exception. */ -@SinceKotlin("1.5") +@SinceKotlin("1.3") public actual fun (suspend R.() -> T).createCoroutineUnintercepted( receiver: R, completion: Continuation @@ -164,7 +167,7 @@ public actual fun (suspend R.() -> T).createCoroutineUnintercepted( /** * Intercepts this continuation with [ContinuationInterceptor]. */ -@SinceKotlin("1.5") +@SinceKotlin("1.3") public actual fun Continuation.intercepted(): Continuation = (this as? CoroutineImpl)?.intercepted() ?: this