Add box test for KT-36897

This commit is contained in:
Roman Artemev
2020-10-16 09:20:00 +03:00
parent 5e406e8803
commit 023a62395a
8 changed files with 74 additions and 0 deletions
@@ -0,0 +1,29 @@
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
// IGNORE_BACKEND: JS
import helpers.*
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
// KT-36897
suspend fun foo(str: String) = str
suspend fun test(): String {
return foo("""${foo("O")}${foo("K")}""")
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
var result = "FAIL"
builder {
result = test()
}
return result
}