github JetBrains/kotlin v2.2.20-Beta2
Kotlin 2.2.20-Beta2

latest releases: build-2.3.0-dev-5671, build-2.3.0-dev-5665, build-2.3.0-dev-5661...
pre-releaseone month ago

Changelog

Analysis API. Code Compilation

  • KT-78382 K2 IR lowering error when interface extends interface
  • KT-73201 K2 IDE: Error while evaluating expressions with local classes
  • KT-78164 Evaluator: '@JvmName' annotations are not recognized in other modules

Analysis API. FIR

  • KT-72227 SOE from recursive value class
  • KT-68977 K2 IDE: Reference to companion object through typealias in a function call does not work
  • KT-76490 Do not load ast during the contracts phase if no contracts present
  • KT-72407 FirImplementationByDelegationWithDifferentGenericSignatureChecker: FirLazyExpression should be calculated before accessing

Analysis API. Light Classes

  • KT-78065 Support "Expose boxed inline value classes" in Light Classes
  • KT-78835 Find usages of a light constructor from a class with an empty body finds usages of class as well

Analysis API. Providers and Caches

  • KT-78640 Analysis API: Remove "friend builtins provider" from FirDeclarationForCompiledElementSearcher

Analysis API. Standalone

  • KT-78638 Analysis API Standalone: Stdlib builtins are not indexed in STUBS deserialized declaration origin mode

Analysis API. Surface

New Features

  • KT-73473 Provide KaExpressionInformationProvider.isUsedAsResultOfLambda

Performance Improvements

  • KT-78526 Get rid of redundant checkValidity from withPsiValidityAssertion

Fixes

  • KT-78820 K2: ISE "FIR element class FirErrorExpressionImpl is not supported in constant evaluation" through RedundantValueArgumentInspection
  • KT-75057 Analysis API: Reference to object through typealias in invoke operator call leads to original type
  • KT-79042 Do not restore KaTypePointer if target kind has changed
  • KT-72421 AA: "KtReference.resolveToSymbols" returns empty list when ASSIGN_OPERATOR_AMBGUITY error is present
  • KT-63464 AA: KtPsiTypeProvider#asPsiType doesn't substitute kotlin.Unit
  • KT-75913 K2: SymbolLightLazyAnnotation evaluates arguments and replaces them with constants
  • KT-73184 Analysis API: KaFunctionCall.argumentMapping is unexpectedly deparenthesised
  • KT-78613 PSI: add binary compatibility checks
  • KT-74013 Analysis API: Cover the API surface with @SubclassOptInRequired annotations
  • KT-76614 Move the parser and lexer to a separate module
  • KT-78552 KaFunctionValueParameter is not marked as KaLifetimeOwner
  • KT-71152 Add back SubclassOptInRequired to classes in KaModule.kt
  • KT-77674 Analysis API: Redundant smart cast to the original type

Backend. Wasm

New Features

  • KT-65721 K/Wasm: stop unconditionally exporting any main function from the root package

Fixes

  • KT-73931 WASM: "RuntimeError: illegal cast" with nullable generic
  • KT-65403 [WASM] RuntimeError is thrown instead of ClassCastException
  • KT-79317 [Wasm] Do not throw CCE for ExcludedFromCodegen declarations
  • KT-66085 K/WASM: Runtime error is uncaught with catch (e: Throwable)
  • KT-66072 K/Wasm: improve how exceptions work in JS interop
  • KT-78384 K/Wasm: Incorrect debug info of local declarations in inline function from another file
  • KT-71533 K/Wasm + K2: no error on KClass::qualifiedName usages
  • KT-72220 Wasm: Unclear exception in case of missed dependency
  • KT-71691 No trace on Wasm/JS if an error occurred in initializing global variables in a file with the main function
  • KT-69570 K/Wasm: JsExport with default parameter value compiles to invalid Wasm

Compiler

New Features

  • KT-78792 Report warning for redundant return in expression body
  • KT-45683 Allow generics in contract type assertions
  • KT-71244 Incorporate existing @CheckReturnValue annotation(s) into Kotlin's unused return value checker
  • KT-32313 Support contracts for operator functions
  • KT-76766 Warning is missing for wrong subclass checking
  • KT-65688 Generate when-expressions over final classes via invokedynamic typeSwitch + tableswitch on JDK 21+

Performance Improvements

  • KT-78672 Consider having FirCallableSymbol.callableId null for local properties / parameters
  • KT-77839 K2: consider not creating CallableId for value parameters / variables / fields

Fixes

  • KT-79355 Failed to fix the problem of desugared inc with new reverse implies returns contract
  • KT-79277 Implies returns contract doesn't affect the return type of the function if it is in the argument position
  • KT-79271 Implies returns contract doesn't impact exhaustiveness
  • KT-79218 SMARTCAST_IMPOSSIBLE for top‑level extension‑property getter despite returnsNotNull contract
  • KT-79220 returnsNotNull contract ignored on extension function with nullable receiver
  • KT-79442 "Multiple annotations of type kotlin.coroutines.jvm.internal.DebugMetadata": 2.2.0-Beta1 generates broken code with JVM default suspend methods in interfaces
  • KT-79354 IllegalStateException: Debug metadata version mismatch. Expected: 1, got 2 with compiler 2.2.20-Beta1 and stdlib 2.2.0
  • KT-78479 IR lowering failed / Unexpected null argument for composable call
  • KT-77401 [FIR] ParameterNameTypeAttribute.name doesn't support @ParameterName with compile-time constant property argument
  • KT-77986 K2: False negative: "Local classes are not yet supported in inline functions"
  • KT-78843 FIR tree: comments within String concatenation aren't visited in 2.2.0
  • KT-76477 Kotlin/Native: fix compiler performance reporting in sources->klib and klibs->binary
  • KT-78589 "Class does not have member field" caused by delegation from a Java to Kotlin class
  • KT-79076 'IllegalStateException: Cannot serialize error type: ERROR CLASS: Uninferred type' with Exposed column using recursive generic type
  • KT-78726 Split runPsiToIr phase into runPsiToIr and runIrLinker
  • KT-77672 K/N: come up with a fallback strategy for the casts optimization pass
  • KT-76585 K2: RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY is not reported inside initializers of local variables
  • KT-79099 K2: Do not inherit inline modifier
  • KT-76902 Omit type-use annotations from diagnostics
  • KT-79085 Adding -Xreturn-value-checker=full to kotlinc causes "error: conflicting overloads"
  • KT-58988 K2: Deprecate exposing package-private parameter of internal method
  • KT-77199 OPT_IN_USAGE_ERROR is still absent when calling the enum primary constructor
  • KT-72800 K2: java.util.NoSuchElementException when introduce variable
  • KT-79056 Add experimental language version 2.5
  • KT-78351 Plugins: VIRTUAL_MEMBER_HIDDEN caused by FirSupertypeGenerationExtension
  • KT-78527 No LESS_VISIBLE_TYPE_ACCESS_IN_INLINE_WARNING is reported when a private companion object is accessed via the class name
  • KT-78837 linkReleaseFrameworkIosArm64: Compilation failed: An interface expected but was Any
  • KT-78945 CONTRACT_NOT_ALLOWED is not reported for local operator functions
  • KT-78944 ANNOTATION_IN_CONTRACT_ERROR is not reported for operators and property accessors with contracts
  • KT-78943 ERROR_IN_CONTRACT_DESCRIPTION is not reported for operators and property accessors with contracts
  • KT-78932 Contracts are allowed for open and overridden property accessors
  • KT-77203 FIR: Consider adding destructured type to all COMPONENT_FUNCTION_* diagnostics
  • KT-78805 K2: False positive METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE
  • KT-78651 No need to report LESS_VISIBLE_TYPE_ACCESS_IN_INLINE_WARNING in noinline default value lambda
  • KT-78849 K2: [Wasm, Fir2IR] Invalid smartcast on overloaded function call
  • KT-78793 Make feature AllowEagerSupertypeAccessibilityChecks experimental
  • KT-78736 Missing [NOT_YET_SUPPORTED_IN_INLINE] diagnostics because of incorrect context update
  • KT-78324 K2: False negative [INCONSISTENT_TYPE_PARAMETER_VALUES]
  • KT-69975 KDoc: cannot reference elements with names in backticks
  • KT-78229 KDoc: unable to reference a method with spaces in the name
  • KT-78047 Render unnamed context parameters as _ instead of
  • KT-74621 Debugger: AssertionError on evaluating two suspending calls
  • KT-76826 New inference error [NewConstraintError at Incorporate TypeVariable] caused by recursive generics and nullable expected type
  • KT-78028 "FirNamedFunctionSymbol" leaks to the error message about missing infix modifier
  • KT-77245 Add expression name to RETURN_VALUE_NOT_USED diagnostic
  • KT-78071 False-positive NO_ELSE_IN_WHEN after variable reassignment
  • KT-78068 False-positive NO_ELSE_IN_WHEN after excluding enum value with inequality check
  • KT-25341 NOT_YET_SUPPORTED_IN_INLINE reported over anonymous object border
  • KT-71134 Consider to get rid of CapturedTypeMarker.withNotNullProjection()
  • KT-77131 getValue/setValue can be declared with more than two/three parameters
  • KT-78452 Drop redundant frontend structures after fir2ir conversion
  • KT-78458 Don't populate PredicateBasedProvider if no lookup predicates are registered
  • KT-78440 Lambda with an implicitly runtime-retained annotation is generated via invokedynamic with -Xindy-allow-annotated-lambdas=false
  • KT-78252 ClassCastException when Array<Void> used for compile-time vararg of Nothing
  • KT-78097 False positive NO_ELSE_IN_WHEN on sealed interface with negative is check
  • KT-77713 Context Parameters cause compiler generate r8 incompatible bytecode
  • KT-76629 K2 Mode: False positive RedundantVisibilityModifier inspection on private constructors in sealed classes
  • KT-78429 K2: Property callable reference incorrectly smart-casted to intersection of property type and KProperty
  • KT-78509 Renamed for override copy functions are cached in scope instead of session
  • KT-75831 K2: An extra "[VALUE_PARAMETER_WITHOUT_EXPLICIT_TYPE] An explicit type is required on a value parameter." for a missing parameter
  • KT-78370 All the [something]Assign operators on dynamic return Unit as a type
  • KT-73950 K2 IDE / Kotlin Debugger: ISE “Fake override should have at least one overridden descriptor” on evaluation of local calss in presence of bystander
  • KT-78280 Implement the sourceless KtDiagnostics
  • KT-76543 Migrate psi2ir sources to new IR parameter API
  • KT-77716 Kotlin/Native and -Xseparate-kmp-compilation: "Compilation failed: Several functions kotlin/native/immutableBlobOf found"
  • KT-76400 Context-sensitive resolution doesn’t work in if-else condition passed as a function argument
  • KT-76606 Enable 'Indy: Allow lambdas with annotations' by default
  • KT-78121 Report warning on function type with multiple implicit values that's annotated with DSL marker
  • KT-61227 Definitely non-nullable types cause "Any was expected" for @Nullable parameter

Compose compiler

  • b/432262806 Use classId as FirApplierInferencer tokens
  • KT-78479 Ensure that default transform affects functions entered through a call
  • b/400371006 Gate default parameters behind language versions
  • KT-78490 Fix visibility for default wrappers of protected methods
  • b/245673006 Specify fqName for classes and functions in build metrics
  • b/254577243 Avoid printing complex expressions in compiler metrics

IR. Inlining

New Features

  • KT-70360 KLIBs: Uniformly handletypeOf() calls at 1st/2nd stages of compilation

Fixes

  • KT-79002 [Inliner][Native][PL] Native backend fails for inline function that instantiates a class that was compiled implementing two interfaces, which turned into abstract classes
  • KT-69941 Rewrite DumpSyntheticAccessors lowering to test handler after moving common Native/JS prefix to KLIB compilation
  • KT-78137 Review & enable PL tests with enabled IR inliner
  • KT-78245 Synthetic Accessors incorrectly copies default values
  • KT-76236 Include NativeInliningFacade and JsIrInliningFacade in all Native & JS test runners
  • KT-76512 Avoid using originalFunction inside FunctionInlining
  • KT-69457 [references] IR Inliner: References to inline functions are not inlined
  • KT-47521 Native & JS: Recursive inline fun calls -> StackOverflowError
  • KT-76763 [Inliner] Don't use attributeOwnerId to pass info from Inliner to non-JVM backends
  • KT-76145 Enhance error message about poisoned KLIBs in KLIB-based compilers

IR. Tree

  • KT-78978 PL tests: Drop adjust*forLazyIr() hack
  • KT-77596 Refine reuseExistingSignaturesForSymbols setting in IR serializer
  • KT-76723 IR validator: Check visibilities of annotations
  • KT-76405 Visit annotations in IrTypeVisitor and IrTreeSymbolsVisitor
  • KT-78033 [PL] Merge IrUnimplementedOverridesStrategy to PartiallyLinkedIrTreePatcher

JVM. Reflection

  • KT-77882 kotlin-reflect: KParameter.name returns "" instead of null for anonymous context parameters
  • KT-77879 kotlin-reflect: toString overrides of KCallable implementations do not render context parameters

JavaScript

New Features

  • KT-79394 Add the possibility to write common external declarations between JS and WasmJS targets
  • KT-79222 K/JS: Allow using Long in exported declarations

Performance Improvements

  • KT-57128 KJS: Use BigInt to represent Long values in ES6 mode
  • KT-54689 KJS: Data class equals less efficient than manually written version

Fixes

  • KT-79050 KJS / IC: "Unexpected body of primary constructor for processing irClass"
  • KT-52230 KSJ IR: Applying identity equality operator to Longs always returns false
  • KT-6675 KotlinJS: toInt() on external Long throws error
  • KT-79184 K/JS: Further intrinsify BigInt-backed Long operations
  • KT-78701 Js and Wasm: enumValueOf does not include invalid value into an exception message
  • KT-78316 KJS: List is not exported to TypeScript declaration if wrapped in Promise
  • KT-66091 KJS, WASM: AssertionError: Illegal value: <T> in test nonReified_equality.kt
  • KT-57192 KJS: "Exported declaration uses non-exportable return type" caused by @JsExport Promise with Unit type
  • KT-61183 KJS: "AssertionError: Assertion failed" from JsSuspendFunctionsLowering
  • KT-59326 KJS / IR: invalid code generated when using constructor parameter named default

Klibs

  • KT-78699 Compiler (JS, Wasm): warn about incompatible kotlin-test/compiler pair
  • KT-78700 Compiler (JS, Wasm): Consider making diagnostics for incompatible kotlin-stdlib/compiler and kotlin-test/compiler pairs errors instead of warnings
  • KT-76094 Support new callable reference nodes in partial linkage in Kotlin/Wasm
  • KT-78771 KLIBs: Improve zipDirAs() function that is used to produce KLIB (ZIP) archives
  • KT-78349 [Tests] Enable Partial Linkage in all tests
  • KT-68322 Compiler (JS, Wasm): warn about incompatible Kotlin stdlib/compiler pair

Language Design

  • KT-32993 Contract to specify that a function parameter is always true inside lambda
  • KT-79308 Ability to actualize empty interfaces as Any
  • KT-78866 Warn implicit receiver shadowed by context parameter
  • KT-8889 Contracts: if a given function parameter is not null, the result is not null
  • KT-22786 Returns are not allowed for expression-body functions and are allowed when an inline lambda is added
  • KT-54363 Allow using reified types for catch parameters
  • KT-77836 Support using context parameter of a @RestrictsSuspension type as the "restricted coroutine scope"
  • KT-77823 Context-sensitive resolution doesn't work for subtypes of sealed types
  • KT-75977 False positive unresolved_reference when resolving nested member after a type check

Libraries

  • KT-79080 Annotate WasmImport and WasmExport as experimental API
  • KT-79121 K/Wasm annotate JS-interop API as experimental
  • KT-78581 Add the KClass.isInterface property to Kotlin/JS stdlib
  • KT-78710 kotlin.wasm and kotlin.wasm.unsafe packages are missing description
  • KT-78709 Wasm: KClass.qualifiedName KDoc should reflect the behavior on the target
  • KT-78704 CharSequence.subSequence and String.substring behavior with invalid indices differs between targets
  • KT-78705 Float.sign and Double.sign behavior for negative zero is not documented
  • KT-74543 Support for context parameters in kotlinx-metadata
  • KT-78340 String.startsWith KDoc declares invalid exception condition

Native

  • KT-78959 Xcode 26: fix GC stress tests
  • KT-78734 Finish runtime crash dump generation

Native. ObjC Export

  • KT-77488 [ObjCExport] Add explicit ObjCBlock parameter name in objc export
  • KT-78447 [ObjCExport] Add missing ERROR constructors, align with K1

Native. Runtime

  • KT-79152 Native: unexpected thread state in kotlin::to_string

Native. Runtime. Memory

  • KT-78925 Crash SIGABRT on Apple Watch after updating Kotlin to 2.2.0
  • KT-76851 Kotlin/Native: GC scheduler MutatorAssists requestAssists and completeEpoch issue

Native. Swift Export

  • KT-79227 Swift Export: Fix First Release Issues
  • KT-78947 Implement FUS for Swift export
  • KT-79521 '_CoroutineScope' is inaccessible due to 'internal' protection level

Tools. Build Tools API

  • KT-78415 Add a tool for performance reports analysing

Tools. CLI

  • KT-75968 Set proper lifecycle for all existing compiler arguments
  • KT-78318 Unresolved reference when compiling kotlin/JS project on fresh master
  • KT-78578 Support for placeholder (*) and directory in -Xdump-perf

Tools. Compiler Plugin API

  • KT-78279 Make the DiagnosticReporter default way for reporting in IR plugins

Tools. Compiler Plugins

  • KT-78969 [DataFrame] Provide source elements for plugin-generated classes
  • KT-75265 PowerAssert: the result of invoke is displayed at the same level as value that can be confusing
  • KT-78490 "AssertionError: SyntheticAccessorLowering should not attempt to modify other files" when calling protected open composable with default argument
  • KT-77626 K2: AssertionError: FUN LOCAL_FUNCTION_FOR_LAMBDA has no continuation
  • KT-78038 Make jvm-abi-gen compiler plugin output classloader-friendly
  • KT-78671 [DataFrame] Support type parameter types in DataSchema to fix evaluate expression
  • KT-78439 DataFrame compiler plugin: Unresolved reference error in REPL

Tools. Gradle

  • KT-79034 Automatically disable cross compilation if it's not supported on the host
  • KT-77023 Support creating KotlinJvmAndroidCompilation in KotlinBaseApiPlugin
  • KT-74420 Migrate kotlin-parcelize away from AGP's deprecated Variant API
  • KT-76421 Stabilize klib cross-compilation on different platforms
  • KT-78233 Add ExperimentalFeatureWarning unique id
  • KT-67992 Cleanup deprecated code required for KSP1
  • KT-72341 Remove 'kotlin-android-extensions' plugin
  • KT-67291 Enable Project Isolation AND/OR Configuration Cache mode for Gradle Integration tests
  • KT-65271 Gradle: "Mutating dependency DefaultExternalModuleDependency after it has been finalized has been deprecated " with gradle 8.6-rc-3

Tools. Gradle. Cocoapods

  • KT-79429 K/N: Cocoapods: IllegalArgumentException: "cinterop doesn't support having headers in -fmodules mode" with 2.2.20-Beta1 if explicitly not specify false for 'useClangModules'
  • KT-76035 Allow extra command line arguments in PodBuildTask
  • KT-78387 Kotlin Cocoapods Gradle Plugin is not compatible with Gradle isolated projects

Tools. Gradle. JS

  • KT-79237 Upgrade NPM dependencies versions
  • KT-75480 Add shared source set for js and wasmJs target
  • KT-77319 KJS / Gradle: generateTypeScriptDefinitions() generates wrong file extension when outputting ES modules
  • KT-78504 [2.2.0-RC3] NPM Tasks in 2.2 RCs produce broken/unusable build cache entries
  • KT-77443 NPE: "NullPointerException: Cannot invoke org.gradle.api.tasks.TaskProvider.flatMap(org.gradle.api.Transformer)": ExecutableWasm.optimizeTask is accessed before initialization
  • KT-76987 JS, Wasm: Upgrade NPM dependencies

Tools. Gradle. Multiplatform

New Features

  • KT-76446 Add kotlin-level dependency block to work the same way as commonMain/commonTest dependencies blocks

Fixes

  • KT-79559 AGP complains about configurations resolved at configuration time due to KMP partially resolved dependencies diagnostic
  • KT-69790 Report human-readable error when declared dependency doesn't support required target types
  • KT-77843 KGP fails with Gradle 9 on ProjectDependency.getDependencyProject()
  • KT-79315 Early task materialization with cross-project configuration breaks configuration due to KMP partial resolution checker
  • KT-78297 FileNotFoundException in generateMetadataFile task if non-packed=false
  • KT-78993 The value for property '*' property 'dependencies' is final and cannot be changed any further
  • KT-62294 kotlin-parcelize plugin does not support the new android kotlin multiplatform plugin
  • KT-77466 KMP - testFixturesApi and similar configurations do not affect jvmTestFixtures source set
  • KT-78433 Gradle: add tracking of the new KMP compilation scheme to FUS
  • KT-78431 Gradle: in-process metadata compiler uses deprecated K2MetadataCompiler

Tools. Gradle. Native

  • KT-74864 Enable exporting KDocs by default to ObjC
  • KT-51301 Remove ability to use Native non-embeddable compiler jar in Gradle plugin
  • KT-78838 Add default 3G max heap size for the commonizer JVM process

Tools. Gradle. Swift Export

  • KT-78385 Swift Export is not compatible with Gradle isolated projects

Tools. Incremental Compile

  • KT-60653 IC does not handle changes in inline functions objects/lambdas correctly
  • KT-78807 Changing ABI fingerprint on non-ABI changes when lambda passed to inlined function

Tools. JPS

  • KT-77347 Support file-less compatible IC approach
  • KT-78444 Clean up JPS code base

Tools. Kapt

  • KT-79138 K2: KAPT Java Stub Gen: Unresolved reference with @kotlin.Metadata in Java in 2.2.0
  • KT-79133 K2 kapt: class literal with typealias is not expanded

Tools. Maven

  • KT-77587 Maven: Introduce Kotlin daemon support and make it enabled by default
  • KT-63688 Remove JS-related stuff from kotlin-maven-plugin

Tools. REPL

  • KT-78755 [K2 Repl] Redeclaring variables does not work

Tools. Statistics (FUS)

  • KT-77755 [FUS Pipeline] Fus file format
  • KT-77995 Do not collect FUS metrics on TeamCity

Tools. Wasm

  • KT-78921 K/Wasm: don't generate empty yarn.lock file
  • KT-76842 K/Wasm: serve project sources in *DevRun tasks by default
  • KT-75714 Wasm: Move tooling NPM dependencies outside user project
  • KT-70013 .gradle/yarn and .gradle/node are part of Gradle configuration cache

Don't miss a new kotlin release

NewReleases is sending notifications on new releases.