Files
kotlin-fork/compiler/testData/codegen/box/suspendConversion/suspendConversionWithFunInterfaces.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

25 lines
398 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND: JVM
fun interface SuspendRunnable {
suspend fun invoke()
}
fun foo1(s: SuspendRunnable) {}
fun bar1() {}
fun bar2(s: String = ""): Int = 0
fun bar3() {}
suspend fun bar3(s: String = ""): Int = 0
fun box(): String {
foo1(::bar1)
foo1(::bar2)
foo1(::bar3)
return "OK"
}