How to execute a function without a class using reflection, given only a string with its name?
A function is easy to call if it is a member of a class:
“Could not compute caller for function”: How can I call “plus” reflectively?
In function f
I want to sum two values a.x
and b.x
:
Reflection: How to get private field’s value from kotlin companion object?
I want to have an extension that would allow me to get value of private field dataMap
from companion object
for unit tests.
Using Kotlin reflection, how do I set a Kotlin Object’s member property?
I’m trying to use reflection to set a Kotlin Object’s val property. When I try the code below, I get an exception: