Files
kotlin-fork/compiler/testData/codegen/box/callableReference/adaptedReferences/bothWithCoercionToUnit.kt
T
2021-10-02 06:14:35 +00:00

17 lines
350 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
fun foo(s: String = "kotlin", vararg t: String): Boolean {
if (s != "kotlin") throw AssertionError(s)
if (t.size != 0) throw AssertionError(t.size.toString())
return true
}
fun bar(f: () -> Unit) {
f()
}
fun box(): String {
bar(::foo)
return "OK"
}