Hello, how to deal with default argument "during r...
# getting-started
i
d
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
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
Foo().apply { copy(…) }
could be a workaround
👍 1
d
Assuming a data class, that could be one approach.
i
I edit the issue on YouTrack, now it's more clearly to describe what I want to achieve. Avoid a X-Y problem.
👍 1