https://kotlinlang.org logo
Title
r

ribesg

04/04/2019, 9:51 AM
Can I get the receiver type name from a
KProperty1<*, *>
?
Maybe
parameters.first()
?
d

diesieben07

04/04/2019, 9:54 AM
instanceParameter?.type
r

ribesg

04/04/2019, 9:55 AM
I don’t see
instanceParameter
on
KProperty1
d

diesieben07

04/04/2019, 9:55 AM
You need the full reflection
r

ribesg

04/04/2019, 9:55 AM
Meh
d

diesieben07

04/04/2019, 9:57 AM
prop.javaGetter?.declaringClass
can work, too
That should not require the full reflection
r

ribesg

04/04/2019, 9:58 AM
I need both the property name and the receiver type name, I thought using
KProperty1
could give me both. If not, then I can jsute have the receiver type name passed as a String
d

diesieben07

04/04/2019, 9:58 AM
name
should also be available without full reflection
r

ribesg

04/04/2019, 10:15 AM
Well I need the same for a function and I need full reflection for that it seems
d

diesieben07

04/04/2019, 10:17 AM
No. You should be able to call
name
on a
KFunction
even without full reflection
r

ribesg

04/04/2019, 10:18 AM
I need to pass a parameter of type
KFunction1
in this case because I also need to call it, and it does’t look like I can even import it