Add companion object to existing class #1245
-
Is it possible to add a companion object to an existing class - i.e. a class that was written manually and not with KotlinPoet? I've seen in the docs that it's possible to add a companion object to a generated class but it doesn't mention if it's possible to attach to an existing one. kotlinx.serialization has some way of adding generating a companion object with its |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, kotlinpoet is for generating new source files, not IR transformations (which is what kotlinx-serialization leverages). |
Beta Was this translation helpful? Give feedback.
No, kotlinpoet is for generating new source files, not IR transformations (which is what kotlinx-serialization leverages).