I have an open Kotlin class with the property of value: String.
open class PropHolder {
open val value: String = ""
}
There is a Java interface with a function String getValue().
public interface Property {
public String getValue();
}
I have a subclass that inherits from the open Kotlin class and implements the Java interface.
class Child : PropHolder(), Property {
override fun getValue() = value
}
Running into a Platform declaration clash between:
- public open fun < get-value >(): String
- public open fun getValue(): String
I've tried:
class Child : PropHolder(), Property {
override val value: String = ""
@JvmName("getHeldValue") get() = field
override fun getValue() = value
}
and:
class Child : PropHolder(), Property {
@JvmName("getPropValue")
override fun getValue() = value
}
But, because these are inherited methods, I can't actually override the JvmName for either.
Is there any way to make this work?