diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index 73e4e944b87..364a269e5f8 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -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"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java index 8f928b7cae7..652d1725643 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/IrBoxJsTestGenerated.java @@ -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"); diff --git a/js/js.translator/testData/box/incremental/inlineSuspendFun.kt b/js/js.translator/testData/box/incremental/inlineSuspendFun.kt new file mode 100644 index 00000000000..6c84c2530fd --- /dev/null +++ b/js/js.translator/testData/box/incremental/inlineSuspendFun.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 { + override val context = EmptyCoroutineContext + + override fun resumeWith(result: Result) {} + }) +} + +fun box(): String { + var result = "" + + builder { + result = baz() + } + + return result +}