// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
class A {
fun foo(s: String = "", vararg xs: Long): CharSequence = "foo"
}
fun check(expected: String, x: Any) {
assertEquals(expected, x.toString())
}
fun coercionToUnit(f: (A, String, LongArray) -> Unit): Any = f
fun varargToElement(f: (A, String, Long, Long) -> CharSequence): Any = f
fun defaultAndVararg(f: (A) -> CharSequence): Any = f
fun allOfTheAbove(f: (A) -> Unit): Any = f
fun box(): String {
check("Function3", coercionToUnit(A::foo))
check("Function4", varargToElement(A::foo))
check("Function1", defaultAndVararg(A::foo))
check("Function1", allOfTheAbove(A::foo))
return "OK"
}