Kotlin 1.5.0 introduces new language features, stable IR-based JVM compiler backend, performance improvements, and evolutionary changes such as stabilizing experimental features and deprecating outdated ones.
You can also find an overview of the changes in the release blog post.
Kotlin 1.5.0 brings stable versions of the new language features presented for preview in 1.4.30:
Detailed descriptions of these features are available in this blog post and the corresponding pages of Kotlin documentation.
Java is evolving fast, and to make sure Kotlin remains interoperable with it, we've introduced support for one of its latest features – record classes.
Kotlin's support for JVM records includes bidirectional interoperability:
- In Kotlin code, you can use Java record classes like you would use typical classes with properties.
- To use a Kotlin class as a record in Java code, make it a
data
class and mark it with the@JvmRecord
annotation.
@JvmRecord
data class User(val name: String, val age: Int)