Fix continuaion retrieval on generated coroutineContext intrinsic code
Use fake continuation instead on real one in JVM BE. Pass continuation parameter to closure generator in JS BE. #KT-22577: Fixed
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
import helpers.*
|
||||
import kotlin.coroutines.experimental.*
|
||||
|
||||
inline fun inlinedLambda(block: () -> Unit) {
|
||||
return block()
|
||||
}
|
||||
|
||||
suspend fun useInlined(): Boolean {
|
||||
inlinedLambda { return coroutineContext === EmptyCoroutineContext }
|
||||
return false
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var res = "FAIL 1"
|
||||
builder {
|
||||
if (useInlined())
|
||||
res = "OK"
|
||||
}
|
||||
if (res != "OK") return res
|
||||
res = "FAIL 2"
|
||||
builder {
|
||||
inlinedLambda {
|
||||
res = if (coroutineContext === EmptyCoroutineContext) "OK" else "FAIL 3"
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user