Files
kotlin-fork/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.kt
T

19 lines
353 B
Kotlin
Vendored

// !LANGUAGE: +UnitConversionsOnArbitraryExpressions +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun interface SuspendRunnable {
suspend fun run()
}
fun foo(r: SuspendRunnable) {}
fun bar(): String = ""
abstract class SubInt : () -> Int
fun test(f: () -> String, s: SubInt) {
foo(f)
foo(s)
foo(::bar)
}