Skip to main content

Kotlin 2.5.0

Release Date: December 2, 2026

Remember when a Kotlin release meant a new language version and a two year wait for the ecosystem to catch up? Kotlin 2.5.0, published on December 2, 2026, closes a different kind of chapter. It is the first release that stops compiling for language versions 2.0 and 2.1 altogether, and the first where the return value checker is on by default. Both changes say the same thing: the K2 era is no longer the new thing, it is the baseline.

The 2.4 line ended on October 8 with 2.4.21. Everything between that patch and this release ran through two release candidates, RC on November 11 and RC2 on November 25, which is a normal cadence for a minor version. What is not normal is how much of the changelog touches defaults rather than features.

The Baseline Moves Forward

Three defaults changed at once, and together they will break more builds than any single feature in this release.

  • Language versions 2.0 and 2.1 are gone. Support was dropped outright, and language version 2.2 is now deprecated. Projects pinned with an old -language-version flag need to move before they can take this compiler.
  • The return value checker is enabled by default. Unused return values from functions marked as must-use now warn, and the stdlib has been annotated with @IgnorableReturnValue where a discarded result is intentional, including the aggregating collection functions and kotlin.concurrent.thread.
  • Object destructuring defaults to syntax-only. Name-based destructuring exists, but the compiler no longer resolves names implicitly unless you opt in.

Read those three together and the picture is clear. The compiler team is trading a noisy upgrade for stricter, more predictable code, which is the same trade the 1.9 to 2.0 migration made two years ago, just with less ceremony this time.

Strict Equality Reaches Data Classes

The most interesting compiler work in 2.5.0 is the strict equality project. Structural classes, meaning data classes and value classes, now get compile time checks for == and != based on an equality bound type, and the compiler generates a strict equals prologue for them. In practice that buys two things: incompatible comparisons are caught during compilation instead of returning false at runtime, and smart casts now work inside the body of a strict equals, as well as on the results of strict operator comparisons.

This is the sort of change that generates a long bug list and very little marketing. It also removes a whole category of silent logic errors, and anyone who has debugged a comparison between two classes that only look alike will recognize the value.

Bytecode 27 and 28, and the JDK Question

The JVM backend now targets bytecode version 27, with version 28 added as well. That tracks the JDK cadence rather than lagging behind it, and it matters for teams that want to compile against the newest class file format without a workaround. The release notes also update the bundled GraalVM from Community JDK 25.0.3 to Oracle GraalVM JDK 25.0.5.1, alongside a long list of patched third party dependencies including webpack-dev-server, ws, js-yaml, and nanoid.

Worth noting for the cautious: this is also the release that removes the IR interpreter from the compiler entirely. It had been disabled in practice for a while, so most teams will not notice, but internal tooling that leaned on it will.

Two Features Arrive as Alpha

Multi-field value classes reached alpha. So did companion blocks and extensions, the long-discussed design that gives companion objects a place for extension members with a cleaner initialization story. Neither is production material, and both are flagged as alpha in the changelog, which historically in Kotlin means the syntax can still change before stabilization.

The one language feature that did stabilize is IntroduceAt, which brings binary compatibility for optional parameters. Combined with the new const val support for trimMargin and trimIndent initializers, this is a release that helps library authors more than application developers.

Stdlib Additions Worth the Upgrade Alone

  • Tau is now part of the standard library, which should end a few decades of local 2 * PI constants.
  • CodePoint arrives as a value class, giving Unicode handling a proper type instead of bare ints.
  • Boolean.onTrue, onFalse, and ifOrNull add small functional conveniences that read better than nested ternaries.
  • Uuid.generateV4 and generateV7 are stabilized, with V7 finally giving the stdlib a time-ordered identifier.
  • kotlin-metadata-jvm gains readLenient() and readStrict() on module metadata, plus a stabilized RVC API surface.

Native, Wasm, and Compose

Kotlin/Native picks up a header mode for cinterop, support for Xcode 27, and a JVM-like class initialization scheme with companion blocks. Apple x86_64 targets are now deprecated as an error, which is the formal end of the Intel Mac build path. Kotlin/Wasm exports cabi_realloc from the stdlib so components can allocate properly, turns range checks on by default, and fixes a performance regression where cos ran roughly 47 percent slower in the release candidate than in 2.4.21.

The Compose compiler now supports rich callable references for @Composable functions, initializes ComposableSingletons fields lazily, and removes the deprecated IntrinsicRemember and StrongSkipping feature flags. If you still have either flag in a Gradle properties file, this is the release that will tell you so.

How I Would Approach the Upgrade

  • Check the language version and API version pins in every module first. Old pins are the most likely cause of a build that will not start.
  • Run the build with the new return value checker and read the warnings before silencing anything. Most of them point at genuine dead expressions.
  • Retest equality-heavy code. Strict equality checks can surface comparisons that compiled fine before but were never meaningful.
  • If you ship a library, check your optional parameter signatures and decide whether IntroduceAt helps your binary compatibility story.
  • Leave the alpha features alone in production. Multi-field value classes and companion blocks are for evaluation builds only.

The Trajectory

Kotlin 2.0 rewrote the compiler. Kotlin 2.1 through 2.4 taught it to behave like the old one. Kotlin 2.5 is where the language starts collecting the debts that rewrite created: strict equality, mandatory return value checks, retired language versions, and a bytecode target that no longer trails the JDK. That is a less exciting release than a new syntax feature, and it is the one that will shape the next two years of code.

Upgrade when your tooling allows. If you maintain multiple projects, start with the one that already fails the fewest warnings.

Other Versions

We use cookies for ads and analytics.