$ the-wire · showcase
Kotlin 2.4.20 ships with deprecations and compiler fixes
By RepoJournal · Filed · About Mobile platforms
Kotlin 2.4.20 lands with a wide set of compiler and API fixes, while Flutter and Swift tooling churn through incremental build and parsing fixes.
Kotlin 2.4.20 [1] shipped with fixes across the Analysis API and K2, including a false positive for MISSING_DEPENDENCY_SUPERCLASS in kotlinx.coroutines and new APIs for accessing deserialized file annotations. Alongside the release, Kotlin's build tooling began migrating away from the deprecated `applyArgumentStrings` method in the Maven plugin and KGP, replacing it with `applyCommandLineArguments` [2][3]. A companion change [4] adds an automatic deprecation cycle: the method will move to ERROR in 2.6.0 and be removed in 2.7.0. Since the migration is behavior-preserving, existing builds that rely on `applyArgumentStrings` should keep working until removal, but planning for the replacement is now mandatory for 2.7.0.
Flutter added `itemExtentBuilder` support to `ListView.separated` [5], letting developers specify item and separator extents for optimal scrolling performance when those values are known. On Linux, the engine no longer clears the OpenGL context after drawing a frame [6]; previously, clearing left no context current and GTK could crash if its own context attempt failed. Leaving the context current gives GTK a fallback, which the author says prevents that crash. Separately, the CI toolchain updated dartdoc from 9.0.6 to 9.0.8 [7] to avoid a RangeError in `@docImport` processing; 9.0.9 was skipped because it introduces new dependency constraints.
Swift compiler work continues on foundational mechanics. A parser fix [8] corrects generic-argument recognition of function types: previously `Foo<(Int, Int) -> Bool>` was rejected under the `LiteralExpressions` feature because parentheses were unconditionally treated as a value expression. The parser now treats them as a type when not followed by `,` or `>`. Hashable derivation is moving behind a macro [9] under the `DeriveConformancesViaMacros` feature flag, replacing hand-crafted AST nodes with a `#_deriveHashable` macro call. Two test-infrastructure changes fix latent bugs: one [10] corrects tests that used the nonexistent `%swift-frontend` substitution, which previously concatenated `-frontend` onto the last argument and corrupted the availability macro, and another [11] removes `repl_swift` side-by-side runtime binding that was causing tests to fail by loading the shipped runtime instead of the in-tree one.
Action items
- → Plan migration from applyArgumentStrings to applyCommandLineArguments before Kotlin 2.7.0 JetBrains/kotlin [plan]
- → Adopt itemExtentBuilder in ListView.separated for known extents flutter/flutter [plan]
- → Monitor Linux OpenGL context fix in Flutter engine flutter/flutter [monitor]
References
- [1] Kotlin 2.4.20 ↗ JetBrains/kotlin
- [2] [Maven] Migrate away from deprecated `applyArgumentStrings` ↗ JetBrains/kotlin
- [3] [KGP] Migrate away from deprecated `applyArgumentStrings` ↗ JetBrains/kotlin
- [4] [BTA] Add automatic deprecation cycle for `applyArgumentStrings` method ↗ JetBrains/kotlin
- [5] Add itemExtentBuilder support to ListView.separated (#191157) ↗ flutter/flutter
- [6] [Linux] Don't clear the OpenGL context when a frame has been drawn ↗ flutter/flutter
- [7] ci: update dartdoc from 9.0.6 to 9.0.9 (#192405) ↗ flutter/flutter
- [8] [Literal Expressions][Parser] Route type-shaped generic arguments as types ↗ apple/swift
- [9] Derive `Hashable` via macro ↗ apple/swift
- [10] [test] Stop using the nonexistent `%swift-frontend` substitution ↗ apple/swift
- [11] utils: Remove repl_swift SxS runtime binding for tests (#91429) ↗ apple/swift