Skip to content

Latest commit

 

History

History
795 lines (569 loc) · 35.9 KB

whatsnew15.md

File metadata and controls

795 lines (569 loc) · 35.9 KB

Release date: 5 May 2021

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.

Language features

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.

JVM records support

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)

Learn more about using JVM records in Kotlin.