Add tests for default inline suspend lambdas
Broken on JVM and JVM_IR
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
// SKIP_INLINE_CHECK_IN: bar$default
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JVM, JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_IR, JVM_MULTI_MODULE_OLD_AGAINST_IR, JVM_MULTI_MODULE_IR_AGAINST_OLD
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline block: suspend (String) -> String = { it }): suspend () -> String =
|
||||
{ block("OK") }
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
suspend {
|
||||
result = bar()()
|
||||
}.startCoroutine(EmptyContinuation)
|
||||
return result
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// SKIP_INLINE_CHECK_IN: bar$default
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JVM, JVM_IR
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_IR, JVM_MULTI_MODULE_OLD_AGAINST_IR, JVM_MULTI_MODULE_IR_AGAINST_OLD
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
suspend fun foo(x: String) = x
|
||||
|
||||
inline fun bar(crossinline block: suspend (String) -> String = ::foo): suspend () -> String =
|
||||
{ block("OK") }
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
suspend {
|
||||
result = bar()()
|
||||
}.startCoroutine(EmptyContinuation)
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user