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

13 lines
312 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS
fun foo(x: String = "O", vararg y: String): String =
if (y.size == 0) x + "K" else "Fail"
fun call(f: () -> String): String = f()
fun box(): String {
return call(::foo)
}