// WITH_REFLECT // TARGET_BACKEND: JVM import java.util.Arrays import kotlin.reflect.KClass import kotlin.reflect.KFunction0 inline fun test(kFunction: KFunction0, test: T.() -> Unit) { val annotation = kFunction.annotations.single() as T annotation.test() } fun check(b: Boolean, message: String) { if (!b) throw RuntimeException(message) } annotation class Foo(vararg val a: String = ["a", "b"]) annotation class Bar(vararg val a: KClass<*> = [Int::class]) @Foo(*["/"]) fun test1() {} @Bar(*[Long::class, String::class]) fun test2() {} fun box(): String { test(::test1) { check(a.contentEquals(arrayOf("/")), "Fail 1: ${a.joinToString()}") } test(::test2) { check(a.contentEquals(arrayOf(Long::class, String::class)), "Fail 2: ${a.joinToString()}") } return "OK" }