Learn extra at:
Guard situations, launched in Kotlin 2.1.0 final November, are actually steady. Guard situations permit for together with multiple situation for the branches of a when
expression, making complicated management flows extra express and concise, JetBrains stated. Moreover, code construction is flattened with this function.
A brand new compiler choice in Kotlin 2.2.0, -XWarning-level
, is designed to supply a unified means of managing compiler warnings in Kotlin tasks. Beforehand, builders solely may apply common module-wide guidelines, similar to disabling all warnings with nowarn
or turning warnings to compilation errors with -Werror
. With the brand new choice, builders can override common guidelines and exclude particular diagnostics in a constant means.
Different new options and enhancements in Kotlin 2.2.0: