robstoll
12/30/2018, 11:40 PMinterface I1{ fun foo(f: (Int) -> Int) }
interface I2{ fun foo(f: (String) -> String) }
class A: I1, I2{
override fun foo(f: (Int) -> Int){}
override fun foo(f: (String)-> String){} //same JVM signature
}
Pavlo Liapota
12/30/2018, 11:52 PM@JvmName
will help?
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-name/index.htmlhudsonb
12/31/2018, 12:11 AM@JvmName
could be used as a work around (I havent tried it). We need a @Mangle
annotation or something that will mangle it for us on the Java side when we don't care about being callable from the Java side of things.Czar
12/31/2018, 7:48 AMinterface I1 {
fun foo(l: (Int) -> Int): Int
}
interface I2 {
fun foo(l: (String) -> String): String
}
class A : I1, I2 {
override fun foo(l: (Int) -> Int): Int = l(1)
override fun foo(l: (String) -> String): String = l("a")
}
fun test() {
println(A().foo { p: Int -> p * 2 })
println(A().foo { p: String -> p + p })
}
I guess problem is only there if the return type is the same.robstoll
12/31/2018, 9:22 AM