I have two identical inline extension functions on...
# announcements
d
I have two identical inline extension functions on
Collection<...>
. The only difference is one is on
Collection<String>
and the other is
Collection<Closeable>
. IntelliJ complains they have the same signature on JVM (because type erasure). Even though they are inline functions?
s
I asked a related question a while ago and didn’t quite get a satisfactory answer, though I suspect the culprit may be type inference ambiguity https://kotlinlang.slack.com/archives/C0922A726/p1542916167726000?thread_ts=1542916167.726000
d
Hmmm, it's weird how it works on Native but not on JVM. Isn't kotlin supposed to be somewhat consistent?
i
Inline functions are still callable from Java, so that doesn't remove limitations regarding their erased signature. You can use
@JvmName
to give one of them different name for JVM.
d
Oh, okay that'll do.