Usually we can write the following code in kotlin:
val hasValue : Boolean
@JvmName("hasValue") get() = true
This will lead to the creation of a method hasValue()instead getHasValue()for Java interop .
However, in the interface this gives me a compilation error:
val hasValue : Boolean
@JvmName("hasValue") get
The same applies to the following declaration in an abstract class:
abstract val hasValue : Boolean
@JvmName("hasValue") get
So here is my question: how can I tell the kotlin compiler to use properties in the kotlin interfaces hasValue()instead getHasValue()for getters (and setters)?
source
share