Files
kotlin-fork/compiler/testData/codegen/box/suspendConversion/basicSuspendConversion.kt
T
Dmitry Petrov d41fc0b599 PSI2IR fix suspend conversion tests
- support chained suspend conversion + SAM conversion
- support suspend conversion in vararg elements
2021-07-17 09:10:19 +03:00

29 lines
502 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: WASM
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo1(f: suspend () -> String) {}
fun foo2(f: suspend (Int) -> String) {}
fun foo3(f: suspend () -> Unit) {}
fun test(
f0: suspend () -> String,
f1: () -> String,
f2: (Int) -> String,
f3: () -> Unit,
) {
foo1 { "str" }
foo1(f0)
foo1(f1)
foo2(f2)
foo3(f3)
}
fun box(): String {
test({ "" }, { "" }, { it.toString() }, {})
return "OK"
}