Paul Krill
Editor at Large

Kotlin 1.6.20 arrives with better Java class interop

news
Apr 5, 20222 mins

Latest update to the versatile language from JetBrains offers improvements for JVM, JavaScript, and native development.

intel coffee lake figurative image java
Credit: Amenic181 / Thinkstock

JetBrains has released Kotlin 1.6.20, a new release of the Kotlin language that features better interoperability with generic Java classes as well as faster build times. Some features cited in the release are still in preview form.

Improved interoperability with generic Java classes and interfaces was enabled through the inclusion of definitely non-nullable types, a feature currently in a beta stage. Kotlin 1.6.20 allows developers to mark a generic type parameter as definitely non-nullable using the new syntax, T & Any.

To improve build times, an experimental JVM IR back-end mode compiles all files in a module in parallel. This can reduce compilation time by as much as 15%. There are restraints to parallel compilation, however. More JVM heap is required and the capability does not work with kapt. Also in Kotlin 1.6.20, Kotlin/JS (JavaScript) development with the IR compiler has been made more efficient with a new incremental compilation mode.

Kotlin 1.6.20 was released April 3. Installation instructions can be found on the Kotlin website. Other capabilities in Kotlin 1.6.20 include the following:

  • Kotlin/Native performance has been improved via updates and bug fixes to the LLVM IR generated by Kotlin.
  • Hierarchical structure support for multiplatform projects is enabled by default. This capability, introduced in Kotlin 1.4.0 in August 2020, improves code sharing in a project.
  • A prototype of context receivers for Kotlin/JVM offers new support for defining context-dependent declarations.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author