Improved
Kotlin 2.3.20-Beta1
Changelog
Analysis API. FIR
New Features
KT-78090Implement stubs support for new conditional returns and holdsIn contracts
Fixes
KT-80485False positive UNRESOLVED_REFERENCE on nested interface from super-super class in the super type position inside an anonymous objectKT-82948'FirRegularClass' expected as a containing declaration, got 'FirTypeAliasImpl'KT-82057K2. Cannot infer type parameter 'R' in Ktor routing post() function with explicit response typeKT-82772Flaky false positive deprecation warning on PersistentMap.put in Kotlin repo in IDE modeKT-76487StdLibSourcesLazyDeclarationResolveTestGenerated.testWrappedInt is unstableKT-82618Various tests are failing with NPE in kt-master after updating the compiler on 19.11.25KT-82076Error querying members of JavaClass created for SymbolLightClassForAnnotationClass during library analysisKT-71596Include Js/Wasi checkers in AbstractLLFirDiagnosticsCollectorKT-82085No OUTER_CLASS_ARGUMENTS_REQUIRED on type parameter bound in IDEKT-81873Provide a way of including traces in phase JFR eventsKT-71929Consider leaving the non-post-compute version at EnhancementSymbolsCache.enhancedFunctions
Analysis API. Infrastructure
KT-65140LL FIR: Implement AbstractFirPsiJsDiagnosticTest for LL FIRKT-82212[Analysis API, LL FIR] Implement AbstractDiagnosticsFirWasmTest and AbstractDiagnosticsFirWasmWasiTest for LL FIR
Analysis API. Light Classes
KT-82227Value classes should expose regular static methods
Analysis API. PSI
KT-81710'KtTypeReference.getTypeText' does not account for 'suspend' modifier on suspend lambdasKT-82258Prepare PSI for migration from context receivers to context parametersKT-81074KDoc: List rendering is broken
Analysis API. Providers and Caches
KT-82449K2 IDE Analysis Freezes During Gradle Sync (Recursive Module Dependency Computation in KotlinModuleDependentsProviderBase.computeTransitiveDependents)KT-82629'collectDiagnostics' returns stale syntax error after editor fixKT-74907Analysis API: Apply platform-based library module content restrictions consistently
Analysis API. Standalone
KT-81107AA: KtSourceModuleBuilder.sourceRoots doesn't works with symbolic links
Analysis API. Stubs and Decompilation
KT-82792Stub for KtValueArgumentList inside KtAnnotationEntry should be present if it is present in psiKT-82527TypeClsStubBuilder.createFunctionTypeStub throws NullPointerExceptionKT-82558Deserialized DNN type should have a fully qualified AnyKT-81928KaArrayAnnotationValueImpl.values missing first elementKT-82139Support contracts for property accessorsKT-82198Support context parameters in contracts
Analysis API. Surface
New Features
KT-82851Property accessors should inherit KDoc from the parent propertyKT-63339Analysis API: Provide a way to extract KDoc for symbolsKT-79070KaTypeProvider: add API to build a default type with star projectionsKT-66566AA: api to create functional typesKT-66043KtTypeCreator doesn't provide a way for creating annotated types
Performance Improvements
KT-81627KaFirSymbolDeclarationOverridesProvider#processOverrides should process only relevant declarations
Fixes
KT-68577asPsiTypeandmapTypeToJvmType: leading delimiter for class in a root packageKT-81734MIssing "ARGUMENT_TYPE_MISMATCH" caused by self-referential generic typeKT-82856Redesign KotlinReferenceProviderContributor to make it extensibleKT-82615ClarifyKtReference#resolvesByNamescontractKT-82534No expected type for property accessor without bodyKT-82406Add a test to ensure that all top-level classes in the Analysis API Surface haveKaprefix
Backend. Native. Debug
KT-81741Native: stepping into data class hashCode in lldb goes to line 1
Backend. Wasm
New Features
KT-81485[Wasm] DebuggerCustomFormatters generation support for single module modeKT-81483[Wasm] Typescript generation support for single module modeKT-81484[Wasm] Dwarf generation support for single module mode
Performance Improvements
KT-81524Unnecessary Any-JsAny conversions are generated for external instanceofs
Fixes
KT-79937K/Wasm: support kotlin.js.nativeInvoke annotationKT-82202[Wasm] SourceMap generation support for single module modeKT-82162[Wasm] Run single module tests with standalone vm'sKT-81325[Wasm] Remove string pool initialiser dependent codeKT-82645K/Wasm: wasmJs use js "String" for number2String conversionKT-73238K/Wasm: stop using linear memory inside our code- Wasm: Compose application is not loading
Compiler
New Features
KT-82467Improve binary and JVM compatibility by generating bridges for abstract interface methodsKT-74223Move Kotlin/Native TestProcessor phase to the first phaseKT-13968Support vertx nullable annotationKT-79656Useorg.jetbrains.annotations.UnmodifiableViewand/ororg.jetbrains.annotations.Unmodifiableto infer read-only types for Java entitiesKT-27090Support contracts in getter and setter for top-level extension propertiesKT-81684Implement explicit passing of context arguments using named syntax [TEST_ONLY]
Performance Improvements
KT-81974Do not eagerly initialize reflection for KProperty objects for delegated propertiesKT-80061Compiler (or IDEA) hangs due to importing large Kotlin reflect functions (e.g. KFunction999999999)KT-68592Investigate performance implications of enabling -Xjvm-default for ir.tree moduleKT-71673Consider making EnhancementSymbolsCache. enhancedFunctions using simple cache
Fixes
KT-81951K2: Another false positive "Assigned value is never read" in composable functionKT-68606Argument type mismatch, despite being from the same star-projected typeKT-74051Add a Continuation for tail-call suspend functionsKT-5486Better errors for integers with leading zeroKT-83031K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused codeKT-83153Properly ignore contract statements in the Return Value Checker- Refactor session component initialization for multi-target compilation
Compose compiler
b/461766771FixIrSimpleFunction.isLegacyOpenFunctionWithDefaultb/458234821Disable Compose K1 tests on CIb/456948687Force resolution of declarations when looking up SAM functions in FIRb/445426829Add a diagnostic forkeycall with no arguments
IR. Actualizer
KT-82418KMP Separate Compilation: NPE caused by actualization of NsCalendar.getEraKT-82313ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE checks throwconflicting values in expected and actual annotations
IR. Inlining
Fixes
KT-80791classFunctionsAndFieldsWithCrossModuleInliner fails per-file with cross-module inlinerKT-80696Can not get instance of singleton 'Obj': No class found for symbolKT-81766K/N: Recursive inline expect/actual causes StackOverflowErrorKT-80953[Inliner] Eliminate excessive IMPLICIT_CAST after IR Inliner on 2nd stage.KT-82065IR inliner: Inline function's default value argument may get wrong offsets in a temporary variableKT-81753Review diagnosticReporters usage in pre-serialization lowerings- Test fails per-file with cross-module inliner
IR. Interpreter
KT-80646Enable unsigned conversion functions when bootstrapped compiler is available
IR. Tree
KT-82829IR deserializer: Don't deserialize any fake overrides from KlibsKT-80243Support Name Based Destructuring in loop with withIndex()KT-79436KLIB stdlib symbols loading: Drop all functions from SymbolFinder except for loading the whole collection of (potentially unbound) symbols by nameKT-79435KLIB stdlib symbols loading: Load symbols and and filter/map them lazily in BuiltinSymbolsBase hierarchy when accessed by IRKT-69082Migrate maps of IR elements to IR attributesKT-67457Introduce a way to simplify IR lowering phase creation
JVM. Reflection
New Features
KT-22265Support for inherited annotations
Fixes
KT-81024Reflection: New KType implementation fails on arguments comparison for a Nothing type parameterKT-57357Reflection: "KotlinReflectionInternalError" when usingcallByon constructor that has inline class parameter with nullable valueKT-82699Reflection: incorrect behavior of KFunction.isExternal for Java native methodsKT-82350Reflection: incorrect behavior of KType.javaType on a type obtained from KType.withNullabilityKT-29203KType.javaType always returns void class for local delegated propertyKT-81899Reflection: incorrect javaType for local delegated property setter return type
JavaScript
New Features
KT-54504K/JS: Support ECMAScript tagged string templatesKT-82327KJS: Export parameter names of function types if present in .d.ts filesKT-82371KJS: Generate more concrete TypeScript for members of an uninhabited enum
Performance Improvements
KT-16379KotlinJs - ArrayList get is now slow
Fixes
KT-67460Use new lowering phase creation API in JS backendKT-82667Kotlin/JS: ESM TypeScript definitions for exported nested Enums do not compileKT-82553KJS: Incorrect .d.ts generated for generic inner classesKT-82652KJS: Exported abstract inner classes can be constructed from TypeScriptKT-82542KJS: Inner class can be constructed from TypeScript without passing an outer instanceKT-82499KJS: Omit parameters in private constructors in .d.ts files- Implement exporting top-level properties in Analysis API-based TypeScript Export
Klibs
New Features
KT-83101Implement experimental KLib ABI dump parser
Fixes
KT-81466Enable KlibAnnotationsInMetadata by default in LV 2.5KT-83071Failure on Native NightlyKT-78365[PL] Change the behavior of getting name of removed functionKT-81977Klib compatibility tests: Implement sanity checksKT-81410Klib metadata: migrate to using the common annotations instead of klib-specific extensions in kotlinx-metadata-klibKT-82577Don't use KLIB resolver in the KLIB tool- K/Wasm: allow using newer stdlib with older compiler
Language Design
KT-73502Context parameters: it is not possible to declare local function with a context
Libraries
KT-78115Investigate the current situation with 22kotlin.contextstandard library overloadsKT-83026Specify compareTo behavior for BooleanKT-79093Expose FirResolvedStatus.hasMustUseReturnValue in kotlin-metadataKT-82868Restore accidentally deleted JS-specific note in ArrayList documentationKT-81563Document kotlin.collections.HashMap and HashSetKT-82363AddassertIsto the list of ignorable functions- Document kotlin.collections.ArrayList
Native
KT-81828Update exception messages regarding disabling native cacheKT-75806KN Compiler with debug build can not produce executable with debug infoKT-81495Consider making Kotlin/Native distribution compiler cache reproducibleKT-82387Kotlin <-> Xcode compatibility issueKT-81501Make Kotlin/Native distribution runtime .bc and fingerprint reproducibleKT-80790'Argument list too long' error when using dynamic_caches- ExceptionInInitializerError when configuring Gradle project with kotlin-multiplatform plugin on a host unsupported by Kotlin/Native
Native. Build Infrastructure
KT-82886KonanTarget's clinit causes deadlockKT-81345Temporary turned off Swift Export execution testsKT-80869Extract per-module test generators for Native testsKT-82028Kotlin/Native: move runtime building flags to runtime building codeKT-81500Make Kotlin/Native distribution shared libraries reproducibleKT-72011Kotlin/Native: consider building platform libraries with bootstrap compiler- Kotlin/Native: build stdlib with the bootstrap compiler
Native. C and ObjC Import
KT-79741Native: implement type checking against Objective-C protocols withoutprotocolGetterKT-83039Native: mark header-defined functions and globals unavailable with-Xccall-mode directKT-82200Native: implement type checking against Objective-C protocols withobjc_runtime_namewithoutprotocolGetterKT-82669Kotlin/Native: cinterop tests failure with no class for metaclassKT-79742Native: import C global variables without C wrappersKT-81937Native: switch cinterop to by default for custom cinterop klibs
Native. ObjC Export
KT-82160K/N: bridge for fake override is not built but requestedKT-83014Native: experimental support for generating an NS_ENUM in addition to an Objective-C class for Kotlin classesKT-76637ObjCExport: K1 + K2 integration test
Native. Runtime
KT-82077Kotlin/Native: in runtime make main module depend on mm module
Native. Runtime. Memory
KT-81152Kotlin/Native: deprecate isMemoryLeakCheckerActiveKT-81156Kotlin/Native: deprecate forceCheckedShutdown
Native. Swift Export
KT-82908Swift Export: bridges for FT should be recursiveKT-82907Swift Export: attributes are not printed for parameters of closuresKT-80971Swift Export: Support exception throwingKT-80970Swift Export: Support cancellationKT-82726Swift Export: filters out wrong module for coroutinesKT-81591Custom type translation rules in Swift export- K/N - Build fails when exposing suspend functions
Tools. BCV
KT-80747Refactor API of ABI tools [ABI Tools]KT-80938Binary compatibility validation: can't exclude container types of Repeatable annotations byfilters.excluded.byNames
Tools. Build Tools API
New Features
KT-81845Add CRI <-> Maven integrationKT-81847Add CRI <-> BTA integrationKT-80338Kotlin CRI generationKT-80681BTA: introduce a special argument for passing compiler pluginsKT-82167Add BuildTimeMetric for the CRI data generationKT-81846Add FUS for CRI usage in Gradle / Maven
Fixes
KT-82682BTA: reading non-nullable arguments may return null or throw NPEKT-81887Implement the CRI lookup data generationKT-81886Implement the CRI data serializationKT-81780Add Gradle <-> CRI integration testsKT-81645BTA prints unreadable version in "option available only since" error (shows KotlinReleaseVersion@hashinstead of 2.x.y)
Tools. CLI
KT-73606Provide a unified interface for managing the reporting of compiler warningsKT-48419Using a@RequiresOptInAPI that does not exist should have an option to not output a warningKT-81861Introduce a mechanism that allows suppressing CLI diagnosticsKT-82321KMP Separate Compilation: Common fragments are missing forward declaration symbol providersKT-81898Introduce a CLI option to disable source file sortingKT-81551Introduce an experimental CLI option for enabling local type aliases- Remove patched copy of com.intellij.util.lang.JavaVersion from the Kotlin repo
Tools. CLI. Native
KT-64509Refactor Kotlin/Native compiler setup: run FE without KonanConfig
Tools. Compiler Plugin API
KT-82809[FIR][IC] New containingFileName parameter API is not actually compatible with ICKT-46709IR plugin lookups don't work as expected for expect class with actual typealiasKT-82518Disable automatic body generation of the plugin-generated callablesKT-82159[FIR] Automatically add expressions to properties or functionsKT-58886K2: compiler plugin generated top level declarations cause AssertionError on K/JS and K/Native
Tools. Compiler Plugins
KT-82341Migrate official compiler plugins to IC-safe reference... APIKT-81604Lombok Kotlin compiler plugin and -Werror: Unable to ignore warning for the plugin applianceKT-71893Support@Builderlombok annotation on methods
Tools. Compiler plugins. Serialization
KT-82351Migrate kotlinx.serialization to IC-safe reference... APIKT-76949Serialization: "IllegalStateException: Serializer for element of type kotlin.Any has not been found" on custom serializer forMap<String, Any?>KT-73107Serialization: "IllegalStateException: Serializer for element of type kotlin.Any? has not been found" with star projection
Tools. Gradle
New Features
KT-78200Gradle: enable JVM compilation through BTA by defaultKT-81844Add CRI <-> Gradle integration
Fixes
KT-80096Strange "Inconsistent JVM Target Compatibility" warningKT-81831Verify Problems API implementation with Gradle guidelinesKT-80120Support colored value for --console command in Gradle 9.1KT-81400ToolingDiagnosticFactory: check if documentationLink set multiple timesKT-83070The KGP api reference is missing a descriptionKT-82459Improve iOS simulator boot implementation- Deprecate LanguageSettings.enableLanguageFeature DSL
Tools. Gradle. BCV
KT-80674Rename tasks to avoid usinglegacyword [ABI Validation]KT-80827Delete DSL for working with dump variants [ABI Validation]KT-80823Stabilize DSL for filtering [ABI Validation]
Tools. Gradle. Cocoapods
KT-80641EXECUTABLE_DEBUG_DYLIB_PATH problemKT-80644Cocoapod plugin builds a synthetic project for "generic/platform=iOS Simulator"
Tools. Gradle. JS
KT-82946Js, Wasm: Upgrade NPM dependencies
Tools. Gradle. Multiplatform
KT-81944Legacy KMP Android uses wrong configurations to infer common dependenciesKT-81536"Couldn't resolve dependency in 'commonMain' for all target platforms" in 2.2.20-Beta2KT-81724IntelliJ successfully resolves imports that are not actually available in the given moduleKT-81849Replace kotlin-test-common and kotlin-test-annotations-common with just kotlin-testKT-79073compileTest* tasks pass separateCompilation parameters but don't behave accordinglyKT-71130Enable Isolated Projects support by default for KMP
Tools. Gradle. Native
KT-80715Deprecatekotlin.native.cacheKindand introduce DSL insteadKT-81443ConfigurationCacheErroron Linux arm64 due to disabled iOS targets
Tools. Gradle. Swift Export
KT-82727Swift Export: generated kotlin bridges don't see neighboring modules
Tools. Gradle. Wasm
KT-82525K/Wasm: kotlinToolingSetup does not depend on package manager installation
Tools. Incremental Compile
KT-80483Incorporate IC lookups intoreference...methods ofIrPluginContext
Tools. JPS
KT-76927Switching from VAL to VAR does not trigger recompilation of usage in Kotlin-uses-KotlinKT-79362JPS/NoArg: Failed to build project with 'java.lang.NoClassDefFoundError: org/jetbrains/kotlin/com/intellij/psi/PsiElement'
Tools. Kapt
KT-82338K2 KAPT: ISE "Cannot evaluate IR expression in annotation" on unresolved enum usageKT-81691K2: KAPT: "ClassCastException: IrErrorTypeImpl cannot be cast to class IrSimpleType"
Tools. REPL
KT-82575[K2 REPL] Redesign frontend resolution for REPL snippets
Tools. Scripts
KT-81679Script explain: while loop explanation may lead to the hanging codeKT-81677Script explain: Contents of the if/when branches are not explainedKT-67063LauncherReplTest flaky on Windows
Tools. Statistics (FUS)
KT-79576Included build subprojects produce FUS files with unknown_id when configuration cache is enabled