is there a way to get (and modify during runtime) ...
# getting-started
e
is there a way to get (and modify during runtime) top level getters via reflection?
s
Can you give an example of what you want to be able to do? You can reflect on a top-level property like this:
Copy code
val foo : String = "foo"
val fooGetter: () -> String = ::foo
But "modify during runtime" sounds more complicated…
e
I'd like to do some monkey-patching for tests
s
Sounds like maybe you want to do something like this: https://mockk.io/#top-level-functions
👍 1