https://kotlinlang.org logo
#announcements
Title
# announcements
m

mibac

04/29/2017, 5:14 PM
Hello! How can I get `KCallable`'s all parameters' types? (I need a Java's
Class
)
stackoverflow 1
s

snrostov

04/29/2017, 5:56 PM
mibac:
Copy code
kCallable.parameters.forEach { 
            it.javaClass
        }
m

mibac

04/29/2017, 5:58 PM
That returns a
KParameter
. I want a
Class
. Do you know how can I achieve that?
s

snrostov

04/29/2017, 6:00 PM
Ah... sorry Something like this:
Copy code
kCallable.parameters.forEach {
            (it.type.classifier as KClass<*>).java
        }
m

mibac

04/29/2017, 6:02 PM
Thanks!
2 Views