@JvmStatic does not carry over other annotations

I have some code like this

class MyURI(private val inner: URI) {
    companion object {
        fun fromString(s: String): MyURI { .... }
    @JsonValue override fun toString() = inner.toString()

These json annotations are from jackson since I’m migrating java to kotlin I don’t feel okay using kotlinx.serialization yet. What I wanted is for the annotations on the fromString function to carry over to the generated static, but it doesn’t seem to be the case.

1 Like