Files
kotlin-fork/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithReferenceAdaptation.kt
T
Mikhail Zarechenskiy ac642cf175 Support suspend conversion in callable reference adaptation
#KT-15917 In Progress
2020-04-22 16:10:45 +03:00

22 lines
515 B
Kotlin
Vendored

// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun unitCoercion(f: suspend () -> Unit) {}
fun foo(): Int = 0
fun defaults(f: suspend (Int) -> String) {}
fun bar(i: Int, l: Long = 42L): String = ""
fun varargs(f: suspend (Int, Int, Int) -> String) {}
fun baz(vararg ints: Int): String = ""
fun unitCoercionAndDefaults(f: suspend () -> Unit) {}
fun all(s: String = ""): Int = 0
fun test() {
unitCoercion(::foo)
defaults(::bar)
varargs(::baz)
unitCoercionAndDefaults(::all)
}