Files
kotlin-fork/compiler/testData/codegen/box/reflection/annotations/spread.kt
T
Ilmir Usmanov 184b5cebe7 Minor. Add regression test for KT-60136
Spread operator works incorrectly in K1, but correctly in K2.
 #KT-60136 Fixed
2023-09-05 15:11:36 +00:00

19 lines
417 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_REFLECT
// IGNORE_BACKEND_K1: JVM, JVM_IR
@Retention(AnnotationRetention.RUNTIME)
annotation class A(vararg val xs: String)
@A(*arrayOf("a"), *arrayOf("b"))
fun test() {}
fun box(): String {
val annotation = ::test.annotations.single() as A
if (!annotation.xs.contentEquals(arrayOf("a", "b"))) return annotation.toString()
return "OK"
}
fun main() {
println(box())
}