github JetBrains/kotlin v2.4.20-Beta2
Kotlin 2.4.20-Beta2

latest releases: build-2.5.0-dev-1931, build-2.5.0-dev-1923, build-2.5.0-dev-1913...
pre-release8 hours ago

Changelog

Analysis API

  • KT-86546 Check suspicious when over ConeKotlinType in ConeTypeCompatibilityChecker
  • KT-65417 K2 IDE: KTOR false positive expect-actual matching error on enum class because of implicit clone() in non-JVM source sets

Analysis API. FIR

  • KT-69727 K2 IDE. Wrong error in the editor on calling clone function of actual enum instance in non-jvm platform
  • KT-69726 FP errors on declaring fun clone() in actual enum in not-jvm source-set

Analysis API. Infrastructure

  • KT-84914 Do not publish analysis-api-test-framework
  • KT-86986 kotlin-compiler-common-for-ide bundles unrelated Analysis API modules

Analysis API. Light Classes

  • KT-87301 SymbolLightAccessorMethod#isValid returns false for delegated properties
  • KT-87171 SLC: non-mapped Kotlin collection supertype is dropped from supertype list
  • KT-87250 JvmExposeBoxed: light classes shouldn't be autogenerated for private declarations

Analysis API. PSI

  • KT-84925 Move KtReference to the Kotlin IntelliJ plugin

Analysis API. Standalone

  • KT-61404 Analysis API: implement proper library publishing structure

Analysis API. Stubs and Decompilation

  • KT-86250 KotlinIllegalArgumentExceptionWithAttachments: No fir element was found for KtDestructuringDeclaration on destructuring declaration typing
  • KT-64901 Inconsistency between AST and Stub tree in the case of non-local destructuring declarations

Analysis API. Surface

Performance Improvements

  • KT-70021 Analysis API: optimize KaFirExpressionTypeProvider.expressionType for simple cases

Fixes

  • KT-87337 Integrate KaContextParameterOwnerSymbol into KaCallableSymbol
  • KT-78234 Analysis API: Context parameters for accessors
  • KT-86786 Investigate suspicious when over ConeKotlinType in ConeKotlinType.getDirectSupertypes
  • KT-72902 Shouldn't KaSymbolProvider#findClass return KaNamedClassSymbol?
  • KT-87237 No expected type inside arrayOf in annotation entries
  • KT-87143 findKDoc returns parent property KDoc for accessors of an overriding property
  • KT-83224 Support "Compile-time functions" in the Analysis API
  • KT-87174 Expected class KaFirSymbol instead of class KaFirPackageSymbol exception
  • KT-87199 [Analysis API] Remove KaEnumEntryInitializerSymbol
  • KT-85206 Provide information about potentially removable context-sensitive resolution qualifiers via Analysis API
  • KT-86872 KtOperationReferenceExpression should be KtResolvableCall
  • KT-85800 Analysis API: The internal utility PrettyPrinter is used in the public API surface
  • KT-73796 Consider "KaAnnotation#useSiteTarget" removal
  • KT-84184 [Analysis API] Provide a unification substitutor API

Backend. Wasm

  • KT-86242 K/Wasm: deprecate and prohibit using wasmExports
  • KT-87639 [Wasm] Multimodule wasm fails on Pointer usages
  • KT-86245 K/Wasm: provide an API to get a reference to wasm memory
  • KT-76207 K/Wasm: prototype generating suspend functions with stack-switching proposal
  • KT-73452 K/Wasm: turning on range checks by default
  • KT-83159 K/Wasm: generate one common base class fun interfaces (including Function*)
  • KT-83356 K/Wasm: Difference in behavior on nested class initialization (for enums?)
  • KT-84267 K/Wasm: init order of companion objects is different from JVM
  • KT-86192 K/Wasm: Raise a warning on usage of top-level require in JsFun
  • KT-86822 K/Wasm: don't cast the result of calling callable references with Unit return type

Compiler

New Features

  • KT-85925 Native: rework virtual trampolines machinery
  • KT-80373 Add initial support for release compiler caches
  • KT-86018 Short-form of name-based destructuring for multi-field value classes
  • KT-86406 Swift Export: support supercalls for cross-language inheritance
  • KT-77616 Native: consider adding an annotation that enforces thread state switching for a @SymbolName external fun`
  • KT-86410 [KMP] Implement acceptance of JVM IC metadata from previous compilation

Performance Improvements

  • KT-85621 Native: fix optimization in CastsOptimization

Fixes

  • KT-86525 JvmExposeBoxed: Inconsistent number of parameters during reflection
  • KT-87606 Compiler crash on red code with redeclaration of type parameter which is used as expression
  • KT-87335 Context parameters: wrong LINENUMBER emitted for context argument loads in JVM bytecode
  • KT-87245 Report UnsupportedFeature on ExplicitContextArgument
  • KT-87577 Compiler crash on red code with ambiguous type parameter used as expression
  • KT-72706 Confusing "INVISIBLE_REFERENCE" when calling private constructor
  • KT-86957 Warning on the underscore variable is not reported for java.lang.Void call
  • KT-87261 K/N debug: 'is' check miscompilation — local variable reports wrong type when two smart-cast extractions precede an inline loop
  • KT-87507 False-positive ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED on fake-override with value parameter of type missing in dependencies
  • KT-87439 Postpone UnitConversionsOnArbitraryExpressions indefinetely
  • KT-87434 JAVA_CLASS_ON_COMPANION not reported when companion accessed through typealias
  • KT-64622 [K/N] ar utility fails with symbol @ in module/klib name on Linux with static cache
  • KT-84037 Native: rework ar invocations in the compiler
  • KT-87339 JVM: Support recursive type provided as an argument of typeOf
  • KT-86551 Check suspicious when over ConeKotlinType in FirExposedVisibilityDeclarationChecker#findVisibilityExposure
  • KT-87395 StackOverflowError in return value checker when a Java class member is annotated with the class's own nested annotation
  • KT-87290 Investigate possible bug in value class deserialization
  • KT-61141 K/N: irText tests failed with K/N irText first run
  • KT-85764 Native: Prohibit compiling sources in 'kotlin' package by default
  • KT-86469 Check 'when's over 'ConeKotlinType' which could miss some branches in DFA
  • KT-87253 Missed ConeCapturedType check in processing of equals contracts
  • KT-84522 Refactor FirResolvedQualifier
  • KT-84299 resolvedToCompanionObject is not set in some situations
  • KT-87327 JVM IR: NullPointerException in JvmInlineClassLowering when using == between value of generic value class and another value class
  • KT-86959 Native: OptimizeCasts gets confused by "complex" terms leaking between different loop iterations
  • KT-86949 Native: ComputeTypesPass handles type checks across loop iterations wrong
  • KT-86948 Native: CastsOptimization merges results of type checks across loop iterations wrong
  • KT-86947 Native: CastsOptimization drops side effects of always-null safe casts
  • KT-87276 Drop or move ConeTypeCompatibilityChecker
  • KT-78623 No-arg constructor should be generated if all parameters are optional, even when one of the parameters is inline type
  • KT-86886 Kotlin Lombok: compiler crash with IllegalArgumentException on builder with a single type parameter
  • KT-83880 Consider making OPERATOR_RENAMED_ON_IMPORT a warning (instead of error)
  • KT-87140 K/N: Test generation leaks BaseClassSuite's INSTANCE type parameter
  • KT-87291 Enable ProhibitScriptTopLevelInnerClasses in 2.5
  • KT-87226 CompanionBlocksAndExtensions: COMPANION_EXTENSION_RECEIVER_IS_OBJECT diagnostic is absent when object used via typealias
  • KT-87058 Investigate abandoned language features
  • KT-86655 mismatched mutability annotations in overriding lead to misaligned behavior in warn-mode and strict-mode
  • KT-85169 Return value checker: RETURN_VALUE_NOT_USED: object expression highlighted entirely instead of just the keyword
  • KT-87083 JVM: AssertionError in if UIntArray is declared in sources
  • KT-87032 JvmExposeBoxed: forbid private @JvmExposeBoxed declarations
  • KT-86523 JvmExposeBoxed: Cannot generate code for exposed constructor with default parameter referencing another default parameter
  • KT-86865 Support abstract full value classes with non-trivial constructors
  • KT-87016 Drop ANNOTATION_ON_ANNOTATION_ARGUMENT diagnostic
  • KT-86615 K2: Missing INVALID_CHARACTERS diagnostic for enum entry name with illegal JVM characters, leading to runtime ClassFormatError
  • KT-86849 Remove old @JvmInline multi-field value classes
  • KT-87014 [KGP] failing testSwiftExportCoroutines
  • KT-86481 Compilation failure with spread arrayOf inside arrayOf
  • KT-86996 unwrapVarargValue does not consider some cases
  • KT-86955 K2: Companion block funs in interfaces have OPEN modality after Fir2IR
  • KT-87035 K2: Context parameter type leaks unsubstituted into callable-reference adapter
  • KT-86940 Diagnostic range of NONE_APPLICABLE in enum entry is hard to see
  • KT-86046 Put @K1Deprecation to all public declarations of K1 modules
  • KT-86555 CL-based annotation resolve: clean up CFG-related hacks
  • KT-86482 Collection literals: do not fallback if not supertype of List is expected
  • KT-85288 Consider dropping use-site target checks in checkRepeatedAnnotation and similar places
  • KT-85469 Native: potential concurrency problem with caches
  • KT-86853 FIR: Char.code not being const-evaluated under IntrinsicConstEvaluation feature
  • KT-86877 Postpone ELA-related language features
  • KT-86852 Initialize full value classes fields before calling super
  • KT-86824 Native: support spaces in paths for Linux
  • KT-85816 Drop remaining usages of ComponentRegistrar
  • KT-86042 Inference fixes lambda's return type variable too early
  • KT-84719 Provide information for qualified types that might be replaced with context-sensitive simple names in IDE mode

Compose compiler

  • b/522127447 Fixed a bug that was making the stability of pre-cast types be used in certain skipping checks instead of the stability of post-cast types

IR. Inlining

  • KT-86558 Forbid accesing volatile references after inlining
  • KT-87272 IR: Function value is inlined with out-of-scope type parameter
  • KT-87274 IR: Synthetic accessors are generated with out of scope type parameters

IR. Tree

  • KT-87138 IR: Rich callable reference to an inner-class member leaks outer class type parameters into the generated adapter
  • KT-69305 Re-enable reporting out-of-scope type parameter usages during pre-lowering IR validation
  • KT-87105 [Tests][IR] Unify or split IR dump for different backends
  • KT-87292 IR: Drop lateinit modifier from IrFile.module property
  • KT-73921 False negative: tailrec checkers with recursive functions (without tail recursion)
  • KT-85575 KLIBs: Add IR text & ABI dump tests for companion blocks and companion extensions
  • KT-86943 Investigate if lambdas must be transformed into static or regular functions
  • KT-86884 IrTreeSymbolVisitor is not visiting symbols declared in non-final class
  • KT-85147 K/N: Segfault when calling SAM instance converted to type with nullable type parameter upper bound

JVM. Reflection

  • KT-73657 Fix kotlin-reflect performance issues for reflection operations common for both reflection implementation: stdlib and kotlin-reflect
  • KT-86101 Reflection: additional Java constructors are not added for mapped builtins in the new implementation

JavaScript

Fixes

  • KT-86934 K/JS: Stack overflow when implementing interface with suspend fun using anonymous object
  • KT-80188 Design exporting of suspend lambdas into JS/TS
  • KT-87127 KJS: @JsPlainObject factory contains duplicated parameters
  • KT-70622 Kotlin/JS: Incremental compilation doesn't recompile kotlin js stdlib while changing a collection
  • KT-87307 [JS] Reflection: runtime KClass of a Long value differs from Long::class
  • KT-87410 [K/JS] Companion block initialization order of super types differs from JVM
  • KT-86273 @JsExport.Ignore does not work properly with data classes properties
  • KT-84992 Remove body of isLongCompiledToBigInt intrinsic after boostrap version updated
  • KT-40768 KJS: initialization order for companion objects (inherited classes) different from K/JVM
  • KT-87074 KJS: Fix inheritance issues in Analysis API-based TypeScript export
  • KT-75176 Add infrastructure for bundle size testing
  • KT-70223 Delete the source code for the legacy JS backend
  • KT-73067 Drop support for the legacy JS metadata from the metadata decompiler
  • KT-82224 Respect file-level annotations in Analysis API-based TypeScript export
  • KT-82340 Implement supertype approximation in Analysis API-based TypeScript Export
  • KT-82317 Support Kotlin collections in Analysis API-based TypeScript Export

Klibs

Fixes

  • KT-87294 [Wasm] Implement Wasi Klib backward compatibility testing
  • KT-86320 [PL] Replacing unusable classifiers with Any? type may cause a signature clash
  • KT-86632 KLIBs: Rework serialization logic for IrTypeAlias
  • KT-87006 Extract/remove K1-specific parts from :kotlin-util-klib-metadata
  • KT-81659 Load symbols on 2nd compilation stage without frontend involvement
  • KT-85611 Change usage of KlibCompilerDeserializationConfiguration in IntelliJ to CommonCompilerDeserializationConfiguration
  • KT-86451 Get rid of deprecated '-no-endorsed-libs' usages in Kotlin project
  • KT-85578 KLIBs: New manifest property to indicate "new initialization order"
  • KT-74417 Deduce the metadata version based on LV in KLIB-based backends
  • KT-85587 [Tests] Update test data so it ignores failing compatibility tests correctly
  • KT-71414 KotlinLibraryResolver.resolveWithDependencies was evolved in binary incompatible way

Language Design

  • KT-11914 Confusing data class copy with private constructor
  • KT-86761 DM 2026-06-08: Another round on ELA (2)
  • KT-86895 Make full value classes poison builds

Libraries

  • KT-30270 Provide allDistinct() and allDistinctBy{} for iterables
  • KT-86766 Add @EqualityBound declaration to stdlib
  • KT-87173 isSortedBy and isSortedByDescending inline their selector twice at every call site
  • KT-87166 allEqualBy inlines its selector twice at every call site
  • KT-31305 Support JUnit5-like assertions with message suppliers in kotlin-test
  • KT-86329 Update kotlinx.collections.immutable in Kotlin project to 0.5.0
  • KT-85020 Path.copyToRecursively silently corrupts directory structure when copying across file systems with different path separators
  • KT-57883 Description and code mismatch in CoroutineContextImpl.kt
  • KT-65526 Rewrite builtins as expect-actual

Native

  • KT-36076 KotlinNullPointerException: Gradle parallel compilation fails on 1.3.70

Native. Build Infrastructure

  • KT-86889 Kotlin/Native: restore benchmarks after bootstrap update

Native. C and ObjC Import

  • KT-33092 Kotlin/Native doesn't mangle names clashing with standard macros when generating Objective-C headers
  • KT-87461 Native: platform.darwin cache build failure with symbol is already bound
  • KT-83940 Generate IR from C-interop KLIBs without descriptors
  • KT-84665 Don't use KLIB resolver in the CInterop tool
  • KT-86263 Generate IR for forward-declared classes without descriptors
  • KT-86871 C-interop Klib caches are not deterministic after KT-83940

Native. ObjC Export

  • KT-86443 Native: crash in SwitchThreadState when KotlinBase methods are called from a thread without an initialized Kotlin runtime
  • KT-85423 Native: ObjC export throws and breaks IDE highlighting and navigation support due to mangling inconsistency

Native. Runtime. Memory

  • KT-86432 Native: PMCS GC bug - alive object seems to be freed prematurely

Native. Swift Export

New Features

  • KT-87503 Swift Export: Support properties in cross-language inheritance
  • KT-87068 Swift Export: default interface method implementations
  • KT-86890 Swift Export: Support async calls in cross-language subtyping
  • KT-80000 Swift Export: Sealed Classes

Fixes

  • KT-86509 [Swift Export] Probable race in tests
  • KT-87340 [Swift Export] runtime crash during existential creation
  • KT-87462 [Swift Export] variadic params in functions requiring reverse bridges generates incomparable code
  • KT-87221 [Swift Export] abstract class with inherited interface fails to compile
  • KT-87229 [Swift Export] OptIn property inside interface fails to compile
  • KT-86463 Swift Export: nested sealed interface in kotlinx-datetime (DateTimeFormatBuilder.WithDate) is referenced but never emitted, causing Swift compile error
  • KT-87088 Protocols that came from cinterop should lose the Protocol suffix
  • KT-87150 [Swift Export] member function with param named result fails to compile
  • KT-87144 [Swift Export] nullable closure in member function fails to compile
  • KT-87106 [Swift Export] suspend closure with context parameter fails to compile
  • KT-86780 Native: Swift Export coroutines tests are flaky on the CI
  • KT-87022 [Swift Export] Optional Range results in incompilable code

Tools. BCV

  • KT-85950 Add support of "com.android.kotlin.multiplatform.library" plugin [ABI validation]

Tools. Build Tools API

New Features

  • KT-78224 BTA: implement support for metadata compilations
  • KT-86702 [BTA] Drop JVM classpath metadata arguments
  • KT-86676 Add Gradle property to control KMP JVM metadata usage in incremental compilation
  • KT-85663 Make BTA JS Compiler Arguments Type-Safe
  • KT-66425 BTA: implement ClasspathEntrySnapshot.hashCode
  • KT-84598 [BTA] Expose API Version via Public Property

Fixes

  • KT-87370 JS/Wasm history IC fails when compiler plugin generates callables
  • KT-87034 Introduce SerializedFirMetadata to track source file per metadata fragment
  • KT-87110 Name KLIB metadata fragments after source files for incremental writes
  • KT-87248 [KMP/JVM] Merge common metadata module header across incremental compilations
  • KT-87040 Track source-file-to-metadata-fragment mapping when writing KLIB metadata
  • KT-86703 Support JVM classpath metadata for KMP incremental compilation
  • KT-87152 Decouple JVM IC-specific metadata writing logic from common metadata components
  • KT-86876 Migrate WasmBinaryTransform to BTA
  • KT-86916 [BTA] adopt availableSinceVersion for WASM option holders
  • KT-82986 BTA: setting unknown options may pass silently
  • KT-85736 BTA tests: automate detection of missing versions in compatibilityTestsVersions

Tools. CLI

  • KT-86473 Report usages of removed CLI arguments as warnings
  • KT-86314 Add a CLI flag which controls ELA status
  • KT-86284 Deprecate using PSI mode from compiler CLI
  • KT-86405 Generalize reporting of deprecated CLI arguments
  • KT-87057 Return a legacy JVM KMP IC implementation until the proper one is implemented
  • KT-85003 Fix name check for @JvmName and @JvmExposeBoxed

Tools. CLI. Native

  • KT-87123 Phased klib compiler does not read -native-library arguments

Tools. Compiler Plugin API

  • KT-86860 Generalize generateProperties to support FirVariableSymbol but not only FirPropertySymbol

Tools. Compiler Plugins

  • KT-86842 Lombok: introduce ARGUMENT_IS_NOT_SUPPORTED diagnostic
  • KT-86145 Support for @EqualsAndHashCode annotation on kotlin classes
  • KT-87137 Lombok: builder methods aren't resolved if use an existing builder and generics
  • KT-87044 [DataFrame] Plugin generates a spurious backing field for generated column accessors
  • KT-87153 Lombok: merge module common into k2
  • KT-86980 Delete sources of K1 parts of compiler plugins
  • KT-87053 Lombok: @NoArgsConstructor factory references an out-of-scope type parameter of a generic class
  • KT-86839 Handle @Log on Java classes
  • KT-86985 Can't use @JvmName on class member properties of JPA entities even when using the 'final' modifier
  • KT-86774 PowerAssert: allow changing the last parameter to a different type if not specified

Tools. Compiler plugins. Compose

  • KT-87326 Compose compiler plugin: NoClassDefFoundError / IrLinkageError at runtime when calling @Composable interface method with default parameter across modules

Tools. Compiler plugins. Serialization

  • KT-86224 Serialization plugin generates IR with out-of-scope type parameters

Tools. Gradle

New Features

  • KT-87481 Introduce DelicateKotlinGradlePluginApi Opt-In
  • KT-85709 Write Kotlin Daemon warnings and Errors to Problems API

Fixes

  • KT-87509 Stop using Gradle Problems API severity field
  • KT-87508 Wire buildNeeded/buildDependent only for Gradle <9.5.0
  • KT-78294 Applying kotlin-dsl in buildSrc with org.jetbrains.kotlin.ecosystem in settings.gradle.kts causes sync failure
  • KT-86435 Replace File.ensureParentDirsCreated() with NIO Path createDirectories()
  • KT-87241 CleanDataTask.exec() deprecation message unreachable - task fails with cryptic UninitializedPropertyAccessException instead
  • KT-86039 Compile against Gradle 9.6.0 API
  • KT-87187 Bump Apple deployment targets to match Xcode 27
  • KT-86515 Replace mavenLocal() with build-dir repo in KGP functional tests
  • KT-76515 IC misses dependency to recompile when named kt file with JvmField instructed property was replaced with an object with the same name
  • KT-87186 Fix failing testSwiftExportCoroutines
  • KT-87160 Fix failing Swift Export testExportingTransitiveDependencies test
  • KT-86827 [KGP] Add KgpJson helper and bump kotlinx-serialization-json 1.4.0→1.4.1
  • KT-55452 Values of the compiler arguments set via KotlinCompile task configuration are duplicated by the KaptGenerateStubs task
  • KT-57653 Explicit API mode is not enabled when free compiler arguments are specified in Gradle project

Tools. Gradle. JS

New Features

  • KT-86715 Add ability to configure Dev-server URL (or specification) to run browser tests from
  • KT-87483 Mark parts of JS Test DSL with DelicateAPI
  • KT-87484 Update Browser JS Test DSL after DM for 2.4.20-Beta2

Fixes

  • KT-86911 Configured post-processing for playwright reports missing an input or output annotation
  • KT-87501 Throw an error if new JS test DSL is used with Wasm
  • KT-84724 NPM dependency versions do not invalidate KotlinWebpack task cache key in kotlin multiplatform project
  • KT-87600 Playwright install on multiple subprojects cause Gradle build to fail
  • KT-87647 Upgrade tooling NPM dependencies versions for 2.4.20
  • KT-87023 Add ability to change / set path to custom browser executable
  • KT-86958 Unclear error for js test failure on timeout
  • KT-86922 Correct browserDefaults timeout

Tools. Gradle. Multiplatform

  • KT-82398 KMP Separate Compilation: missing fragment dependencies to commonized cinterop

Tools. Gradle. Native

  • KT-85468 Don't fail IDE import if the SwiftPM import pipeline has failed somewhere
  • KT-84852 Wire linkage package integration check with Swift Export's embedAndSign
  • KT-87196 Ld override falls apart in Xcode 27
  • KT-86155 Print what changed in the linkage package
  • KT-84223 Move local SwiftPM package IO validation and name inference from configuration time to execution time
  • KT-86995 Cocoapods plugin: pass all frameworks to the compiler
  • KT-86667 Switch off sandboxing in integrateEmbedAndSign

Tools. Gradle. Wasm

  • KT-86633 K/Wasm: Introduce wasmtime support as a runtime for wasm-wasi target in KGP
  • KT-87258 K/Wasm: Introduce a way to use multimodule compilation only for development
  • KT-86919 K/Wasm: Allow to configure wasm compilation mode
  • KT-86878 K/Wasm: Update wasmtime to 46.0.0
  • KT-86673 K/Wasm: update binaryen to 130
  • KT-82419 wasm failed to compile on windows arm64

Tools. Gradle. Xcode

  • KT-86858 Eager SwiftPM check in XCFramework task crashes if Kotlin extension is not yet registered

Tools. Incremental Compile

  • KT-87217 JS/Wasm IC: "Could not close incremental caches" with "Storage is already registered"
  • KT-86781 Deprecate FIR based incremental runner
  • KT-85241 IC: star-import conflicts are not re-evaluated after adding new declarations, leading to missed ambiguity errors
  • KT-60584 IC does not propagate RequiresOptIn level change effect transitively

Tools. Kapt

  • KT-86550 Kapt: properties with context parameters are translated incorrectly

Tools. Maven

  • KT-83374 CRI: it is not clear that CRI generation requires IC being enabled in Maven

Tools. Scripts

  • KT-87041 Scripting: classpath extraction fails to extract stdlib from kotlinc
  • KT-87331 Scripting: compiling scripts with kotlinc doesn't update the compilation config after refinement
  • KT-87042 Scripting cache test fails on the kotlin runner

Tools. Wasm

  • KT-86407 Get rid of '-Xwasm' usages in Kotlin project

Don't miss a new kotlin release

NewReleases is sending notifications on new releases.