Kotlin 1.5.0 arrives with JVM records and more as part of six monthly release cadence

Kotlin 1.5.0 arrives with JVM records and more as part of six monthly release cadence

Kotlin 1.5.0 has landed, delivering stable language features such as JVM records and the new default JVM IR compiler. It is also the first one in accordance with the policy announced last year of rolling out a release every six months, instead of being feature driven.

According to the JetBrains Kotlin Blog, many features presented for preview in the 1.4.30 release are now stable features in Kotlin 1.5.0. This includes support for JVM records to remain interoperable with the latest Java feature, which are classes that act as transparent carriers for immutable data. Many new features were also showcased in the Kotlin 1.5.0-RC release candidate, made available last month.

Another improvement is that the sealed modifier works on interfaces the same way it works on classes, while subclasses can be in all files of the same compilation unit and the same package. Previously, all subclasses had to be in the same file with sealed classes.

In this release, the standard library includes stable APIs for unsigned integer types as well as for ranges, progressions, and functions for them. It also added Extension functions for java.nio.file.Path to use the modern non-blocking Java IO in a Kotlin-idiomatic style, said the Kotlin team.

Other improvements include the new locale-agnostic API for changing the case of strings and characters, a set of new functions for conversion between characters and their integer codes and numeric values, and multiplatform support for more char functions.

Meanwhile, the test library has allowed for a single kotlin-test dependency in the common source set of multiplatform projects, and an automatic testing framework has been used for Kotlin/JVM source sets when developers specify only the kotlin-test dependency.

On the JVM side, the updated JVM IR compiler, announced in Kotlin 1.4.0, is stable and has become the default option in 1.5.0.  There is also a new default JVM target, 1.8, with the 1.6 target deprecated. For developers using IntelliJ IDEA or Android Studio, these would suggest updating Kotlin to 1.5.0 automatically, according to JetBrains. For a list of all the changes, readers should check out What’s new in Kotlin 1.5.0.