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

13 lines
317 B
Kotlin
Vendored

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