Remove state from parts of multifile classes

Split COROUTINE_SUSPENDED marker to expect and actual because Kotlin/JS backend
expects it to be property without getter.

Update EXPECTED_REACHABLE_NODES in JS test data.

#KT-24986 Fixed
This commit is contained in:
Ilya Gorbunov
2018-06-19 19:04:25 +03:00
parent cffe7fb23b
commit 6d027bbbfc
5 changed files with 44 additions and 10 deletions
@@ -1,4 +1,4 @@
// EXPECTED_REACHABLE_NODES: 1108
// EXPECTED_REACHABLE_NODES: 1221
package foo
@@ -32,3 +32,13 @@ public actual fun <R, T> (suspend R.() -> T).createCoroutineUnchecked(
public actual fun <T> (suspend () -> T).createCoroutineUnchecked(
completion: Continuation<T>
): Continuation<Unit> = this.asDynamic()(completion, true).facade
/**
* 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.
*/
@SinceKotlin("1.1")
public actual val COROUTINE_SUSPENDED: Any = CoroutineSuspendedMarker
private object CoroutineSuspendedMarker
@@ -109,3 +109,12 @@ private inline fun <T> buildContinuationByInvokeCall(
return kotlin.coroutines.experimental.jvm.internal.interceptContinuationIfNeeded(completion.context, continuation)
}
/**
* 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.
*/
@SinceKotlin("1.1")
public actual val COROUTINE_SUSPENDED: Any get() = CoroutineSuspendedMarker
private object CoroutineSuspendedMarker
@@ -10,17 +10,33 @@ package kotlin.math
import kotlin.*
import kotlin.internal.InlineOnly
import kotlin.math.Constants.LN2
import kotlin.math.Constants.taylor_2_bound
import kotlin.math.Constants.taylor_n_bound
import kotlin.math.Constants.upper_taylor_2_bound
import kotlin.math.Constants.upper_taylor_n_bound
import java.lang.Math as nativeMath
private object Constants {
// constants
/** Natural logarithm of 2.0, used to compute [log2] function */
private val LN2: Double = ln(2.0)
/** Natural logarithm of 2.0, used to compute [log2] function */
@JvmField
internal val LN2: Double = ln(2.0)
private val epsilon: Double = nativeMath.ulp(1.0)
private val taylor_2_bound = nativeMath.sqrt(epsilon)
private val taylor_n_bound = nativeMath.sqrt(taylor_2_bound)
private val upper_taylor_2_bound = 1 / taylor_2_bound
private val upper_taylor_n_bound = 1 / taylor_n_bound
@JvmField
internal val epsilon: Double = nativeMath.ulp(1.0)
@JvmField
internal val taylor_2_bound = nativeMath.sqrt(epsilon)
@JvmField
internal val taylor_n_bound = nativeMath.sqrt(taylor_2_bound)
@JvmField
internal val upper_taylor_2_bound = 1 / taylor_2_bound
@JvmField
internal val upper_taylor_n_bound = 1 / taylor_n_bound
}
// ================ Double Math ========================================
@@ -57,5 +57,4 @@ public inline fun <T> Continuation<T>.intercepted(): Continuation<T> =
* the execution was suspended and will not return any result immediately.
*/
@SinceKotlin("1.1")
public val COROUTINE_SUSPENDED: Any = Any()
public expect val COROUTINE_SUSPENDED: Any // get() = CoroutineSuspendedMarker