Reflection


#1

Are there any current plans for special reflection support? I didn't see anything specific in the documentation. I'd love to be able to do something like this:

var myObject = SomeClass();

myObject.method("doSomething")(arg1, arg2);

var aValue = myObject.field("aField").get();

Forgive the syntax (this hasn’t been thought through at all), but the idea is just to be able to make dynamic method calls without all the pain that Java’s reflection classes impose.


#2

I think that it is not a problem to implement such methods, but not currently yet. Currently, Kotlin have no support of passing array of objects to vararg (need to call class.getMethod(name, argType1, argType2, etc) ).


#3

We are planning to have some Kotlin-specific reflections, but we haven't started working on it yet.