Files
kotlin-fork/compiler/testData/codegen/java8/box/jvm8/reflection/propertyAnnotations.kt
T
2017-01-13 13:52:56 +01:00

22 lines
491 B
Kotlin
Vendored

// JVM_TARGET: 1.8
// KOTLIN_CONFIGURATION_FLAGS: +JVM.JVM8_TARGET_WITH_DEFAULTS
// WITH_REFLECT
annotation class Property(val value: String)
annotation class Accessor(val value: String)
interface Z {
@Property("OK")
val z: String;
@Accessor("OK")
get() = "OK"
}
class Test : Z
fun box() : String {
val value = (Z::z.annotations.single() as Property).value
if (value != "OK") return value
return (Z::z.getter.annotations.single() as Accessor).value
}