MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
kotlin
Recherche

Kotlin introduces checker for unused return values

mercredi 26 novembre 2025, 02:31 , par InfoWorld
Kotlin 2.3.0 has reached the release candidate (RC) stage. Highlights of the latest update of JetBrains’s Java alternative include a new checker for unused return values, improved interoperability with Swift, support for Java 25, improvements to context-sensitive resolution, and enhancements for Kotlin/Wasm and Kotlin/JS.

The Kotlin 2.3.0 RC was introduced November 18. Kotlin 2.3.0 is expected to be available as a stable release next month or in January 2026. Developers can access Kotlin 2.3.0-RC on GitHub.

Kotlin 2.3.0-RC focuses on feature stabilization and has an experimental new checker for unused return values. The unused return value checker, now in experimental mode, warns when an expression returns a value other than Unit or Nothing and is not passed to a function, checked in a condition, or used otherwise, according to JetBrains. This feature can be used to catch bugs where a function call produces a meaningful result, but the result is silently dropped, JetBrains said.

Two previously beta language features become stable in Kotlin 2.3.0. These include support for nested type aliases and data flow exhaustiveness checks for when expressions. Kotlin 2.3.0 also improves context-sensitive resolution in two ways, according to JetBrains. First, the sealed and enclosing supertypes of the current type now are considered as part of the contextual scope of the search. Second, in cases with type operators and equalities, the compiler now reports a warning if using context-sensitive resolution makes the resolution ambiguous.

For the Swift language, Kotlin 2.3.0-RC via Kotlin/Native compilation improves Kotlin interoperability with Swift through Swift export, adding support for native enum classes and variadic function parameters. Previously, Kotlin enums were exported as ordinary Swift classes, according to JetBrains. Now, mapping is direct, and developers can use regular native Swift enums.

Kotlin’s Java support has been updated. Starting with Kotlin 2.3.0-RC, the compiler can generate classes that contain Java 25 bytecode. Java 25, the latest version of standard Java, was released September 16. Also, Kotlin 2.3.0-RC is fully compatible with Gradle build tool, versions 7.6.3 through 9.0.0. Developers can use Gradle versions up to the latest Gradle release, but should be aware that doing so may result in deprecation warnings, and some new Gradle features may not work, JetBrains said.

For WebAssembly, the Kotlin update has the KClass.qualifiedName property enabled by default on Kotlin/Wasm targets. This means that FQNs (fully qualified names) are available at run time without any additional configuration. The change does not increase the size of the compiled Wasm binary, thanks to compiler optimizations, according to JetBrains. Also, to improve compatibility with modern WebAssembly runtimes, a new WebAssembly exception handling proposal is enabled by default for the wasmWasi target, thus adding exception handling.

For Kotlin/JS, which transpiles Kotlin code to JavaScript, Kotlin 2.3.0-RC lets suspend functions be exported directly to JavaScript via the @JsExport annotation. This is an experimental feature. Enabling exports of suspend functions removes the need for boilerplate and improves interoperability between Kotlin/JS and JavaScript/TypeScript (JS/TS), according to JetBrains. Kotlin’s async functions now can be called directly from JS/TS without extra code.
https://www.infoworld.com/article/4096340/kotlin-introduces-checker-for-unused-return-values.html

Voir aussi

News copyright owned by their original publishers | Copyright © 2004 - 2025 Zicos / 440Network
Date Actuelle
mer. 26 nov. - 03:49 CET