I assumed that:
data class Order(val state: String) {
fun isComplete() = (state == "Fulfilled")
}
is the same as:
data class Order(val state: String) {
val isComplete = (state == "Fulfilled")
}
or at least:
data class Order(val state: String) {
val isComplete: Boolean
init {
isComplete = (state == "Fulfilled")
}
}
but they aren’t if it comes to interoperability with Java. Then only the first version works. Rest of them returns null
I thought that I’m doing something wrong but I used also the “java to kotlin” tool to check if this is me misunderstanding something. I checked that against Kotlin version 1.1.2 and 1.1.3 within the android project