The latest version of the Kotlin programming language is now available. Kotlin 1.7.0 includes updates like an alpha version of the K2 compiler, improvements to incremental compilation in Gradle, and more.
In addition to performance improvements, the goal of the new K2 compiler is to speed up development of new features in the language, unify the platforms Kotlin support, and provide an API for compiler extensions. In its current form, it is only available for the JVM and none of the compiler plugins are functional yet.
Incremental compilation now supports cross-module changes, and support for compilation avoided also was improved. According to JetBrains, Kotlin developers who use the build cache or are often making changes in non-Kotlin Gradle modules will see the most benefit from these updates.
Kotlin 1.7.0 also introduces an underscore operator that can be used to automatically infer a type argument when other types have been specified.
As of this release, developers will also be able to utilize implementation by delegation to create lightweight wrappers that usually don’t allocate memory.
This release also brings a number of existing features to “stable” status, including opt-in requirement annotations, definitely non-nullable types, and builder inference.