[K/JS] Fix autoboxing for inlined function ^KT-60785 Fixed

This commit is contained in:
Artem Kobzar
2023-08-11 09:19:51 +00:00
committed by Space Team
parent 7ae443ad7f
commit 4dc0d68288
7 changed files with 77 additions and 6 deletions
@@ -0,0 +1,35 @@
// WITH_STDLIB
// EXPECTED_REACHABLE_NODES: 1292
// KT-60785
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
value class SomeValue(val a: String) {
override fun toString() = when (a) {
"fa" -> "O"
"il" -> "K"
else -> ""
}
}
suspend fun foo() = mapOf(SomeValue("fa") to SomeValue("il"))
fun builder(c: suspend () -> Unit) {
c.startCoroutine(object : Continuation<Unit> {
override val context = EmptyCoroutineContext
override fun resumeWith(result: Result<Unit>) {}
})
}
fun box(): String {
var result = ""
builder {
for ((k, v) in foo()) {
result += "$k$v"
}
}
return result
}