Kotlin class that cannot work with Java?

I have a class that implements two interfaces. Each interface has a method w/ the same name, that take a Set. This isn’t an issue in Kotlin b/c it can disambiguate the signatures. But it fails when targeting the JVM in a multi-platform build. The normal solution is to use @JvmName to assign a different name to the methods. However, @JvmName isn’t allowed for open methods.

@JvmName("selectByIndex")             // compile error
override fun select(items: Set<Int>)  // select by index
override fun select(items: Set<Bar>)  // select by object

So is there a solution in this case? This seems like a situation that will happen in projects that leverage libraries with common names. At some point you might have a class that implements two methods that will collide in Java and you aren’t in a position to modify the interfaces/base-classes.

Hello. This code is currently working as designed, however I agree that this may be a problem in some cases. Could you please submit an issue at http://kotl.in/issue with sample code and a description of your use case? Thanks!

Related issue: https://youtrack.jetbrains.com/issue/KT-19444

Done: https://youtrack.jetbrains.com/issue/KT-32032.