JS: add incremental suspend inline test
This commit is contained in:
+5
@@ -3533,6 +3533,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/incremental/inlineModuleVariable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineSuspendFun.kt")
|
||||
public void testInlineSuspendFun() throws Exception {
|
||||
runTest("js/js.translator/testData/box/incremental/inlineSuspendFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("jsModule.kt")
|
||||
public void testJsModule() throws Exception {
|
||||
runTest("js/js.translator/testData/box/incremental/jsModule.kt");
|
||||
|
||||
+5
@@ -3533,6 +3533,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/incremental/inlineModuleVariable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineSuspendFun.kt")
|
||||
public void testInlineSuspendFun() throws Exception {
|
||||
runTest("js/js.translator/testData/box/incremental/inlineSuspendFun.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("jsModule.kt")
|
||||
public void testJsModule() throws Exception {
|
||||
runTest("js/js.translator/testData/box/incremental/jsModule.kt");
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1295
|
||||
// FILE: a.kt
|
||||
// WITH_RUNTIME
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun bar() = "OK"
|
||||
|
||||
inline suspend fun foo() = bar()
|
||||
|
||||
// FILE: b.kt
|
||||
// RECOMPILE
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun baz() = foo()
|
||||
|
||||
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 {
|
||||
result = baz()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user