JS: fix suspend lambda inlining

* Also avoid casts when setting inline metadata
This commit is contained in:
Anton Bannykh
2018-10-26 20:27:29 +03:00
parent 4c5201d30e
commit 5dae00182d
5 changed files with 48 additions and 12 deletions
@@ -0,0 +1,27 @@
// EXPECTED_REACHABLE_NODES: 1305
// IGNORE_BACKEND: JS_IR
import kotlin.coroutines.*
suspend inline fun doTwice(block: suspend () -> Unit) {
block()
block()
}
var testResult: String = ""
fun build(c: suspend () -> Unit) {
c.startCoroutine(Continuation<Unit>(EmptyCoroutineContext) { })
}
fun box(): String {
build {
doTwice {
testResult += "OK"
return@build
}
}
return testResult
}