https://kotlinlang.org logo
Title
c

Casey Brooks

12/05/2018, 5:25 PM
Kotlin does not support using properties to override Java getter/setter methods, and likely never will (see this SO comment https://stackoverflow.com/a/47454364/2469169 for more context). You should be able to override it just as a method, mapping it to a differently-named Kotlin property
data class Document(
    val _resourceId: String
) : Resource {
    override fun getResourceId() = _resourceId
}
r

Ruckus

12/05/2018, 5:26 PM
Feel free to add your input to the referenced issue (https://youtrack.jetbrains.com/issue/KT-6653)
f

fabricio

12/05/2018, 5:27 PM
I did this:
@JvmField
    val resourceId: String,
) : Resource {
    override fun getResourceId() = resourceId
and it seems to work. Is that correct?