jvmname-disambiguate-erased-overloads
Installation
SKILL.md
Two extensions, one JVM method
Kotlin sees two functions here. The JVM sees one:
fun ArrayList<SongsResult>.toListTrack(): ArrayList<Track> { … }
fun ArrayList<VideosResult>.toListTrack(): ArrayList<Track> { … }
An extension function compiles to a static method whose first parameter is the receiver, and a
generic type's argument is erased on the way down. Both become toListTrack(ArrayList), and the
compiler stops with a platform declaration clash, naming both declarations and the one signature
they share.
One annotation on one of the two ends it:
import kotlin.jvm.JvmName