There isn't really a good way to do this automatically. You'd be better off putting the default values at a higher level that can be referenced by the calling code. This would be a clearer pattern anyway.
i
iseki
12/23/2023, 5:28 PM
Sometimes the default value is written by user and the caller is generated by KSP. That's a problem. Currently generate bytecode directly is almost the only way to achieve that.
j
Javier
12/23/2023, 6:31 PM
Foo().apply { copy(…) }
could be a workaround
👍 1
d
Daniel Pitts
12/24/2023, 4:02 AM
Assuming a data class, that could be one approach.
i
iseki
12/29/2023, 8:15 AM
I edit the issue on YouTrack, now it's more clearly to describe what I want to achieve. Avoid a X-Y problem.