I have a problem with getting getter annotation fr...
# announcements
m
I have a problem with getting getter annotation from property reference. Here is annotation:
Copy code
class A {
    @get:Arg val a: Int by BoundToValueDelegateProvider()
}
Inside
provideDelegate
I have property reference
Copy code
operator fun provideDelegate(
        thisRef: Any?,
        prop: KProperty<*>
): ReadWriteProperty<Any, T> {
    val annotation1 = prop.getter.findAnnotation<Arg>() // This is null
    val annotation2 = prop.javaGetter?.getAnnotation(Arg::class.java) // This is null too
    // ...
}
It this bug or expected behavior?
d
Are you sure the annotation has runtime retention?
m
This problem was excisting in Kotlin 1.1.0, and it is working well in v 1.1.4-2. Nevertheless thanks for help 🙂