Kotlin 1.4 to improve null-check capabilities Credit: Robert ShunevCreative Commons
Business Management

Kotlin 1.4 to improve null-check capabilities

Kotlin 1.4, a planned upgrade to the statically typed JVM language created by JetBrains, is set to add null-check optimizations.

Starting with the Kotlin 1.4 release, all runtime checks will throw a java.lang.NullPointerException instead of a KotlinNullPointerException, IllegalStateException, IllegalArgumentException, and TypeCastException

The change is designed to open up more possibilities for null check optimizations by the Kotlin compiler or bytecode processing tools such as the Android R8 optimizer. It will apply to the !! operator, parameter full checks in the method preamble, the as operator with a non-null type, and platform-typed expression null checks. The change will not apply to lateinit null checks and explicit library calls such as checkNotNull or requireNotNull.

Kotlin has gained a higher profile since being endorsed by Google in May 2017 as an official language for building Android mobile apps, alongside Java. In addition to detailing the plans for Kotlin 1.4, the Kotlin Foundation released Kotlin 1.3.50 with the following features:

  • An API for bit manipulation in the standard library, available in a beta form.
  • An improved Time and Duration API, also in a beta stage.
  • For the JetBrains IntelliJ Idea IDE, Kotlin 1.3.50 improves the Java-to-Kotlin converter to minimize the volume of “red code” to fix manually after a conversion.
  • Experimental generation of external dependencies for NPM dependencies in Gradle Kotlin/JS projects, using the Dukat converter. Dukat converts TypeScript files to Kotlin external declarations.
  • Java compilation support in multiplatform projects, by calling the new withJava() function of the DSL.

Where to download Kotlin

You can find instructions on getting started with Kotlin on GitHub.

PREVIOUS ARTICLE

« Logitech Z207 2.0 Stereo Computer Speakers review: Improved sound for all your devices

NEXT ARTICLE

Microsoft signals probable Surface launch event for Oct. 2 »
author_image
IDG News Service

The IDG News Service is the world's leading daily source of global IT news, commentary and editorial resources. The News Service distributes content to IDG's more than 300 IT publications in more than 60 countries.

  • Mail

Poll

Do you think your smartphone is making you a workaholic?