Changelog
Analysis API
KT-73337Migrate analysis sources to new IR parameter APIKT-68393Analysis API: RenameKaClassLikeSymbol. classIdIfNonLocaltoclassIdKT-62924Analysis API: rename KtCallableSymbol.callableIdIfNonLocal -> callableIdKT-63718Analysis API: Stub-based dependency symbol providers of library source sessions compute the wrong package name sets
Analysis API. FIR
Fixes
KT-76540K2: Missing library dependency on Android SDK from androidx.activity-1.8.2 causes LiveEdit failuresKT-73266K2. "Declaration should have non-local container" with unclosed annotation on top-level functionKT-76432JavaClassUseSiteMemberScope: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImplKT-76217K2 AA: "No fir element was found for KtParameter" with multiple context parameter listsKT-76366ContextCollector: annotations on class members don't have the class as implicit receiverKT-76352ContextCollector: wrong class annotation context in BODY modeKT-76341ContextCollector: support dangling modifiersKT-76332"Declaration should have non-local container" for declaration inside file annotationKT-76331Cleanup FileStructureElement for classesKT-76115DisableFirElementBuilder#getFirForElementInsideAnnotationsoptimization for files, classes and scriptsKT-76347ContextCollector: avoid resolution for enum entry annotationsKT-76272Cleanup AbstractFileStructureTestKT-75542K2 AA: "FirDeclaration was not found for class KtNamedFunction, fir is class FirErrorExpressionImpl" for unclosed annotation on member functionKT-73117K2 AA: Exception "Setter is not found" when val has a setter without bodyKT-73719K2. "FirDeclaration was not found for class KtDestructuringDeclaration, fir is class FirBlockImpl" on incorrect chain call
Analysis API. Providers and Caches
KT-74541Analysis API: Include files generated by resolve extensions inKaModulecontent scopesKT-64236Analysis API: Introduce a separate module for fallback dependencies of library source modulesKT-63780Analysis API: Invalidate resolvable library sessions when binary library modules are modified
Analysis API. Stubs and Decompilation
KT-71787PsiRawFirBuilder.Visitor#visitStringTemplateExpressionforces AST loading
Analysis API. Surface
KT-76018K2: Stop the wold leads to deadlock/freezeKT-73669Support psi-based symbol pointer for implicit primary constructorsKT-76011KaFirNamedClassSymbol#companionObjectdoesn't provide generated objects generated by compiled pluginsKT-76008Provide PSI-based implementation forKaFirNamedClassSymbol#companionObject
Backend. Native. Debug
KT-75991Xcode 16.3: Fix lldb stepping test over an inline function
Backend. Wasm
KT-76747[Wasm] Wasm name section absent for wasm structsKT-76701K/Wasm: custom formatters are not loaded when a project is built with incremental compilationKT-66081K/WASM:0/0,5/0and5%0throw not ArithmeticException, but RuntimeErrorKT-76287[Wasm] Enable stdlib and kotlin.test tests after compiler bootstrapKT-75871[Wasm] Implement new RTTI approachKT-75872Wasm / IC: IllegalStateException: IC internal error: can not find libraryKT-73362Migrate K/Wasm sources to new IR parameter API
Compiler
New Features
KT-70722Implement better Kotlin warnings for value classes and JEP 390 (Warnings for Value-Based Classes)KT-57919Store all annotations in Kotlin metadata on JVM under a flagKT-54205Support jakarta Nullability annotations
Performance Improvements
KT-76422FirJavaFacade#createFirJavaClass: do not compute super type references right away
Fixes
KT-75828Store backing field/delegate annotations and extension receiver annotations in metadataKT-76663KJS: KotlinNothingValueException caused by expression return since 2.1.20KT-76615K2: "IllegalArgumentException: Inline class types should have the same representation: Lkotlin/UByte; != B" for mixed Java/Kotlin codeKT-76805Wrong NPE occurs when assigning synthetic properties with platform types in Kotlin 2.1.20KT-76253K2 Compiler: Less precise diagnostic COMPONENT_FUNCTION_AMBIGUITY for flexible typeKT-76583CCE: suspend lambda attempts to unbox value class parameter twice after lambda suspendedKT-59526Store annotation default values in metadata on JVMKT-63850K2: setter with an annotated parameter hasisNotDefault == falseflag in metadataKT-75712-Wextra: false positive UNUSED_LAMBDA_EXPRESSION on functional type variable assignment with inferred typeKT-69624Debugger: Missing local variable in Variables view (inline function)KT-75992Xcode 16.3: stacktraces on simulators are not symbolicatedKT-76199Introduce -Xcontext-sensitive-resolution compiler flagKT-75553MISSING_DEPENDENCY_SUPERCLASSandMISSING_DEPENDENCY_SUPERCLASS_WARNINGis reported at the same time on the same elementKT-76159Obsolete error "'@JvmDefaultWithCompatibility' annotation is only allowed on interfaces" should be removedKT-76660False negative RETURN_NOT_ALLOWED in lambda in default argument leads to NoClassDefFoundError:$$$$$NON_LOCAL_RETURN$$$$$KT-76301Fail to infer types after syntactical changeKT-74999K2: KotlinNothingValueException within Extension FunctionKT-76675KIAEWA exception at KaFirDataFlowProvider with non-local return from nested inline callKT-75756Backend Internal error: Exception during IR lowering when trying to access variable from providedProperties in class within kotlin custom scriptKT-76171"KotlinIllegalArgumentExceptionWithAttachments: Expected expression 'FirSingleExpressionBlock' to be resolved"KT-76345Enhance variable fixationKT-76578[FIR, K1/K2 Regression]lateinitis allowed on loop parametersKT-76448FirOverrideChecker: class ClsMethodImpl is not a subtype of class KtNamedDeclaration for factory VIRTUAL_MEMBER_HIDDENKT-73360Migrate K/JVM sources to new IR parameter APIKT-76606Enable 'Indy: Allow lambdas with annotations' by defaultKT-74852Kotlin/Native: allow caches for thread state checker and sanitizersKT-76130IR evaluator does not support array literals in annotation parameter default valuesKT-76436Missing K2 checker: non-local return through lambda passed to inline f/oKT-74326False negative: no variable must be initialized error though code doesn't compileKT-74325Explicit API mode does not enforce explicit return types for extension propertiesKT-76572FIR_NON_SUPPRESSIBLE_ERROR_NAMES does not contain deprecation errorsKT-75704RefactorFirWhenSubjectExpressionKT-76284Flexible captured type is not approximated in receiver positionKT-76192RETURN_TYPE_MISMATCH with same expected and actual type: nullability of actual type is omittedKT-75944Allow using invokedynamic for lambdas with no 'Runtime' level retention annotationsKT-76396FirIntegerConstantOperatorScope: NoSuchElementException: Collection contains no element matching the predicateKT-76209CONFLICTING_UPPER_BOUNDS onNothingboundKT-46119NONE_APPLICABLE instead of NAMED_ARGUMENTS_NOT_ALLOWED with overloaded Java constructor callKT-75503Run lazy resolution in CallableCopyTypeCalculator and use withForcedTypeCalculator everywhere in checkersKT-76485Don't report EXTENSION_SHADOWED_BY_MEMBER if extension can be called with named argumentsKT-76154False positive "EXTENSION_SHADOWED_BY_MEMBER" when extension adds default values to parametersKT-76527False positive UNSUPPORTED_CONTEXTUAL_DECLARATION_CALL with -Xcontext-receivers and implicit invokeKT-63246K2: False positive NOTHING_TO_OVERRIDE in generic property with context receiver in non generic class extending generic classKT-58534K2: "Argument type mismatch" with typealias to context receiver functional typeKT-71481K2: drop pre-1.6 language features from compiler codeKT-74069False positive UNUSED_EXPRESSION due to Long/Int conversionKT-76381K2: Expected expression 'FirPropertyAccessExpressionImpl' to be resolvedKT-75234Add error for callsInPlace contracts on context parametersKT-73805K2: Investigate missing diagnostic in implicit invoke call on context function type with receiver from module with disabled context parametersKT-41934NI: a type variable for lambda parameter has been inferred to nullable type instead of not null oneKT-61258Kotlin/Native: CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Base]KT-75983Backend Internal error: Exception during IR lowering 'IllegalStateException: Internal error: cannot convert Any to Int'KT-76290False positive UNUSED_EXPRESSION while returning Unit in the when branchesKT-32358NI: Smart cast doesn't work with inline function after elvis operatorKT-76316K2: Missing NON_PUBLIC_CALL_FROM_PUBLIC_INLINE on object extending private class in public inline functionKT-76324Frontend diagnostic says "... this will be an error in Kotlin N.M" but N.M is already releasedKT-76058PCLA: compile-time failure on calling a higher-order function from another module inside a lambda assigned to a variable of a type with a postponed type variableKT-75457Native: cache machinery uses stdlib cache with default runtime options even if custom runtime options are supplied when partial linkage is disabledKT-75571K2: type mismatch error provides unsubstituted typesKT-31391'Recursive call is not a tail call' with elvis operator in tailrec functionKT-73420False-positiveNON_TAIL_RECURSIVE_CALLon tailrec function with elvis in the return statementKT-75169Unnecessary EXTENSION_SHADOWED_BY_MEMBER on generic declarationsKT-76339K2: Dangling modifier list is missed for enum entries in PSI modeKT-75513Avoid overrides traversal without preinitializationKT-74587Report an error when JvmDefaultWithoutCompatibility is used with -Xjvm-default=allKT-76257Annotations with class references are not supported when marking IR declarations as visible to metadataKT-71793Drop language versions 1.6 and 1.7KT-59272Incorrect bytecode generated: wrong line number table after conditionKT-69248K2: IAE “class KtDotQualifiedExpression is not a subtype of class KtCallExpression for factory ENUM_CLASS_CONSTRUCTOR_CALL” with qualified enum constructor callKT-73778Kotlin Debugger: NSFE on accessing private property from dependencies during evaluationKT-74131Incorrect line numbers for static initializer with delegated local variableKT-76320K2: PsiRawFirBuilder: import alias triggers ast loadingKT-63851K2: NosetterValueParameterin metadata for property setter with an annotated parameterKT-71002Possible inheritance from nullable type through typealiasKT-75498Forbid .declarations access from checkersKT-75112FE resolves wrong receivers order for property passed to delegateKT-75924K2. Incorrect generic type Inference "R? & Any" appears for "Add explicit type arguments"KT-75242Any use-site target can be applied to a lambda and an expressionKT-73051incorrect direction of subtyping violation in type mismatch error's message for A<X> </: A<Y> given a Tv <: Rv == C constraint from a lambda return positionKT-75090Argument type mismatch: actual type is 'SuspendFunction0', but 'SuspendFunction0' was expected when anonymous function is passed to function expecting suspend function typeKT-74956K2: No USAGE_IS_NOT_INLINABLE with compiling an inlined function callKT-75729KtPsiFactory: no type-safe way to create triple-quoted KtStringTemplateExpression
Compose compiler
New features
5f7e5d1Enabled PausableComposition feature flag by defaulte49ba7aEnabled OptimizeNonSkippingGroups feature flag by defaultb/305035807Add support for@Composablefunction references with K2
Fixes
b/409238521Fix crash when searching for ComposableLambda::invoke function on JSb/408752831Fix early return with value fromkeygroupsb/388505454Treat context parameters the same way as extension receiverb/408013789Add missing return for the default function wrappersb/405541364Realize coalescable children in the body ofkeycall
IR. Actualizer
KT-70907Actualize fake override symbols in Ir Actualizer
IR. Inlining
Fixes
KT-70916IR: Report errors on exposure of private types in non-private inline functionsKT-73155MoveMappingfromLoweringContextback toCommonBackendContextKT-76186[IR] Sanitize deserialized IR dump of anonymous classesKT-76145Enhance error message about poisoned KLIBs in KLIB-based compilersKT-75788IR inliner: Serialize preprocessed inline functions in a separate place inside KLIBsKT-71416Perform IR-level visibility diagnostics for inline functions after the first phase of inliningKT-76224[IR][Inliner] Dumb file is unsuported in IrSymbolBase.getDescriptor()KT-75793IR inliner: Stop injecting the deserialized function body to LazyIR inline functionKT-75791IR inliner:NonLinkingIrInlineFunctionDeserializershould load inline functions from a separate location in a KLIBKT-73708Use some marker in KLIBs produced with IR inlinerKT-76024[JS][IR Inliner] Partial linkage: No function found for symbol inkotlinpackageKT-75733Reorganize execution of the common prefix at 1st phase of compilationKT-75951[IR Inliner] Illegal non-local return reported by the partial linkage engineKT-75932Fix a problem with already bound symbol with public IR inline enabled
IR. Tree
KT-73189Migrate compiler sources to new IR parameter APIKT-76600Use a language feature to check error on cross-file IrGetField operations generated by compiler pluginsKT-75628IR validator: Forbid IrExpressionBody for IrFunction
JavaScript
KT-76233[JS] Extra invalid import line in testJsQualifier()KT-31493[Kotlin/JS] Can't put typealias in file marked with JsModule annotationKT-64951Kotlin-Multiplatform does not allow JSExport of expectKT-77021CompilationException: Encountered a local class not previously collected on inner classes inside anonymous objectsKT-76235[JS] Extra invalid linetmp_0.tmp00__1 = Options;in testSuspendFunction()KT-76234[JS] Extra invalid lineParentin testNested()KT-73226Migrate K/JS to new IR parameter APIKT-75254KJS: Merge AbstractSuspendFunctionsLowering from Common and JS backendsKT-75772KJS: NullPointerException caused by reference of private class with@JsExportKT-74384Support new callable reference nodes in JS backend
Klibs
KT-76061Add option for suppress warning of missing no-existent transitive klib dependenciesKT-72296Use specialized signatures for serialized local fake overridesKT-76158Drop "description" from local signaturesKT-75749KLIB: Fail with error on attempt to serialize/deserialize SpecialFakeOverrideSignatureKT-75941[IR Inliner] Abstract function is not implemented in non-abstract anonymous object
Language Design
KT-57274Allow generic argument to have explicitNothingupper bound
Libraries
New Features
KT-70456Base64: Support lineLength parameter for MimeKT-76394kotlin.time.TimeSource.asClock missingKT-31857Provide easy way to retrieve annotations for kotlinx-metadataKT-76528Instant.parseOrNullKT-76163K/N: Hide or remove CreateNSStringFromKString/CreateKStringFromNSString
Performance Improvements
KT-75647Optimized sequenceOf(T) overload is missing
Fixes
KT-72138Stabilize experimental API for 2.2KT-76831Atomic types: inconsistent behavior on JS and Wasm targetsKT-75290kotlin-metadata: deprecate hasAnnotations flag, add JVM-only hasAnnotationsInBytecode insteadKT-76193Common Atomics: 'AtomicArray.compareAndSetAt' and 'compareAndExchangeAt' docs incorrectly suggest they use==when actually they use===KT-54077Consider using SecureDirectoryStream in deleteRecursively even when Path.parent is nullKT-72866Standard library functions to work with context parametersKT-76743Add kotlin-scripting-jvm to projectsUsedInIntelliJKotlinPlugin listKT-72483Clean up redundant stdlib code for Kotlin 2.2KT-76385Remove suppression from functions to work with context parametersKT-75337Remove suppress annotations from@IgnorableReturnValueKT-72137Review deprecations in stdlib for 2.2KT-75491Non intuitive work of 'in' (contains) with String range
Native
KT-76552LLVM Update: rebase the LLVM branchKT-76662LLVM 19 update: documentationKT-56107Support Enum.entries for C/ObjC interop enumsKT-76560LLVM Update: investigate changes in filterStdargH testKT-76283LLVM Update: pass all testsKT-75829LLVM Update: port K/N on LLVM 19KT-76280LLVM Update: benchmarksAnalyzer build failed
Native. C and ObjC Import
KT-76551LLVM Update: investigate CXFile equality problem further
Tools. BCV
KT-75686Improve DSL for BCV in KGPKT-75999ABI validation filter doesn't apply excluded kotlin filesKT-75981ABI validation filter not applying excluded classes without package namesKT-76129Abi validation filtering functionality for included classes doesn't work
Tools. Build Tools API
KT-76455BTA: Compilation is always non-incremental if BTA API >= 2.2.0 is used together with BTA impl < 2.2.0
Tools. CLI
KT-76095Add JVM target bytecode version 24KT-75588[2.1.20-RC] "was compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler" warnings despite using the same compiler versionKT-75300Lenient compiler mode which generates stubs for missing actualsKT-75967Implement generation of CLI arguments in compiler using new single representationKT-75966Declare all existing CLI arguments using the new DSLKT-76498Implement JSON dumper for performance statsKT-75970Extract all non-trivial logic fromCommonCompilerArgumentsand its inheritors
Tools. CLI. Native
KT-69485Native: remove adding $llvmDir\bin to PATH on Windows
Tools. Compiler Plugins
KT-70982Deprecate declaration of atomic properties marked with@PublishedApiwith errorKT-76429Migrate kotlin-dataframe plugin to new IR parameter APIKT-76162"IllegalStateException: No mapping for symbol: VALUE_PARAMETER INSTANCE_RECEIVER" after updating to 2.1.20KT-75263PowerAssert: no additional info is displayed for 'when' with subject
Tools. Gradle
New Features
KT-75823Resources bundle with XCFrameworks for iOS
Fixes
KT-68325Add to Compiler Types DSL exceptions message possible ways of a solutionKT-74007Not all the DSL features related to kotlinOptions are deprecatedKT-54110Change deprecation level to ERROR for kotlinOptions DSLKT-74887Compatibility with Gradle 8.13 releaseKT-76951'distribution-base' plugin is only applied in Gradle 8.13KT-77011Update build regression benchmarks for 2.2.0 releaseKT-73968KotlinDependencyManagement tries to mutate configuration after it was resolvedKT-73682Compatibility with Gradle 8.12 releaseKT-74890Run Gradle integrations test against Gradle 8.13 releaseKT-74889Compile against Gradle 8.13 APIKT-76282Add missing Android Gradle plugin versions in testsKT-68597Update KGP deprecations before 2.2KT-76052Support Gradle 8.13 for Problems APIKT-73684Run integration tests against Gradle 8.12KT-76377Add integration tests for Problems APIKT-76374Investigate and fix failing tests with configuration cache in KotlinDaemonIT: testDaemonMultiproject and testMultipleCompilationsKT-76379Gradle: KotlinGradleFinishBuildHandler does not perform cleanup on configuration cache reuseKT-61911Gradle: make KGP to depend on fixated version of stdlibKT-62963Remove "kotlin.incremental.useClasspathSnapshot" property
Tools. Gradle. JS
KT-74735KGP uses Gradle internalCompositeProjectComponentArtifactMetadataKT-71879Notice of upcoming deprecation for Boolean 'is-' properties in Gradle Groovy scripts
Tools. Gradle. Multiplatform
KT-66423Configuration cache false recalculation because of Kotlin Native downloading during the execution phaseKT-74888Use 'distribution-base' plugin in KMP/JVMKT-76659Write proper diagnostics for Uklib checksKT-75808KGP: MPP with jvm target and Gradle java-test-fixtures is brokenKT-71698Remove preset APIs
Tools. Gradle. Native
KT-74953Deprecate kotlinArtifacts with a warning
Tools. Incremental Compile
KT-75883Follow-up: switch from INSTANCE heuristic to outerClass chainKT-76041Make lenient mode work with IC
Tools. JPS
KT-76495JPS: delegated Maven builds use embeddable version of kotlin-serialization compiler plugin with non-embeddable Kotlin compilerKT-60914IC misses dependency to recompile when named kt file with JvmField instructed property was replaced with an object with the same nameKT-75917Unused imports may lead to inc compilation failureKT-63707JPS: "Multiple values are not allowed for" caused by Compose
Tools. Kapt
KT-75936K2 KAPT: unsupported FIR element kinds in constant evaluationKT-76546Kapt / CLI: ""compile" mode is not supported in Kotlin 2.x" with -version flagKT-75942K2 KAPT: underscore not allowed hereKT-40485-Xjvm-default=all causes private interface methods to be generated in JVM target < 9 which is not supported in annotation processing
Tools. Maven
KT-77036Kotlin Maven plugin: ClassNotFoundException com.google.common.base.Joiner with compiler plugins in debug mode
Tools. REPL
KT-76507[K2 Repl] Delegated properties are not visible in the next snippetKT-76508[K2 Repl] Annotations on property accessors are not resolvedKT-75672[K2 Repl] Serialization plugin crashes compiler backendKT-75632Contunue deprecation of the REPL built intokotlincKT-76009[K2 Repl] Kotlin-specific imports does not work if dependency is added to the classpath after 1st snippetKT-75580[K2 Repl] Cannot access snippet properties using Kotlin reflection
Tools. Scripts
KT-76424Dependencies in main.kts not working with 2.1.20KT-76430Migrate scripting plugin to new IR parameter API
Tools. Wasm
KT-76657K/Wasm: Composite build does not work with wasm tasksKT-76656K/Wasm: Change NPM project name of wasm projectsKT-76587Wasm lock check failure says to run the JS lock upgradeKT-76161Wasm: "export startUnitTests was not found" after updating to Kotlin 2.1.20KT-76330K/Wasm: update binaryen to 123 or newer