Changelog
Analysis API. Code Compilation
KT-78382
K2 IR lowering error when interface extends interfaceKT-73201
K2 IDE: Error while evaluating expressions with local classesKT-78164
Evaluator: '@JvmName
' annotations are not recognized in other modules
Analysis API. FIR
KT-72227
SOE from recursive value classKT-68977
K2 IDE: Reference to companion object through typealias in a function call does not workKT-76490
Do not load ast during the contracts phase if no contracts presentKT-72407
FirImplementationByDelegationWithDifferentGenericSignatureChecker: FirLazyExpression should be calculated before accessing
Analysis API. Light Classes
KT-78065
Support "Expose boxed inline value classes" in Light ClassesKT-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" fromFirDeclarationForCompiledElementSearcher
Analysis API. Standalone
KT-78638
Analysis API Standalone: Stdlib builtins are not indexed inSTUBS
deserialized declaration origin mode
Analysis API. Surface
New Features
KT-73473
Provide KaExpressionInformationProvider.isUsedAsResultOfLambda
Performance Improvements
KT-78526
Get rid of redundantcheckValidity
fromwithPsiValidityAssertion
Fixes
KT-78820
K2: ISE "FIR element class FirErrorExpressionImpl is not supported in constant evaluation" through RedundantValueArgumentInspectionKT-75057
Analysis API: Reference to object through typealias in invoke operator call leads to original typeKT-79042
Do not restore KaTypePointer if target kind has changedKT-72421
AA: "KtReference.resolveToSymbols" returns empty list when ASSIGN_OPERATOR_AMBGUITY error is presentKT-63464
AA: KtPsiTypeProvider#asPsiType doesn't substitute kotlin.UnitKT-75913
K2: SymbolLightLazyAnnotation evaluates arguments and replaces them with constantsKT-73184
Analysis API: KaFunctionCall.argumentMapping is unexpectedly deparenthesisedKT-78613
PSI: add binary compatibility checksKT-74013
Analysis API: Cover the API surface with@SubclassOptInRequired
annotationsKT-76614
Move the parser and lexer to a separate moduleKT-78552
KaFunctionValueParameter
is not marked asKaLifetimeOwner
KT-71152
Add back SubclassOptInRequired to classes in KaModule.ktKT-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 genericKT-65403
[WASM] RuntimeError is thrown instead of ClassCastExceptionKT-79317
[Wasm] Do not throw CCE for ExcludedFromCodegen declarationsKT-66085
K/WASM: Runtime error is uncaught withcatch (e: Throwable)
KT-66072
K/Wasm: improve how exceptions work in JS interopKT-78384
K/Wasm: Incorrect debug info of local declarations in inline function from another fileKT-71533
K/Wasm + K2: no error on KClass::qualifiedName usagesKT-72220
Wasm: Unclear exception in case of missed dependencyKT-71691
No trace on Wasm/JS if an error occurred in initializing global variables in a file with the main functionKT-69570
K/Wasm: JsExport with default parameter value compiles to invalid Wasm
Compiler
New Features
KT-78792
Report warning for redundant return in expression bodyKT-45683
Allow generics in contract type assertionsKT-71244
Incorporate existing@CheckReturnValue
annotation(s) into Kotlin's unused return value checkerKT-32313
Support contracts for operator functionsKT-76766
Warning is missing for wrong subclass checkingKT-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 / parametersKT-77839
K2: consider not creating CallableId for value parameters / variables / fields
Fixes
KT-79355
Failed to fix the problem of desugaredinc
with new reverse implies returns contractKT-79277
Implies returns contract doesn't affect the return type of the function if it is in the argument positionKT-79271
Implies returns contract doesn't impact exhaustivenessKT-79218
SMARTCAST_IMPOSSIBLE for top‑level extension‑property getter despite returnsNotNull contractKT-79220
returnsNotNull contract ignored on extension function with nullable receiverKT-79442
"Multiple annotations of type kotlin.coroutines.jvm.internal.DebugMetadata": 2.2.0-Beta1 generates broken code with JVM default suspend methods in interfacesKT-79354
IllegalStateException: Debug metadata version mismatch. Expected: 1, got 2 with compiler 2.2.20-Beta1 and stdlib 2.2.0KT-78479
IR lowering failed / Unexpected null argument for composable callKT-77401
[FIR]ParameterNameTypeAttribute.name
doesn't support@ParameterName
with compile-time constant property argumentKT-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.0KT-76477
Kotlin/Native: fix compiler performance reporting in sources->klib and klibs->binaryKT-78589
"Class does not have member field" caused by delegation from a Java to Kotlin classKT-79076
'IllegalStateException: Cannot serialize error type: ERROR CLASS: Uninferred type' with Exposed column using recursive generic typeKT-78726
Split runPsiToIr phase into runPsiToIr and runIrLinkerKT-77672
K/N: come up with a fallback strategy for the casts optimization passKT-76585
K2: RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY is not reported inside initializers of local variablesKT-79099
K2: Do not inherit inline modifierKT-76902
Omit type-use annotations from diagnosticsKT-79085
Adding-Xreturn-value-checker=full
to kotlinc causes "error: conflicting overloads"KT-58988
K2: Deprecate exposing package-private parameter of internal methodKT-77199
OPT_IN_USAGE_ERROR is still absent when calling the enum primary constructorKT-72800
K2: java.util.NoSuchElementException when introduce variableKT-79056
Add experimental language version 2.5KT-78351
Plugins: VIRTUAL_MEMBER_HIDDEN caused by FirSupertypeGenerationExtensionKT-78527
No LESS_VISIBLE_TYPE_ACCESS_IN_INLINE_WARNING is reported when a private companion object is accessed via the class nameKT-78837
linkReleaseFrameworkIosArm64: Compilation failed: An interface expected but was AnyKT-78945
CONTRACT_NOT_ALLOWED is not reported for local operator functionsKT-78944
ANNOTATION_IN_CONTRACT_ERROR is not reported for operators and property accessors with contractsKT-78943
ERROR_IN_CONTRACT_DESCRIPTION is not reported for operators and property accessors with contractsKT-78932
Contracts are allowed for open and overridden property accessorsKT-77203
FIR: Consider adding destructured type to all COMPONENT_FUNCTION_* diagnosticsKT-78805
K2: False positive METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACEKT-78651
No need to report LESS_VISIBLE_TYPE_ACCESS_IN_INLINE_WARNING in noinline default value lambdaKT-78849
K2: [Wasm, Fir2IR] Invalid smartcast on overloaded function callKT-78793
Make feature AllowEagerSupertypeAccessibilityChecks experimentalKT-78736
Missing [NOT_YET_SUPPORTED_IN_INLINE] diagnostics because of incorrect context updateKT-78324
K2: False negative [INCONSISTENT_TYPE_PARAMETER_VALUES]KT-69975
KDoc: cannot reference elements with names in backticksKT-78229
KDoc: unable to reference a method with spaces in the nameKT-78047
Render unnamed context parameters as _ instead ofKT-74621
Debugger: AssertionError on evaluating two suspending callsKT-76826
New inference error [NewConstraintError at Incorporate TypeVariable] caused by recursive generics and nullable expected typeKT-78028
"FirNamedFunctionSymbol" leaks to the error message about missing infix modifierKT-77245
Add expression name to RETURN_VALUE_NOT_USED diagnosticKT-78071
False-positive NO_ELSE_IN_WHEN after variable reassignmentKT-78068
False-positive NO_ELSE_IN_WHEN after excluding enum value with inequality checkKT-25341
NOT_YET_SUPPORTED_IN_INLINE reported over anonymous object borderKT-71134
Consider to get rid of CapturedTypeMarker.withNotNullProjection()KT-77131
getValue/setValue can be declared with more than two/three parametersKT-78452
Drop redundant frontend structures after fir2ir conversionKT-78458
Don't populate PredicateBasedProvider if no lookup predicates are registeredKT-78440
Lambda with an implicitly runtime-retained annotation is generated via invokedynamic with-Xindy-allow-annotated-lambdas=false
KT-78252
ClassCastException whenArray<Void>
used for compile-time vararg ofNothing
KT-78097
False positive NO_ELSE_IN_WHEN on sealed interface with negative is checkKT-77713
Context Parameters cause compiler generate r8 incompatible bytecodeKT-76629
K2 Mode: False positive RedundantVisibilityModifier inspection on private constructors in sealed classesKT-78429
K2: Property callable reference incorrectly smart-casted to intersection of property type and KPropertyKT-78509
Renamed for override copy functions are cached in scope instead of sessionKT-75831
K2: An extra "[VALUE_PARAMETER_WITHOUT_EXPLICIT_TYPE] An explicit type is required on a value parameter." for a missing parameterKT-78370
All the [something]Assign operators on dynamic return Unit as a typeKT-73950
K2 IDE / Kotlin Debugger: ISE “Fake override should have at least one overridden descriptor” on evaluation of local calss in presence of bystanderKT-78280
Implement the sourcelessKtDiagnostic
sKT-76543
Migrate psi2ir sources to new IR parameter APIKT-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 argumentKT-76606
Enable 'Indy: Allow lambdas with annotations' by defaultKT-78121
Report warning on function type with multiple implicit values that's annotated with DSL markerKT-61227
Definitely non-nullable types cause "Any was expected" for@Nullable
parameter
Compose compiler
b/432262806
Use classId as FirApplierInferencer tokensKT-78479
Ensure that default transform affects functions entered through a callb/400371006
Gate default parameters behind language versionsKT-78490
Fix visibility for default wrappers of protected methodsb/245673006
Specify fqName for classes and functions in build metricsb/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 classesKT-69941
RewriteDumpSyntheticAccessors
lowering to test handler after moving common Native/JS prefix to KLIB compilationKT-78137
Review & enable PL tests with enabled IR inlinerKT-78245
Synthetic Accessors incorrectly copies default valuesKT-76236
IncludeNativeInliningFacade
andJsIrInliningFacade
in all Native & JS test runnersKT-76512
Avoid usingoriginalFunction
insideFunctionInlining
KT-69457
[references] IR Inliner: References to inline functions are not inlinedKT-47521
Native & JS: Recursive inline fun calls -> StackOverflowErrorKT-76763
[Inliner] Don't use attributeOwnerId to pass info from Inliner to non-JVM backendsKT-76145
Enhance error message about poisoned KLIBs in KLIB-based compilers
IR. Tree
KT-78978
PL tests: Dropadjust*forLazyIr()
hackKT-77596
RefinereuseExistingSignaturesForSymbols
setting in IR serializerKT-76723
IR validator: Check visibilities of annotationsKT-76405
Visit annotations in IrTypeVisitor and IrTreeSymbolsVisitorKT-78033
[PL] MergeIrUnimplementedOverridesStrategy
toPartiallyLinkedIrTreePatcher
JVM. Reflection
KT-77882
kotlin-reflect: KParameter.name returns "" instead of null for anonymous context parametersKT-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 targetsKT-79222
K/JS: Allow using Long in exported declarations
Performance Improvements
KT-57128
KJS: Use BigInt to represent Long values in ES6 modeKT-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 falseKT-6675
KotlinJS: toInt() on external Long throws errorKT-79184
K/JS: Further intrinsify BigInt-backed Long operationsKT-78701
Js and Wasm: enumValueOf does not include invalid value into an exception messageKT-78316
KJS: List is not exported to TypeScript declaration if wrapped in PromiseKT-66091
KJS, WASM:AssertionError: Illegal value: <T>
in test nonReified_equality.ktKT-57192
KJS: "Exported declaration uses non-exportable return type" caused by@JsExport
Promise with Unit typeKT-61183
KJS: "AssertionError: Assertion failed" from JsSuspendFunctionsLoweringKT-59326
KJS / IR: invalid code generated when using constructor parameter nameddefault
Klibs
KT-78699
Compiler (JS, Wasm): warn about incompatible kotlin-test/compiler pairKT-78700
Compiler (JS, Wasm): Consider making diagnostics for incompatible kotlin-stdlib/compiler and kotlin-test/compiler pairs errors instead of warningsKT-76094
Support new callable reference nodes in partial linkage in Kotlin/WasmKT-78771
KLIBs: ImprovezipDirAs()
function that is used to produce KLIB (ZIP) archivesKT-78349
[Tests] Enable Partial Linkage in all testsKT-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 lambdaKT-79308
Ability to actualize empty interfaces as AnyKT-78866
Warn implicit receiver shadowed by context parameterKT-8889
Contracts: if a given function parameter is not null, the result is not nullKT-22786
Returns are not allowed for expression-body functions and are allowed when an inline lambda is addedKT-54363
Allow using reified types for catch parametersKT-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 typesKT-75977
False positive unresolved_reference when resolving nested member after a type check
Libraries
KT-79080
Annotate WasmImport and WasmExport as experimental APIKT-79121
K/Wasm annotate JS-interop API as experimentalKT-78581
Add the KClass.isInterface property to Kotlin/JS stdlibKT-78710
kotlin.wasm and kotlin.wasm.unsafe packages are missing descriptionKT-78709
Wasm: KClass.qualifiedName KDoc should reflect the behavior on the targetKT-78704
CharSequence.subSequence and String.substring behavior with invalid indices differs between targetsKT-78705
Float.sign and Double.sign behavior for negative zero is not documentedKT-74543
Support for context parameters in kotlinx-metadataKT-78340
String.startsWith KDoc declares invalid exception condition
Native
Native. ObjC Export
KT-77488
[ObjCExport] Add explicit ObjCBlock parameter name in objc exportKT-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.0KT-76851
Kotlin/Native: GC scheduler MutatorAssists requestAssists and completeEpoch issue
Native. Swift Export
KT-79227
Swift Export: Fix First Release IssuesKT-78947
Implement FUS for Swift exportKT-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 argumentsKT-78318
Unresolved reference when compiling kotlin/JS project on fresh masterKT-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 classesKT-75265
PowerAssert: the result of invoke is displayed at the same level as value that can be confusingKT-78490
"AssertionError: SyntheticAccessorLowering should not attempt to modify other files" when calling protected open composable with default argumentKT-77626
K2: AssertionError: FUN LOCAL_FUNCTION_FOR_LAMBDA has no continuationKT-78038
Make jvm-abi-gen compiler plugin output classloader-friendlyKT-78671
[DataFrame] Support type parameter types in DataSchema to fix evaluate expressionKT-78439
DataFrame compiler plugin: Unresolved reference error in REPL
Tools. Gradle
KT-79034
Automatically disable cross compilation if it's not supported on the hostKT-77023
Support creating KotlinJvmAndroidCompilation in KotlinBaseApiPluginKT-74420
Migrate kotlin-parcelize away from AGP's deprecated Variant APIKT-76421
Stabilize klib cross-compilation on different platformsKT-78233
Add ExperimentalFeatureWarning unique idKT-67992
Cleanup deprecated code required for KSP1KT-72341
Remove 'kotlin-android-extensions' pluginKT-67291
Enable Project Isolation AND/OR Configuration Cache mode for Gradle Integration testsKT-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 PodBuildTaskKT-78387
Kotlin Cocoapods Gradle Plugin is not compatible with Gradle isolated projects
Tools. Gradle. JS
KT-79237
Upgrade NPM dependencies versionsKT-75480
Add shared source set for js and wasmJs targetKT-77319
KJS / Gradle: generateTypeScriptDefinitions() generates wrong file extension when outputting ES modulesKT-78504
[2.2.0-RC3] NPM Tasks in 2.2 RCs produce broken/unusable build cache entriesKT-77443
NPE: "NullPointerException: Cannot invoke org.gradle.api.tasks.TaskProvider.flatMap(org.gradle.api.Transformer)": ExecutableWasm.optimizeTask is accessed before initializationKT-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 diagnosticKT-69790
Report human-readable error when declared dependency doesn't support required target typesKT-77843
KGP fails with Gradle 9 onProjectDependency.getDependencyProject()
KT-79315
Early task materialization with cross-project configuration breaks configuration due to KMP partial resolution checkerKT-78297
FileNotFoundException in generateMetadataFile task if non-packed=falseKT-78993
The value for property '*' property 'dependencies' is final and cannot be changed any furtherKT-62294
kotlin-parcelize plugin does not support the new android kotlin multiplatform pluginKT-77466
KMP - testFixturesApi and similar configurations do not affect jvmTestFixtures source setKT-78433
Gradle: add tracking of the new KMP compilation scheme to FUSKT-78431
Gradle: in-process metadata compiler uses deprecated K2MetadataCompiler
Tools. Gradle. Native
KT-74864
Enable exporting KDocs by default to ObjCKT-51301
Remove ability to use Native non-embeddable compiler jar in Gradle pluginKT-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 correctlyKT-78807
Changing ABI fingerprint on non-ABI changes when lambda passed to inlined function
Tools. JPS
Tools. Kapt
KT-79138
K2: KAPT Java Stub Gen:Unresolved reference
with@kotlin
.Metadata in Java in 2.2.0KT-79133
K2 kapt: class literal with typealias is not expanded
Tools. Maven
KT-77587
Maven: Introduce Kotlin daemon support and make it enabled by defaultKT-63688
Remove JS-related stuff from kotlin-maven-plugin
Tools. REPL
KT-78755
[K2 Repl] Redeclaring variables does not work