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.