// TARGET_BACKEND: JVM // WITH_STDLIB package test 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" }