Generate interface property annotations in interface class (not in DefaultImpls)

This commit is contained in:
Michael Bogdanov
2016-09-12 11:47:43 +03:00
parent dfd5be1a33
commit ca41f01468
6 changed files with 52 additions and 10 deletions
@@ -0,0 +1,21 @@
// JVM_TARGET: 1.8
// 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
}