With K2 / Js / Serialization, I'm seeing "Generate...
# k2-adopters
o
With K2 / Js / Serialization, I'm seeing "Generated serializer does not have constructor with required number of arguments", which is present in 2.0.0-Beta1, but fixed in 2.0.0-dev-9415. Should I file an issue nonetheless for reference? Details in 🧵
We have KMP, serialization plugin and two modules: "consumer" depends on "producer". Module "producer" contains this class:
Copy code
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient

@Serializable
class Reference<Referenceable> {
    @Transient
    var target: Referenceable? = null
}
Module "consumer" contains this class:
Copy code
import kotlinx.serialization.Serializable

@Serializable
class TreeNode {
    private var parent = Reference<TreeNode>()
}
Then
compileKotlinJs
produces the above error with 2.0.0-Beta1, but not with 2.0.0-dev-9415.
a
Do file an issue. Then proceed to emphasis on the issue that atleast Beta2 should have this fix in place. Thanks for reporting this one
o
@sandwwraith Would filing an issue in the above case make sense for you, even though it's fixed?
s
I think this is the same one as https://youtrack.jetbrains.com/issue/KT-63591
o
So that would be because reflection trips over the same metadata problem as the above case where code is spread across two modules, right?
Hmm, probably not: The above case occurs with Js only, and is fixed earlier (in 2.0.0-dev-9415) than KT-63591 (in 2.0.0-dev-9553).
Filed KT-64250 for reference.