https://kotlinlang.org logo
#k2-early-adopters
Title
# k2-early-adopters
o

Oliver.O

12/04/2023, 5:01 PM
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

andylamax

12/08/2023, 1:56 AM
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

Oliver.O

12/11/2023, 7:24 PM
@sandwwraith Would filing an issue in the above case make sense for you, even though it's fixed?
s

sandwwraith

12/11/2023, 7:33 PM
I think this is the same one as https://youtrack.jetbrains.com/issue/KT-63591
o

Oliver.O

12/11/2023, 7:49 PM
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.