Kotlin does not support using properties to overri...
# announcements
c
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
Copy code
data class Document(
    val _resourceId: String
) : Resource {
    override fun getResourceId() = _resourceId
}
r
Feel free to add your input to the referenced issue (https://youtrack.jetbrains.com/issue/KT-6653)
f
I did this:
Copy code
@JvmField
    val resourceId: String,
) : Resource {
    override fun getResourceId() = resourceId
and it seems to work. Is that correct?