Releases: JetBrains/kotlin
Releases · JetBrains/kotlin
Kotlin 2.3.21-RC2
Changelog
Compiler
KT-85626@JvmRecordin commonMain breaks compileCommonMainKotlinMetadata with "Cannot access 'java.lang.Record'"
Native. C and ObjC Import
KT-85508K/N: TypeCastException when using nw_parameters_create_secure_tcp block parameter on 2.3.20
Tools. Scripts
KT-85105Scripts: JVM backend internal error (IR lowering) when scratch file contains anonymous objectKT-85103Exception while generating code when explain destructuring decls
Tools. Statistics (FUS)
KT-85628KGP: composite build FUS metrics fail on access of 'configurationTimeMetrics'
Kotlin 2.3.21-RC
Changelog
Backend. Wasm
KT-84610[Wasm] Failed to compile klibs in IC mode
Compiler
KT-84678K/N: Undefined symbol from SPM-added ObjC frameworks when linking iOS targetKT-84566Prevent launching Default dispatcher threads from IJ SDK in kotlin compilerKT-85021False positive SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC error in multi-module project
JavaScript
KT-82395Support top-level declarations from compiler plugins in JS incremental compilationKT-84633Kotlin/JS: "Serializer for class not found" error when IR output granularity iswhole-programKT-85047Kotlin/JS:@JsStaticon suspend fun of class companion generates incorrect d.tsKT-84517K/JS: bad mappings data in outputted Kotlin stdlib source map
Libraries
KT-71848Kotlinx.metadata: AddCompilerPluginDatainto Km API
Tools. Gradle
KT-84729Update Gradle plugin-publish version to enable configuration cache badge on Gradle plugins portal
Tools. Gradle. Compiler plugins
KT-85257AGP/Compose: MergeMappingFileTask clears R8 artifacts due to@OutputDirectoryannotation on AGP 9.1+
Tools. Scripts
Kotlin 2.4.0-Beta1
Changelog
Analysis API
KT-83867OVERLOAD_RESOLUTION_AMBIGUITY false positive with assertEquals in IJ repoKT-83723[Analysis API] Enable experimental KDoc resolver by defaultKT-83388Analysis API: properly support KMP in KotlinPackageProvider
Analysis API. Code Compilation
KT-78946Evaluation of variable with local class in type parameter leads to InventNamesForLocalClasses exception
Analysis API. FIR
KT-84711K2 IDE sometimes loses FIR plugin-generated declarations after file changesKT-84596Improve K2 Jooq completion performanceKT-84525KaValueParameterSymbol#getHasSynthesizedName returns false for FirDeclarationOrigin.SubstitutionOverride.DeclarationSiteKT-68260K2 AA: InvalidFirElementTypeException “For CALLABLE_REFERENCE_EXPRESSION with text::lam1, unexpected element of type: no element found” with illegal callable reference callKT-83546Kotlin analysis reach ClsCustomNavigationPolicyKT-84259Move CommonDefaultImportsProvider to the frontend independent moduleKT-82945Analysis API: KotlinIllegalArgumentExceptionWithAttachments: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImplKT-71135AA: exception from sealed inheritors checker whenanalyzeCopy
Analysis API. Infrastructure
KT-84776The test data manager misses the redundancy check in the update modeKT-84962The test data manager misses -ea flagKT-84388Preserve the EOF status in the test data manager to avoid extra changesKT-83905Analysis API: Improve UX with test dataKT-84362Analysis API tests produce many warnings due to "not yet loaded registry"KT-84279Test Data Manager fails on a clean buildKT-83913Exclude compiler-based Analysis API tests from Git trackingKT-80379Extract per-module test generators for AA testsKT-84120Move CLI modules out of kotlin-compiler-fe10-for-ideKT-83200Track external dependencies of the Analysis API modules
Analysis API. Light Classes
KT-82434Light classes should prefer enum entries to propertiesKT-84200SLC: return type is not boxed for delegated methods with generic original methodKT-72451"CCE: class PsiPrimitiveType cannot be cast to class PsiClassType" with same-named enum class and typealias
Analysis API. PSI
Analysis API. Providers and Caches
KT-82731Analysis API: Limit granular tree change processing to a few filesKT-79234Analysis API: Usage ofasMap()on Caffeine caches bypasses stats countersKT-74090Analysis API: Support dumb mode (restricted analysis)
Analysis API. Standalone
KT-83801Nested typealiases are not correctly indexed in standalone mode
Analysis API. Surface
New Features
Fixes
KT-84397KtDefaultAnnotationArgumentReference should return only results with value nameKT-84804buildSubstitutor does not work correctly with Java type parametersKT-84389Cover references with ABI and documentation checksKT-57042K2, Analysis API: KaJavaInteroperabilityComponent#callableSymbol returns null for a Java getter implementing Kotlin propertyKT-80856Analysis API:analysisContextModuleincorrectly determines the module of an original file when used for dangling file context assignmentKT-84363AA, isUsedAsExpression: Unhandled Non-KtExpression parent of KtExpression: class org.jetbrains.kotlin.psi.KtContractEffectKT-70476Analysis API: "KtDefaultAnnotationArgumentReference.resolveToSymbols" does not work in FIR implementationKT-68499Split KtDefaultAnnotationArgumentReference on K1 and K2 implementationKT-70521Analysis API: Impossible to distinguish between 'iterator' operator calls dispatched with imports from objectsKT-77669Context arguments are missed on implicit invoke callsKT-77670resolveToCall: extensionReceiver is incorrectly chosed due to a conflict with context parameters for an implicitinvokecallKT-68633K2 AA: IAE "Expected class KaClassSymbol instead of class KaFirEnumEntrySymbol" with enum entry initializerKT-79186KtCompletionExtensionCandidateChecker does not work for extensions when using callable references of a typeKT-83777Analysis API: The resolution scope of a context module accepts elements from associated dangling filesKT-82571No expected type for overridden property without explicit typeKT-83759Analysis API: Mark platform interface APIs with@KaPlatformInterfaceKT-83223Support "Explicit context arguments" in the Analysis APIKT-65186K2: Analysis API: KtExpressionTypeProvider.getExpectedType works incorrectly for the right hand side of assignment expressionsKT-76011KaFirNamedClassSymbol#companionObjectdoesn't provide generated objects generated by compiled pluginsKT-73290Analysis API: Improve the architecture of content scopes and resolution scopes
Backend. Native. Debug
KT-83804Native: debug information generator converts relative paths to absolute ones
Backend. Wasm
KT-83162K/Wasm: renaming temporary and synthetic variables in the Chrome debuggerKT-85008Develop and publish a demo app using an early version of the component model supportKT-65030K/Wasm: memory allocator for Component Model ABIKT-83607WasmJS: Production build eliminates 'else if' branch when 'else' is not wrapped with curly bracesKT-83728[Wasm] Invalid Ir type while suspend call with blocked if null comprehansionKT-82803Kotlin/WASM: Failed to compile the doResume function with if inside catch blockKT-83800[Wasm] Closed world per-module compilation
Compiler
New Features
KT-84319Add JVM target bytecode version 26KT-83165Collection literals: treat Deprecated(HIDDEN) operatorsofreasonablyKT-84487"-Xcollection-literals" compiler flagKT-84072Collection literals: treat visibility ofofduring resolve correctlyKT-80500Collection literals: AnalyzeConeCollectionLiteralAtomin cases their expected type is not fully knownKT-80491Implement fallback mechanism for collection literalsKT-80490Implement overload resolution mechanism for collection literalsKT-84484Companion Extensions Analysis & ResolutionKT-84199Imple...
Kotlin 2.3.20
Changelog
Analysis API. FIR
New Features
KT-78090Implement stubs support for new conditional returns and holdsIn contracts
Fixes
KT-82948'FirRegularClass' expected as a containing declaration, got 'FirTypeAliasImpl'KT-83467Package-level JSpecify annotations are ignored when coming from jars or librariesKT-82057K2. Cannot infer type parameter 'R' in Ktor routing post() function with explicit response typeKT-82846AA: unresolved KtExpression.expressionType for the reference to the parameter with default valueKT-80485False positive UNRESOLVED_REFERENCE on nested interface from super-super class in the super type position inside an anonymous objectKT-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-83173Analysis API Tests: Library names with RC versions aren't sanitisedKT-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-83694Provide psi-based implementation ofKaDeclarationSymbol#isExternalKT-70868KaSymbol: support PSI-only visibility and modality for the case without compiler pluginsKT-81627KaFirSymbolDeclarationOverridesProvider#processOverrides should process only relevant declarations
Fixes
KT-83152[Analysis API, KDoc] Make class name links on constructors point to the classKT-83695DeprecateKaSymbolInformationProvider#{getter, setter}DeprecationStatusKT-82853Add a convenience property for testing declarations for effective external-nessKT-83226Support "Collection literals" in the Analysis APIKT-83225Support "@IntroduceAt" in the Analysis APIKT-83222Support "Improve use-site defaulting for annotations" in the Analysis APIKT-83351Rename KaSession context parameter from 's' in bridges to something nicerKT-83199Clarify API around extension pointsKT-83074Inner enum entry class has incorrect default visibilityKT-82442Add Ka prefix to org.jetbrains.kotlin.analysis.api.symbols.AdditionalKDocResolutionProviderKT-82443Add Ka prefix to org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRendererKT-82441Add Ka prefix to org.jetbrains.kotlin.analysis.api.compile.CodeFragmentCapturedValueKT-82439Add Ka prefix to org.jetbrains.kotlin.analysis.api.components.DebuggerExtensionKT-82438Add Ka prefix to org.jetbrains.kotlin.analysis.api.components.DefaultTypeClassIdsKT-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 haveKaprefixKT-78397investigate if there is a need in Extra support for the "various little features in contracts"KT-74009Analysis API: Expose "isOverloadable" check for callable symbols similar to "OverloadChecker.isOverloadable"KT-78399Check return value - check how we see from Java(+Stub) we see “annotated” signaturesKT-80357[Analysis API]KaType.enhancedTypedoesn't enhance type parametersKT-73659Analysis API: The name ofKaType.enhancedTypeis too generalKT-80545[Analysis API] DeprecateKaFunctionType.arityKT-77708K2 Mode: Potentially redundant smart cast highlighing when passing smartcasted expressions as argumentsKT-81264K2 AA:KaValueParameterSymbol.hasDefaultValueis false for overriding or actual functionsKT-81166Forbid the usage of KaSessionComponent implementation types directlyKT-74801Analysis API: Publish/subscribe to modification events with a single message bus topic
Backend. Native. Debug
Kotlin 2.3.20-RC3
Kotlin 2.3.20-RC2
Changelog
Compiler
KT-84620Incorrect optimization of property delegationKT-81974Do not eagerly initialize reflection for KProperty objects for delegated properties
JVM. Reflection
KT-84600Performance regression around Kotlin properties JVM reflection during instantiation
Tools. Build Tools API
KT-84577BTA: API 2.3.20 incompatible with compiler 2.3.10
Tools. Compiler plugins. Compose
KT-84218[2.3.20-Beta1] "IllegalStateException: no implementation for FUN MISSING_DECLARATION" during bitcode lowering
Tools. Gradle
KT-84152Memory Leak and OOM Errors in Kotlin Gradle Plugin 2.3.20-Beta2 within-processexecution mode
Kotlin 2.3.20-RC
Changelog
Backend. Wasm
KT-82649K/Wasm: Rewrite StringBuilder to use JsStringKT-83995K/Wasm: 2.3.0 -> 2.3.20-Beta1 degradation in arrow testsKT-83839K/Wasm: CMP. Load time on Safari significantly increased with Kotlin = 2.3.20-Beta1
Compiler
KT-83372compileDebugKotlinAndroid hangs in 2.3.0 with SQLDelightKT-83849False-positive NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS forOptional.orElse(null)callKT-84192"Member overrides different '@Throws' filter from" caused by overriding in different moduleKT-83697Native: increased bitcode produced with enabled safe castsKT-83984Data races around kotlinx.serialization plugin protobuf extensions registrationKT-83031K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused codeKT-83824Delegated property in Gradle DSL fails to compileKT-81700flaky overload resolution behaviors (false-positive errors, different final candidates, compile-time failures)KT-78443Refactor session component initialization for multi-target compilation
Compose compiler
b/481953005,b/481769383Cache stability inference results during sessionb/481735904Fix Compose codegen crash in inline functionb/479646393Add groups to inline functions with two or more inline parameters
JavaScript
KT-83572KJS/Wasm: Cannot access@JsModule-declared class from non-modular projectKT-84134KJS/CMP: "IrLinkageError: Function 'get' can not be called: No function found for symbol"KT-64951Kotlin-Multiplatform does not allow JSExport of expect
Klibs
KT-84273[Klib] Added IrOffsetsChecker broke backward klib compatibility
Native
KT-83542Switch the default GC back to PMCS in 2.3.20-RC
Native. ObjC Export
KT-83736Objective-C export withobjcExportBlockExplicitParameterNamesgenerates invalid block signature when lambda parameter is namedid
Tools. Build Tools API
KT-83971BTA: OperationCancelledException cannot be thrown properly from isolated classloader
Tools. Compiler plugins. Compose
KT-84055Reference to lambda in lambda in function 'TextField' can not be evaluated
Tools. Gradle
KT-82885Run tests against Gradle 9.3.0
Tools. Gradle. Multiplatform
Kotlin 2.3.10
Changelog
Compiler
KT-83984Data races around kotlinx.serialization plugin protobuf extensions registrationKT-83317ClassCastException: with cast kotlin.UInt to java.lang.Number when defining constantKT-83031K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused codeKT-81700flaky overload resolution behaviors (false-positive errors, different final candidates, compile-time failures)KT-83983Revert of KT-83081KT-83314JSpecify@NullMarkedchanges Java equals(Object) to equals(Any?) causing override conflict in Kotlin 2.3KT-82863@NoInferregression since 2.2.20KT-82841"kotlin.NoWhenBranchMatchedException" inwhenwith!ischeck & non-sealed class in the middle of hierarchy
JVM. Reflection
KT-83608Kotlin-reflect: "Unknown origin of public abstract operator fun invoke(p1: P1, p2: P2): R"KT-83361"KotlinReflectionInternalError: Type parameter not found: 0" on super types with Kotlin 2.3.0KT-42199"KotlinReflectionInternalError: Unknown origin of public abstract operator fun invoke" on function reference to FunctionN.invokeKT-81024Reflection: New KType implementation fails on arguments comparison for a Nothing type parameter
Tools. Compiler Plugins
KT-83266"Unsupported class file major version 69" for "produceReleaseComposeMapping" task with Kotlin 2.3KT-83099Compose compiler does not generate stack trace mappings for project files
Tools. Gradle
KT-83070The KGP api reference is missing a descriptionKT-82459Improve iOS simulator boot implementation
Tools. Gradle. JS
KT-82946Js, Wasm: Upgrade NPM dependencies
Tools. Gradle. Multiplatform
KT-83687Revert deprecation of 'androidTarget' for AGP lower than 9
Kotlin 2.3.10-RC2
Kotlin 2.3.20-Beta2
Changelog
Analysis API. FIR
KT-83467Package-level JSpecify annotations are ignored when coming from jars or librariesKT-82846AA: unresolved KtExpression.expressionType for the reference to the parameter with default value
Analysis API. Infrastructure
KT-83173Analysis API Tests: Library names with RC versions aren't sanitised
Analysis API. Surface
Performance Improvements
KT-83694Provide psi-based implementation ofKaDeclarationSymbol#isExternalKT-70868KaSymbol: support PSI-only visibility and modality for the case without compiler plugins
Fixes
KT-83152[Analysis API, KDoc] Make class name links on constructors point to the classKT-83695DeprecateKaSymbolInformationProvider#{getter, setter}DeprecationStatusKT-82853Add a convenience property for testing declarations for effective external-nessKT-83226Support "Collection literals" in the Analysis APIKT-83225Support "@IntroduceAt" in the Analysis APIKT-83222Support "Improve use-site defaulting for annotations" in the Analysis APIKT-83351Rename KaSession context parameter from 's' in bridges to something nicerKT-83199Clarify API around extension pointsKT-83074Inner enum entry class has incorrect default visibilityKT-82442Add Ka prefix to org.jetbrains.kotlin.analysis.api.symbols.AdditionalKDocResolutionProviderKT-82443Add Ka prefix to org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRendererKT-82441Add Ka prefix to org.jetbrains.kotlin.analysis.api.compile.CodeFragmentCapturedValueKT-82439Add Ka prefix to org.jetbrains.kotlin.analysis.api.components.DebuggerExtensionKT-82438Add Ka prefix to org.jetbrains.kotlin.analysis.api.components.DefaultTypeClassIds
Backend. Wasm
KT-67461Use new lowering phase creation API in Wasm backendKT-83664Wasm: Colon and space are not sanitized in output file namesKT-82309K/Wasm: refactor _initialize functionKT-65779JsExport declaration name clashKT-83025Wasm: Compose application is not loading
Compiler
New Features
KT-55548JSR-305: Overload resolution ambiguity: Platform Types vs Kotlin TypesKT-74860Support Unit coercion (incl. fun refs) in unused return value checkerKT-83401Collection literals: support different types of expected types for CLKT-80492Checkers for operatorofKT-82638Collection literals: resolve to factory functions for standard library classesKT-82655Bridges generated for non-fake overrides shall include annotations from target methodsKT-75736Enable reading/writing annotations in metadata on JVM by default
Performance Improvements
KT-83036Native: too many casts emitted with -Xgeneric-safe-casts=trueKT-73687Inefficient KtCommonFile#getFileAnnotationList
Fixes
KT-83031K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused codeKT-78443Refactor session component initialization for multi-target compilationKT-82579Update specificity rule for context parametersKT-83427Arguments of plugin-generated annotations are serialized incorrectlyKT-83395Kotlin/Native 2.3.0 iOS release framework fails with Invalid LLVM module (PHI node type mismatch)KT-83538OPERATOR_RENAMED_ON_IMPORT is not reported for 'provideDelegate' operatorKT-83537OPERATOR_RENAMED_ON_IMPORT is not reported for 'of' operatorKT-81567Add a use-site warning if a@DslMarker-marked annotation is used on entities where it is a no-opKT-83657[K/N] Pre-codegen inline produces invalid bitcodeKT-82721Inconsistent explicit backing fields behaviorKT-83317ClassCastException: with cast kotlin.UInt to java.lang.Number when defining constantKT-83314JSpecify@NullMarkedchanges Java equals(Object) to equals(Any?) causing override conflict in Kotlin 2.3KT-83589Explicit backing fields don't likely work with intersection overridesKT-83588Explicit backing field is falsely accessible from a subclass via a substitution overrideKT-78783K2: absence of warning for KTLC-284 migrationKT-83363VerifyError: "Bad type on operand stack" on multi-line suspending call with default parameter value since API version 2.4KT-83570K2: Resolve problematic IR when referencing Kotlin const from annotation in JavaKT-83362Starting from 2.3 DefaultImpls bridge functions deprecated with the level HIDDEN are no longer syntheticKT-9182Java interoperability: Overload resolution ambiguity on Java's@NotNulland primitivesKT-83633Forbid inline functional context parameters in inline functionsKT-83449compile-time IR failure on smart cast information leaking from capturing closureKT-82375AddATOMIC_REF_WITHOUT_CONSISTENT_IDENTITYwarning for any argument without consistent identityKT-83282JvmExposeBoxed: Duplicate annotation interface kotlin.coroutines.jvm.internal.DebugMetadata in class %class%$1 for suspend inline class valueKT-83367VolatileFieldsLowering may emit wrong parameter types for atomic intrinsic callsKT-83382K2: Unreachable method exit breaks MUST_BE_INITIALIZED checks for succeeding value declarationsKT-82211False positive SENSELESS_NULL_IN_WHEN with nullable varKT-83157ExplicitBackingFields: "Property with explicit backing field should be final" in 2.3.0KT-83269K2: Wrong types in IR for explicit backing fieldsKT-83324Native: problem with loops handling in types computation passKT-83241K2: "NoSuchElementException: List is empty" with top-level destructuring declaration and lambda initializerKT-82277MisleadingInapplicable candidate(s): fun <K> WHEN_CALL(vararg branches: K): Kwhen a when expression branch contains an unresolved referenceKT-80839Get rid of an obsolete -Xcompile-builtins-as-part-of-stdlib flag once previous changes are bootstrappedKT-82900Language Feature EnhancedBridgesGenerationKT-82651Do not generate self-recursive bridges in JVM backendKT-83185Kotlin repeatable annotations are incorrectly deserialized from bytecodeKT-82863@NoInferregression since 2.2.20KT-82311Header mode: Error expression when assigning function declaration to a propertyKT-81763Incorrect comparison result when using elvis ?: with nullable Long values- [
KT-83153](https://yo...