Files
kotlin/compiler/testData/codegen/box/annotations/annotatedAnnotationParameter.kt
Alexander Udalov dc1f4c7d5b Generate get-targeted annotations on annotation constructor parameters
This change would also make NotNull annotations to be generated on
non-primitive annotation methods, but we skip this deliberately because
annotation methods never return null on JVM anyway

 #KT-25287 Fixed
2018-08-30 14:56:40 +03:00

19 lines
433 B
Kotlin
Vendored

// 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
}