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 |
Answered by
ZacSweers
May 2, 2022
Replies: 1 comment 1 reply
|
No, kotlinpoet is for generating new source files, not IR transformations (which is what kotlinx-serialization leverages). |
1 reply
Answer selected by
ZacSweers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, kotlinpoet is for generating new source files, not IR transformations (which is what kotlinx-serialization leverages).