Kotlin nullability trouble

here is code:

data class A(
a: String?
)

data class B(
b: String
)

val c = someAInstance.a ?: someBInstance.b // not compiling!!!

Same with IF

This is bug or kotlin is really so strange? Or it could be trouble of kotlin plugin for Intelij Idea..


Ответы (0 шт):