<https://kotlinlang.org/docs/reference/reflection....
# announcements
x
https://kotlinlang.org/docs/reference/reflection.html but how do I search for a method name by annotation, and then exec said method? seems more like this documents method references than true reflection.
a
Copy code
fun main() {
    val x = X()
    x::class.members.first { it.name == "hello" }.call(x, "World")

}

class X {
    fun hello(name: String) {
        println("Hello, $name!")
    }
}
x
yeah, but what if I don’t know the name, I need all methods annotated with @Subscribe
still looks better than java’s painful reflection api
a
I feel like you're not trying...
prove you're trying to solve this and I'll help more
I just looked and starting from my example it took me seconds to find annotations on methods in the IDE.
x
I admit I’m not, I’m exploring the language for purposes of deciding whether I should switch from java
so far the improvements are, null safety, and actual traits, just seeing if reflection for my actuall common use cases is also an improvment
a
I'm not your research assistant. I recommend you download IntelliJ and actually get your hands dirty.
x
well all I’ll say is I had hoped that the documentation would cover this