Files
kotlin/compiler/testData/codegen/box/callableReference/varargAndDefaults/bothWithCoercionToUnit.kt
2019-11-19 11:00:09 +03:00

19 lines
402 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS
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"
}