We are observing an issue in Kotlin JS 1.9.24 as f...
# javascript
p
We are observing an issue in Kotlin JS 1.9.24 as follows. Is this expected behavior??? We are using this in React with kotlin-wrappers
Copy code
open class MyKeyClass {
    val key: String  = "key"
}

data class MyCollectionClass(
    var valueA: String? = null
) : MyKeyClass()

data class MyParentClass(
    var myList: MutableList<MyCollectionClass> = mutableListOf(MyCollectionClass())
)

data class MyRootClass( var myProp : MyParentClass? = null)

val myRootProp = MyRootClass( myProp = MyParentClass())

println(myRootProp)
The print out of IN JVM is
MyRootClass(myProp=MyParentClass(myList=[MyCollectionClass(valueA=null)]))
The JS eqivalent is missing default declared collection having single value
expected Collection [MyCollectionClass(valueA=null)])
i
Hi! On the playground I see the same behaviour for JS and JVM https://pl.kotl.in/3YfoMLR4m Is the issue persists with Kotlin 2.0? Can you please create an YT issue with minimal reproducer project.
p
Yes we use Kotlin 1.9.24 for both JVM and JS. I used IntelliJ with scratch pad and was able to see expected result MyRootClass(myProp=MyParentClass(myList=[MyCollectionClass(valueA=null)]))