How does erasure work in Kotlin?

Posted by Jennifer | Updated on

Want does erasure work in Kotlin? Actually Kotlin knows the difference between the two methods in your example, but jvm will not. That’s why it’s a “platform” clash.

You can make your second example compile by using the @JvmName annotation:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers