I don’t know what was wrong. Anybody can explain t...
# getting-started
d
I don’t know what was wrong. Anybody can explain this error?
🧵 2
s
Is this multiplatform code? I think you can only use
synchronized
on JVM
d
aha~ kmm, You mean its target platform is not JVM.
Am I right?
it seems that KMM its target platform is Kotlin/Native
a
Also, you don't need to do this to create a singleton in Kotlin.
💯 1
t
This is the idiomatic way to declare a singleton in Kotlin: https://kotlinlang.org/docs/object-declarations.html#object-declarations-overview
d
I need to control singleton creation point & its constructor params
p
You could still use a singleton object but with a lazy property or lateinit var