Rob
07/23/2021, 5:48 PMjava.lang.ClassCastException: java.lang.String cannot be cast to com.example.myapplication.MyId
when unwrapping boxed value classes in compose collectAsState
. I'm not sure if this a Compose bug or a Kotlin bug. Where should I report this?Chuck Jazdzewski [G]
07/23/2021, 9:45 PMdata class Box(val myId: MyId)
@JvmInline
value class MyId(val string: String)
fun main(args: Array<String>) = runBlocking {
val foo: MutableStateFlow<Box?> =
MutableStateFlow(Box(MyId("initial")))
foo.map { it?.myId }.collect {
println(it)
}
}
so I would report it to JetBrains.