Mmmh… any thoughts why these three attempts to ret...
# announcements
c
Mmmh… any thoughts why these three attempts to retrieve an annotation all fail?
Copy code
class AnnTest(@Json(name = "foo") val n: Int)

fun main(args: Array<String>) {
    AnnTest::class.declaredMemberProperties.forEach {
        val ann = it.findAnnotation<Json>()
        println("Property: $it annotations: $ann")
    }
    AnnTest::class.java.declaredFields.forEach {
        val ann = it.annotations
        println("Property: $it annotations: ${ann.size}")
        val da = it.declaredAnnotations
        println("Property: $it declared annotations: ${da.size}")
    }
}