Files
kotlin-fork/compiler/testData/codegen/box/callableReference/adaptedReferences/emptyVarargAndDefault.kt
T
Alexander Udalov fa879e667f Add some tests on adapted references with varargs and reflection
Also rename "varargAndDefaults" test directory to "adaptedReferences"
2020-04-08 19:15:40 +02:00

12 lines
290 B
Kotlin
Vendored

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