How to annotate data class to get DefaultArgumentInterop for copy function? #29
-
Default Arguments feature is disabled by default and docs suggest to enable it only on functions where it is needed due to performace issues: https://skie.touchlab.co/features/defaultparams The question is how to enable it on single Kotlin
Currently I didn't come up with better solution than write own implementation of "copy" function that can be annotated:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi! Yeah, that's an oversight. Unfortunately, I don't think we can quickly fix this. The current implementation for annotation configuration is quite limited in its capabilities, so adding support for this use case is not as simple as just allowing the annotation to be used with classes. We want to reimplement it but haven't gotten to it yet. Before we add proper support, a workaround might be to use the Gradle configuration and use the fully qualified name of the class in the group name. However, that will select all functions in that class, so you might need to add the suppress annotations to other functions (if that is a problem in your case). |
Beta Was this translation helpful? Give feedback.
-
I created the following issue to track this problem: #30 |
Beta Was this translation helpful? Give feedback.
Hi! Yeah, that's an oversight.
Unfortunately, I don't think we can quickly fix this. The current implementation for annotation configuration is quite limited in its capabilities, so adding support for this use case is not as simple as just allowing the annotation to be used with classes. We want to reimplement it but haven't gotten to it yet.
Before we add proper support, a workaround might be to use the Gradle configuration and use the fully qualified name of the class in the group name. However, that will select all functions in that class, so you might need to add the suppress annotations to other functions (if that is a problem in your case).