what about `@JvmOverloads` on interface methods?
# language-proposals
e
what about
@JvmOverloads
on interface methods?
l
Use case? (see topic of this channel)
e
a random use-case
Copy code
fun sameLine(localPosX: Int) = sameLine(localPosX, 1)

fun sameLine(localPosX: Int, spacingW: Int) = sameLine(localPosX.f, spacingW.f)

fun sameLine() = sameLine(0f, -1f)

fun sameLine(localPosX: Float = 0f, spacingW: Float = -1f)
l
The use case is not so clear IMHO, because it's plain code that I'm unfamiliar with. Looking as is, I'm wondering why you would have all these methods in the same interface, and why you would want to have overloads for the JVM so java can use them.
e
I think it dont make sense to have an use case here because
@JvmOverloads
is pretty self-explanatory
I'd like to smooth the experience on the java side
p
What do you expect to be generated when
@JvmOverloads
is used on interface method? Overloaded methods with implementation? So class that implements this interface will be able to override all these methods?
e
same as using default arguments at the moment
so, full method I recall
l
The problem is that it has implications on binary compatibility, and also creates a different interface on JVM compared to the non JVM (JS or native) version.