Kotlin 2.4.0
Kotlin 2.4.0 graduates context parameters to stable, adds explicit backing fields, enables Swift packages as direct Kotlin/Native dependencies, targets Java 26, and enables incremental compilation for Wasm by default.
- Context parameters stable — parameters resolved from the call site implicitly rather than passed explicitly; useful for dependency-injection patterns in Compose UI and scope threading through layered architectures
- Explicit backing fields — property accessors now reference the backing field directly via
field, removing the_propertyconvention;@allmeta-target simplifies annotation application across all target sites - Swift packages as Kotlin/Native dependencies — KMP projects targeting iOS declare Swift packages directly; the compiler generates interop bindings automatically, no CocoaPod wrappers or
.deffiles needed - Java 26 support — Kotlin/JVM compiler targets Java 26 bytecode, unlocking the latest JVM optimisations from Kotlin code
- Incremental Wasm compilation — enabled by default, cutting rebuild times for Kotlin/Wasm targets
- Compiler plugin symbol-resolution API — plugin authors gain a new API that reduces workarounds; serialization plugin now supports
@Serializableon companion objects
Update your Gradle version catalog.