Files
kotlin/compiler/testData/codegen/box/annotations/annotatedAnnotationParameter.kt
2019-11-19 11:00:09 +03:00

20 lines
463 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
import kotlin.test.assertEquals
annotation class Name(val value: String)
annotation class Anno(
@get:Name("O") val o: String,
@get:Name("K") val k: String
)
fun box(): String {
val ms = Anno::class.java.declaredMethods
return (ms.single { it.name == "o" }.annotations.single() as Name).value +
(ms.single { it.name == "k" }.annotations.single() as Name).value
}