Just published by JetBrains, Kotlin 1.5.30 offers experimental new language features and experimental additions to the standard library. Experimental features include sealed when Annotation class statements and instantiations. This may be official in the next Kotlin 1.6.0 release.

sealed when If the statement is in effect, a compiler warning is raised in the following cases: when The statement is not exhaustive. This is intended to make your code more secure without the need for developers to introduce their own functions.

Also, what is being previewed suspend Functions as a supertype suspend Although there is a function type as a super interface limit, Developers can’t use more than one, etc. suspend Functional supertype. This is considered a missing part in the Kotlin coroutine design.

Instructions for installing Kotlin 1.5.30 can be found at: blog.jetbrains.com.. Kotlin 1.5.30 was announced on August 24th. Other improvements are as follows:

  • For Kotlin / JVM Instantiation of annotation, class Allows the developer to call the constructor of the annotation class in arbitrary code to get an instance of the result. Developers need to be able to use this experimental feature. Kotlin / JVM allows developers to specify whether the compiler should report nullability discrepancies based on certain types of information. nullability annotation.
  • Native support is provided for Apple Silicon Computers.
  • As a step towards Opt-in annotation In connection with the standard library, new rules are provided for using and declaring opt-in requirement annotations on various targets.
  • For the standard library Duration When Regex stdlib API.The output of Duration.toString() For example, it’s easier to read. NS Duration The API is stabilized in Kotlin 1.6.0.
  • When you enable recursive generic type inference, the compiler can infer type arguments for recursive generics based on the upper bound of the corresponding type parameter. This allows you to build patterns using recursive generic types, which are often used to create builder APIs in Java.
  • By removing the restrictions of builder inference, developers specify the type of information that builder inference can infer, get Builder inference function.
  • Improvements have been made to Kotlin multi-platform, including features used cinterop Library Share Extends sharing of platform-dependent libraries shipped with Kotlin / Native with native code. There are also new Default public settings For Android artefacts.
  • The following new experimental functions are provided for regular expressions: matches(), Checks if the regular expression matches the specified position in the string.
  • For Kotlin / JS IR compiler backend Move to beta stage.
  • The Gradle build tool has improved the plugin user experience.
Tags: , , , , , , , , , , , , , , , , , ,
Nikoleta Yanakieva Editor at DevStyleR International