Compiling this interface declaration I have the error
Kotlin: Platform declaration clash: The following declarations have the same JVM signature (Function(Lkotlin/jvm/functions/Function1;)V): fun Function(action: (Int) -> Unit): Unit defined in IInterface fun Function(action: (String) -> Unit): Unit defined in IInterface
interface IInterface {
fun Function(action: (Int) -> Unit)
fun Function(action: (String) -> Unit)
}
But when I apply @JvmName attribute a have the error
Kotlin: '@JvmName' annotation is not applicable to this declaration
interface IInterface {
@JvmName("Function1001")
fun Function(action: (Int) -> Unit)
fun Function(action: (String) -> Unit)
}
I've tried change interface to abstract class, but it doesn't help. Looks like @JvmName can be used only on class declaration.
What is the best practice to solve this problem?