Join Slack
Powered by
is there a way to get (and modify during runtime) ...
# getting-started
e
elect
02/26/2024, 1:12 PM
is there a way to get (and modify during runtime) top level getters via reflection?
s
Sam
02/26/2024, 1:29 PM
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
elect
02/26/2024, 1:37 PM
I'd like to do some
monkey-patching
for tests
s
Sam
02/26/2024, 1:40 PM
Sounds like maybe you want to do something like this:
https://mockk.io/#top-level-functions
👍 1
Open in Slack
Previous
Next