Due to KT-8970, I wrap the line with lazy. And it’s ok.
The Inflate is null in debugger, but it’s a object. Why is it?
kotlin("jvm") version "1.5.21"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2")
Why don’t you just put those objects in the companion object? Is there some difference whether they’re inside the class as they are now VS being in the companion object?
You don’t need to call it like XXX.Companion.XXX in Kotlin. And if you call it from Java, you can annotate your member with @JvmStatic, so in Java you can call it also like XXX.XXX.
Ah I see. It seems I had misunderstood your actual problem. It’s about the object declarations in the Companion, not properties. In that case I agree it’s kinda confusing. I guess lazy is the best you can do for now.