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

17 lines
413 B
Kotlin
Vendored

// !LANGUAGE: +UnitConversionsOnArbitraryExpressions
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun foo(f: () -> Unit) {}
fun <T> fooGeneric(f: (T) -> Unit): T = TODO()
fun bar(): String = ""
fun createCall(): () -> Int = TODO()
fun test(g: () -> String, h: (Float) -> String) {
foo(::bar)
foo { "something" }
foo(g)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float")!>fooGeneric(h)<!>
}