Releases: JetBrains/kotlin
Releases Β· JetBrains/kotlin
Kotlin 2.1.20-Beta1
Changelog
Analysis API
KT-71907K2 debugger evaluator failed when cannot resolve unrelated annotationKT-57733Analysis API: Use optimizedModuleWithDependenciesScopes in combined symbol providersKT-69128K2 IDE: "Unresolved reference in KDoc" reports existing Java class in reference to its own nested classKT-71613KaFirPsiJavaTypeParameterSymbol cannot be cast to KaFirTypeParameterSymbolKT-71741K2 IDE. Classifier was found in KtFile but was not found in FirFile inlibraries/tools/kotlin-gradle-plugin-integration-tests/build.gradle.ktsinkotlin.gitand broken analysisKT-71942Need to rethrow Intellij Platform exceptions, like ProcessCanceledExceptionKT-70949Analysis API: "containingDeclaration" does not work on nested Java classes in K2 implementationKT-69736K2 IDE: False positive resolution from KDoc forvalueKT-69047Analysis API: Unresolved KDoc reference to extensions with the same nameKT-70815Analysis API: Implement stop-the-world session invalidation
Analysis API. Code Compilation
KT-71263K2 evaluator: Error in evaluating self property with extension receiver
Analysis API. FIR
Performance Improvements
KT-73017Analysis API:FirReferenceResolveHelper.getSymbolsByResolvedImportsearches for classes even when the selectedFqNameis a known packageKT-72025FileStructureElement: reduce redundant resolve
Fixes
KT-72148K2: KISEWA: Expected FirResolvedArgumentList for FirAnnotationCallImpl of FirValueParameterImpl(DataClassMember) but FirArgumentListImpl foundKT-66132K2: FirRegularClass expected, but FirFileImpl found | Containing declaration is not foundKT-72196K2. KMP. IllegalStateException: expect-actual matching is only possible for code with sourcesKT-72652FirProvider#getContainingClassshould supportFirDanglingModifierSymbolKT-73105Lazy resolve contract violation (BODY_RESOLVE from BODY_RESOLVE)KT-66261K2: Analysis API: "FirDeclaration was not found for class org.jetbrains.kotlin.psi.KtProperty, fir is null" with MULTIPLE_LABELS_ARE_FORBIDDEN K2 errorKT-72315K2. KIWA on usage of always-true OR in guard conditionKT-65707K2 IDE: unresolved calls of callables imported with typealias as qualifierKT-61516K2: Provide an LL FIR implementation forgetContainingClassSymbol(inFirHelpers)KT-72853Expected FirResolvedArgumentList for FirAnnotationCallImpl of FirContextReceiverImpl(Source) but FirArgumentListImpl foundKT-64215K2: do not resolve type annotations of receiver if it is used as an implicit return typeKT-64248K2: do not resolve type annotations of context receiver if it is used as an implicit return typeKT-72821Add assertion to diagnostic tests to check that all declarations have BODY_RESOLVE phase at the endKT-64056K2: K2: FirLazyBodiesCalculator shouldn't calculate annotation arguments on type phaseKT-71651K2 IDE: False positive NON_LOCAL_SUSPENSION_POINT in suspend function callKT-72164K2. IllegalArgumentException when pre and post increment are used simultaneously in assignmentKT-71174Illegal scope usedKT-72407FirImplementationByDelegationWithDifferentGenericSignatureChecker: FirLazyExpression should be calculated before accessingKT-72228K2: Reformat doesn't work in project with Kotlin2.0.21KT-72308getOrBuildFir returns null for this expression for plusAssign operatorKT-71348K2: KotlinIllegalStateExceptionWithAttachments: 'By now the annotations argument mapping should have been resolved' during code inspectionKT-72024FirClassVarianceChecker: Expected FirResolvedTypeRef with ConeKotlinType but was FirImplicitTypeRefImplWithoutSourceKT-71746K2 IDE.ISE: Zero or multiple overrides found for descriptor in FirRegularClassSymbol serializing/ExternalSerializerand red code on@Serializer(forClass) ` usage
Analysis API. Infrastructure
KT-72922KotlinFakeClsStubsCache project leakageKT-71988Improve scripts test coverage by LL FIRKT-64687K2: Analysis API: migrate AbstractFirLibraryModuleDeclarationResolveTest to kotlin repo
Analysis API. Light Classes
KT-66763K2: Get rid of context receivers in Analysis API and LL APIKT-71781SLC: migrate SLC from KotlinModificationTrackerService to KotlinModificationTrackerFactoryKT-67963K2: PsiInvalidElementAccessException on redeclaration of class with constructorKT-71407K2: Do not report@JvmFielddefault value as PsiField initializer in K2KT-72078K2 PSI change for constructor parameter with value class type
Analysis API. Providers and Caches
KT-73395Analysis API:JavaElementPsiSourceWithSmartPointercontains strong references to PSIKT-72390Kotlin project full of red codeKT-72388KaFirStopWorldCacheCleaner: Control-flow exceptionsKT-72644"PSI has changed since creation" reason is misleading
Analysis API. Standalone
KT-70346Analysis API Standalone: Remove the custom class loader option in Standalone session creation
Analysis API. Stubs and Decompilation
KT-69398K2 IDE: SOE on editing top level private variable nameKT-72897Analysis API: Smart PSI element pointers forKtEnumEntrystubs cannot be restoredKT-71565KtClassOrObject should use isLocal from greenStub
Analysis API. Surface
New Features
KT-70301Analysis API: 'KaSamConstructorSymbol' does not allow to find the constructed SAM typeKT-68236Analysis API: addisExternalproperty for KtPropertySymbolKT-68598Analysis API: missed getClassLikeSymbolByClassId API
Performance Improvements
KT-60486Analysis API: optimize KaExpressionTypeProvider.returnType for simple cases
Fixes
KT-72099Analysis API: implement an API to retrieve default importsKT-70356analyzeCopy with IGNORE_SELF cannot find private membersKT-66783Analysis API:KtFirSymbolProvidercreates symbols when given PSI from unrelated modulesKT-72937Migrate KaFirReceiverParameterSymbol to KaFirSymbol/KaFirKtBasedSymbolKT-70243K2 IDE: PsiMethod.callableSymbol returnsnullfor constructorKT-66608SupportOperatorFunctionChecks#isOperatorin AAKT-73068Analysis API: AKaFirJavaFieldSymbolfor a static Java field is open instead of finalKT-73055Get rid of the deprecated Analysis API APIKT-65065ProvideKtTypeReference#getShortTypeText()KT-63800AA: this reference shortener doesn't simplify labelKT-72793Analysis API: 'expressionType' returns raw type for typealiased constructors calls- [
KT-72658...
Kotlin 2.1.0
Changelog
Analysis API
New Features
KT-68603KotlinDirectInheritorsProvider: add an option to ignore non-kotlin results
Performance Improvements
KT-70757Performance problem in KaFirVisibilityChecker for KaFirPsiJavaClassSymbol
Fixes
KT-70437Class reference is not resolvableKT-57733Analysis API: Use optimizedModuleWithDependenciesScopes in combined symbol providersKT-72389K2: False positive "Redundant 'protected' modifier" for protected property inside protected constructor from private or internal classKT-69190K2: False-positive "redundant private modifier"KT-64984Analysis API: Support Wasm targetKT-70375K2: NPE at org.jetbrains.kotlin.analysis.api.fir.symbols.KaFirNamedClassSymbolBase.createPointerKT-71259K2 evaluator: Invalid smart cast info collecting for Code FragmentsKT-69360Lack of implicit receiver for the last statement under lambda in scriptsKT-70890Analysis API: Experiment with weak references to LL FIR/analysis sessions in session cachesKT-70657Analysis API: Inner types from classes with generics are incorrectly represented by the compiled jarsKT-71055Suspend calls inside 'analyze()' break the block guaranteesKT-70815Analysis API: Implement stop-the-world session invalidationKT-69819K2 IDE: LHS type in callable references is unresolved when it has type arguments and is qualifiedKT-68761Analysis API: Experiment with limited-size cache inKaFirSessionProviderKT-70384Analysis API Standalone: The same class in the same two renamed jars is unresolvedKT-71067Exceptions from references cancel Find UsagesKT-69535Redesign 'containingSymbol'KT-71025K2 IDE: Scopes in "importingScopeContext" have reversed ordering and "indexInTower" valuesKT-67483K2 IDE: Serializable plugin causes infinite resolve recursion when there is a star import from a class with annotation callKT-69416K2 IDE / Completion: βNo classifier foundβ on simple value creatingKT-70257CCE: class kotlin.UInt cannot be cast to class java.lang.NumberKT-70376K2 IDE / Kotlin Debugger: IAE βOnly componentN functions should be cached this way, but got: toStringβ on evaluating toString() method for value classKT-70264AA: service registration via XML fails with AbstractMethodError in Lint CLIKT-69950Analysis API: IntroduceisSubtypeOf(ClassId)KT-68625K2: βlazyResolveToPhase(STATUS)cannot be called from a transformer with a phase STATUS.βKT-67665K2: contract violation for value class with a constructor parameter with an implicit typeKT-67009Analysis API: Add abbreviated type tests for type aliases from source modulesKT-69977KaFirFunctionalType#getAbbreviation is always nullKT-68341Analysis API: Expanded function types from libraries don't have an abbreviated typeKT-68857Analysis API: Refactor annotationsKT-70386Do not filter out overloads from different libraries in dangling filesKT-65552K2: CANNOT_CHECK_FOR_ERASED in KtTypeCodeFragmentKT-65803K2: Analysis API: KtFirTypeProvider#getSubstitutedSuperTypes throws an exception in the case of "Wrong number of type arguments"KT-68896Support VirtualFile binary dependency inputs to Analysis API modulesKT-69395K2 IDE: incorrect overload selection from binary dependencies in a shared native source setKT-68573ISE: "Unexpected constant value (kotlin/annotation/AnnotationTarget, CLASS)" at Kt1DescUtilsKt.toKtConstantValue()KT-69576Analysis API: FIR implementation of "isImplicitReferenceToCompanion" returns false for companion references in implicit invoke operator callsKT-69568Analysis API: FIR implementation of "isImplicitReferenceToCompanion" returns true for non-companion references in qualified callsKT-69436Analysis API Platform: EncapsulateLLFirDeclarationModificationServiceas an engine serviceKT-63004K2: Analysis API: Design API for querying declarations generated by compiler plugins (similar to indices)KT-69452AA FIR: wrong source PSI after compile-time evaluationKT-69598AA: definitely not-null type at receiver position should be wrapped in parenthesisKT-60484Analysis API: add support for KtType pointers similar to KtSymbolPointerKT-68884Analysis API: Rename/deprecate/remove declarations as part of StabilizationKT-69453AA FIR: miss to handle expected type of lambda with explicit labelKT-69533Protect implementation parts of Analysis API with opt-in annotations
Analysis API. FIR
Performance Improvements
KT-71566FirElementBuilder#getFirForNonKtFileElement should iterate a Psi file over and overKT-71224Analysis API:FirElementFinder.collectDesignationPathrelies on naive iteration through FIR files
Fixes
KT-70327Analysis API: Batch inspection causes deadlock inValueWithPostComputeKT-69070Analysis API: Querying declared member scope for Java symbols results in exception in some use casesKT-68268LLSealedInheritorsProvider: reduce scope to kotlin filesKT-69671TYPES phase contract violation through JavaSymbolProviderKT-70624Declaration symbols from code fragments are treated as not localKT-70662NPE: FirLazyBodiesCalculatorKt.calculateLazyBodyForPropertyKT-70859Do not fail highlighting due to resolution problemsKT-70474FirLazyResolveContractViolationException from JavaSymbolProviderKT-70323FirLazyResolveContractViolationException:lazyResolveToPhase(TYPES)cannot be called from a transformer with a phase TYPESKT-71567LLFirCompilerRequiredAnnotationsTargetResolver should calculate annotation arguments on demandKT-71584getNonLocalContainingOrThisDeclarationtreats KtParameter from functional type as non-local
Analysis API. Light Classes
Performance Improvements
KT-69998Drop redundant cache from ClassInnerStuffCache
Fixes
KT-69833Support value classesKT-71693Wrong name mangling for JvmField class property and companion property clashKT-71469KtLightClassForDecompiledDeclaration: missed kotlinOriginKT-70710Provide light classes for KMP modules in Android LintKT-70548SLC: text of class object access expression is not the same as raw textKT-70572SLC: missingisInheritorimplementation for type parameterKT-70491SLC: inconsistent source PSI of no-arg constructor for all default values- [
KT-70458](https://youtrack.jetbrains.co...
Kotlin 2.1.0-RC2
Changelog
Compiler
KT-72345K2: Method 'get' without@Overrideannotation not calledKT-73065CCE with context receiversKT-72996false-positive unresolved reference error on an overloaded callable reference in a lambda return position on the left-hand size of an elvis operator
Compose compiler
CMP-6926iOS compilation failure: Unresolved reference 'copy'
IR. Inlining
KT-72884Internal error in body lowering: IllegalStateException: Can't inline given reference, it should've been lowered
JavaScript
KT-70533KJS: changed string concatenation behavior in 2.0KT-14013JS toString produces different result for nullable/non-nullable ref to the same arrayKT-43567KJS: toString() method and string interpolation of variable produce different codeKT-72732KJS / ES6: "SyntaxError: 'super' keyword unexpected here" with enabled-Xir-generate-inline-anonymous-functionsand disabled arrow functions
Klibs
KT-72965Ignore subclassOptInRequired constructor warning
Tools. Compiler Plugins
KT-72804Regression in Kotlin 2.1.0: compilation fails when building iOSKT-72824Kotlin power-assert plugin StringIndexOutOfBoundsException
Tools. Gradle
Kotlin 2.1.0-RC
Changelog
Backend. Wasm
KT-72297[Wasm] Unused associated object class lead to compiler fail
Compiler
KT-72281K/N: "Failed to wait for cache to be built"KT-72238Argument type mismatch in builder inside extension function after ?:KT-71751K2: Skipping code in last statement of lambdaKT-72552AutoboxingTransformer fails on during linkage on nested lambdas with cinteroped typesKT-71649K2: Put operator on mutableMap<T?, V>() causes crashes on null keyKT-71508JAVA_CLASS_INHERITS_KT_PRIVATE_CLASS isn't reported when java class is inherited from an effectively private classKT-72178K2: "Unexpected FirPlaceholderProjectionImpl" exception when using "_" as key type in EnumMapKT-72302K2: no error on type operator in annotation parameter default valueKT-72173K2: simple object names from root package are resolved without imports in non-root packages when used as values
Compose compiler
b/376058538Fix stack overflow when inferring stability of indirect generic loopb/339322843Transform@Composableproperty delegate references
IR. Inlining
KT-72521Kotlin/Native: java.lang.AssertionError: kfun:androidx.compose.runtime#access$<get-androidx_compose_runtime_ProvidedValue$stable>$p$tComposerKt(){}kotlin.IntKT-72623Don't generate synthetic accessors in files other than the one being lowered
IR. Interpreter
KT-72356K2 Native: IllegalStateException when annotation has the same source range as a constant in another file
Native. Runtime. Memory
KT-71401K/N: CMS barrier can be executed on an unregisterred thread
Tools. CLI
KT-72311KotlinCliJavaFileManagerImpl caches empty result and broke repeated analyses
Tools. Daemon
Tools. Gradle
KT-72467kotlin.sourceSets extension not added for KotlinBaseApiPlugin.createKotlinAndroidExtension()KT-72495Warn about kotlin-compiler-embeddable loaded along KGPKT-72387KGP 2.1.0-RC-227 changes cause KSP to crash calling produceUnpackedKlibKT-72303KGP 2.1.0-Beta2 broke compatibility with KSPKT-72651Unable to usetargetfor KotlinBaseApiPlugin.createKotlin(Jvm/Android)Extension()
Tools. Gradle. Multiplatform
KT-72454Revert changes made in KT-69899 i.e. make kotlin.android.buildTypeAttribute.keep = false by default again
Tools. Gradle. Native
KT-72366KGP 2.1.0-Beta2 doesn't downloadkotlin-native-prebuiltwhen running DokkaKT-71051K/N dependencies are re-downloaded multiple times on Windows
Tools. JPS
KT-68565K2: IllegalStateException: Source classes should be created separately before referencing
Tools. Kapt
KT-71776K2 Kapt in 2.1.0-Beta1 fails withe: java.lang.IllegalStateException: FIR symbol "class org.jetbrains.kotlin.fir.symbols.impl.FirValueParameterSymbol" is not supported in constant evaluation
Kotlin 2.1.0-Beta2
Changelog
Analysis API. Caches and Invalidation
KT-71700Cache result of resolveToCallKT-71520Analysis API:LLFirNativeForwardDeclarationsSymbolProviderspends a lot of time in indices
Analysis API. Lazy Resolution
KT-71567LLFirCompilerRequiredAnnotationsTargetResolver should calculate annotation arguments on demandKT-71584getNonLocalContainingOrThisDeclarationtreats KtParameter from functional type as non-localKT-71566FirElementBuilder#getFirForNonKtFileElement should iterate a Psi file over and overKT-71224Analysis API:FirElementFinder.collectDesignationPathrelies on naive iteration through FIR files
Analysis API. Light Classes
KT-71693Wrong name mangling for JvmField class property and companion property clashKT-71469KtLightClassForDecompiledDeclaration: missed kotlinOrigin
Analysis API. Stubs and Decompilation
KT-71565KtClassOrObject should use isLocal from greenStub
Analysis API. Surface
KT-71731directlyOverridenSymbols/allOverridenSymbols works incorrectly for intersection overrides
Analysis. API
Performance Improvements
KT-70165Introduce PSI-basedKaSymbols for K2
Fixes
KT-64984Analysis API: Support Wasm targetKT-70375K2: NPE at org.jetbrains.kotlin.analysis.api.fir.symbols.KaFirNamedClassSymbolBase.createPointerKT-57733Analysis API: Use optimizedModuleWithDependenciesScopes in combined symbol providersKT-70437Class reference is not resolvableKT-70327Analysis API: Batch inspection causes deadlock inValueWithPostComputeKT-71259K2 evaluator: Invalid smart cast info collecting for Code FragmentsKT-65110Analysis API: In Standalone mode the order of symbols is unstableKT-71468Drop redundant logic from LLFirJavaFacadeForBinariesKT-70890Analysis API: Experiment with weak references to LL FIR/analysis sessions in session cachesKT-70474FirLazyResolveContractViolationException from JavaSymbolProviderKT-70657Analysis API: Inner types from classes with generics are incorrectly represented by the compiled jarsKT-71055Suspend calls inside 'analyze()' break the block guaranteesKT-70815Analysis API: Implement stop-the-world session invalidationKT-69819K2 IDE: LHS type in callable references is unresolved when it has type arguments and is qualifiedKT-68761Analysis API: Experiment with limited-size cache inKaFirSessionProviderKT-70384Analysis API Standalone: The same class in the same two renamed jars is unresolvedKT-71067Exceptions from references cancel Find UsagesKT-69190K2: False-positive "redundant private modifier"KT-63390K2: Analysis API: add annotations to KtClassInitializerSymbolKT-71025K2 IDE: Scopes in "importingScopeContext" have reversed ordering and "indexInTower" values
Apple Ecosystem
KT-69093Xcode 16 support in KotlinKT-66894XCFramework task fails when name passed to xcframework DSL is different from framework's nameKT-65675XCFrameworkTask produces an xcframework with mismatched casing in embedded frameworks
Backend. Native. Debug
KT-71374lldb: step out breaks breaking in Xcode 16
Backend. Wasm
KT-72156custom-formatters.js exists in JAR after publishToMavenLocal but not in the published artifact in Maven publicKT-70331Support incremental compilation for the Wasm backendKT-71686K/Wasm: Add functions to convert between Kotlin and JS array typesKT-71473K/Wasm: Use--closed-worldand related options for BinaryenKT-71800Wasm compiler: Fix member generation for data classes with an array-type propertyKT-71580String::toFloat on wasm behaves differently compared to other targetsKT-71523K/Wasm: cleanup after fix for KT-71474KT-71475K/Wasm: KClass::qualifiedName returns incorrect result for nested or companion objectsKT-71474K/Wasm: KProperty*Impl equals work incorrectly for clabbale reference created in different files or modulesKT-71294Wasm Artifacts/Resource are being loaded relatively instead of absolutely
Compiler
New Features
KT-71094Kotlin/Native incremental compilation: fail compilation if cache build failedKT-70679Kotlin/Native: fill WritableTypeInfo from Swift Export type mappingKT-54227Cannot use nullable Nothing as reified type parameterKT-71430Kotlin-to-Java direct actualization implementationKT-68163Expose supplementary compiler warnings via CLI
Performance Improvements
KT-71159[K2] OOM on large enum classes with fields
Fixes
KT-71480JAVA_CLASS_INHERITS_KT_PRIVATE_CLASS isn't reported while java object isn't createdKT-71508JAVA_CLASS_INHERITS_KT_PRIVATE_CLASS isn't reported when java class is inherited from an effectively private classKT-71260K2: Internal compiler error in IrFakeOverrideSymbolBase.getOwner when there is no actual for expectKT-58820OPT_IN_USAGE_ERROR's message text does not account for SubclassOptInRequiredKT-71034Failing compiler/testData/codegen/box/inlineClasses/kt70461.ktKT-71016K/Wasm: Failing compiler/testData/codegen/box/inlineClasses/kt70461.ktKT-60521Drop language versions 1.4 and 1.5KT-72154Dokka fails withnot array: KClass<out Annotation>on Kotlin 2.1.20-dev with@SubclassOptInRequiredKT-70562@SubclassOptInRequiredcannot accept multiple experimental markerKT-71708False negative UNSUPPORTED for collection literals as trailing return valueKT-52469Deprecate reified type parameter instantiating into intersection typesKT-71563'llegalStateException: Source classes should be created separately before referencing' when actualized through typealias and java direct actualizationKT-71756K2 evaluator: broken resolve of private members during debug of Kotlin project itselfKT-71550JVM IR: NPE on identity equals of boolean true with nullKT-71490K2: missing REDUNDANT_ELSE_IN_WHENKT-64403Implement BlackBoxCodegenTestSpecGenerated for K2KT-71551JVM IR K1: NPE on generating a function imported from an object from another moduleKT-71210K2: false negative FUNCTION_CALL_EXPECTED / NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE with companion objectsKT-69549Try to move callable reference transformation earlier in pipelineKT-71228K2: "IllegalAr...
Kotlin 2.0.21
Changelog
Apple Ecosystem
KT-69093Xcode 16 support in Kotlin
Backend. Native. Debug
KT-71374lldb: step out breaks breaking in Xcode 16
Compiler
Fixes
KT-69735K2: Static fields are missing from the declaration list of corresponding IrClass for java classKT-71122Regression in Kotlin Compiler 2.0 causing NPE in the runtimeKT-70931K2 / Scripts: "cannot convert IrExpression to ConstantValue" when using function annotationKT-70584K2: "IllegalStateException: flow for PostponedLambdaExitNode not initialized - traversing nodes in wrong order?"KT-70808K2: "node has already been visited" with anonymous object in dead codeKT-69985K2: Classifier declarations from root package are resolved without imports in non-root packagesKT-70683K2: Internal compiler error in IrFakeOverrideSymbolBase.getOwnerKT-70901False positive Public-API inline function cannot access non-public-API property accessorKT-70930K2: Java annotations not present on ENUM_ENTRY IR elementsKT-70194K2 IDE: exception on a very red fileKT-69399Native: IllegalStateException: "Failed to build cache"
Compose compiler
Fixes
b/329477544Force open / overridden Composable functions to be non-restartable.b/361652128Disable live literal transform if the corresponding flag is disabled
IR. Actualizer
KT-70894IR crash. UnprocessedIrFunctionFakeOverrideSymbolwhen actualize to Java
IR. Tree
KT-71191SymbolTable: Check if the provided signature is public before adding a symbol to the SymbolTable
Native. Build Infrastructure
KT-71485K/N runtime parts don't build due to _Float16 issues on x86_64 macOS
Native. C Export
KT-69507LLVM 11 clang with Xcode 16 headers: standard c++ headers
Native. C and ObjC Import
KT-71029Investigate why stdarg.h declarations leak into testModuleA
Native. Platform Libraries
KT-70566LLVM 11 clang with Xcode 16 headers: 'sys/cdefs.h' file not foundKT-71624Eliminate remaining UIKit/AppKit removed signaturesKT-70031Rebuild platform libraries in 2.0.21 with Xcode 16
Native. Testing
KT-70603C++ with -fmodules: cyclic dependency in module 'std': std -> _wctype -> __wctype -> std in dev llvm toolchains
Tools. CLI. Native
KT-71262KotlinNativeLink tasks fetching from network despite -Xoverride-konan-properties=dependenciesUrl= being set
Tools. Compiler Plugins
KT-71038PowerAssert: Constant on RHS of elvis operator leads to compiler crash
Tools. Daemon
KT-35381Get rid of the native-platform usage in kotlin compiler
Tools. Gradle. Multiplatform
KT-71444Certain POMs produced by Kotlin 2.0.20 cannot be consumed by KMP projects with Android targetsKT-70700Gradle 8.10: The value for task ':commonizeNativeDistribution' property 'kotlinNativeBundleBuildService' cannot be changed any furtherKT-71396Gradle client side JVM explodes with OOM due to xcodebuild logs
Tools. Gradle. Native
KT-71419Light bundle KGP IT run against a stable K/N version
Tools. JPS
KT-71450Constant build failure: com.intellij.util.io.ClosedStorageException: storage is already closed
Kotlin 2.0.21-RC
2.0.21-RC
Apple Ecosystem
KT-69093Xcode 16 support in Kotlin
Backend. Native. Debug
KT-71374lldb: step out breaks breaking in Xcode 16
Compiler
Fixes
KT-69735K2: Static fields are missing from the declaration list of corresponding IrClass for java classKT-71122Regression in Kotlin Compiler 2.0 causing NPE in the runtimeKT-70931K2 / Scripts: "cannot convert IrExpression to ConstantValue" when using function annotationKT-70584K2: "IllegalStateException: flow for PostponedLambdaExitNode not initialized - traversing nodes in wrong order?"KT-70808K2: "node has already been visited" with anonymous object in dead codeKT-69985K2: Classifier declarations from root package are resolved without imports in non-root packagesKT-70683K2: Internal compiler error in IrFakeOverrideSymbolBase.getOwnerKT-70901False positive Public-API inline function cannot access non-public-API property accessorKT-70930K2: Java annotations not present on ENUM_ENTRY IR elementsKT-70194K2 IDE: exception on a very red fileKT-69399Native: IllegalStateException: "Failed to build cache"
Compose compiler
Fixes
b/329477544Force open / overridden Composable functions to be non-restartable.b/361652128Disable live literal transform if the corresponding flag is disabled
IR. Actualizer
KT-70894IR crash. UnprocessedIrFunctionFakeOverrideSymbolwhen actualize to Java
IR. Tree
KT-71191SymbolTable: Check if the provided signature is public before adding a symbol to the SymbolTable
Native. Build Infrastructure
KT-71485K/N runtime parts don't build due to _Float16 issues on x86_64 macOS
Native. C Export
KT-69507LLVM 11 clang with Xcode 16 headers: standard c++ headers
Native. C and ObjC Import
KT-71029Investigate why stdarg.h declarations leak into testModuleA
Native. Platform Libraries
KT-70566LLVM 11 clang with Xcode 16 headers: 'sys/cdefs.h' file not foundKT-71624Eliminate remaining UIKit/AppKit removed signaturesKT-70031Rebuild platform libraries in 2.0.21 with Xcode 16
Native. Testing
KT-70603C++ with -fmodules: cyclic dependency in module 'std': std -> _wctype -> __wctype -> std in dev llvm toolchains
Tools. CLI. Native
KT-71262KotlinNativeLink tasks fetching from network despite -Xoverride-konan-properties=dependenciesUrl= being set
Tools. Compiler Plugins
KT-71038PowerAssert: Constant on RHS of elvis operator leads to compiler crash
Tools. Daemon
KT-35381Get rid of the native-platform usage in kotlin compiler
Tools. Gradle. Multiplatform
KT-71444Certain POMs produced by Kotlin 2.0.20 cannot be consumed by KMP projects with Android targetsKT-70700Gradle 8.10: The value for task ':commonizeNativeDistribution' property 'kotlinNativeBundleBuildService' cannot be changed any furtherKT-71396Gradle client side JVM explodes with OOM due to xcodebuild logs
Tools. Gradle. Native
KT-71419Light bundle KGP IT run against a stable K/N version
Tools. JPS
KT-71450Constant build failure: com.intellij.util.io.ClosedStorageException: storage is already closed
Kotlin 2.1.0-Beta1
Changelog
Analysis. API
New Features
KT-68603KotlinDirectInheritorsProvider: add an option to ignore non-kotlin resultsKT-69961resolveToCallCandidatesshould support propertiesKT-69960resolveToCallCandidatesshould support operators
Performance Improvements
KT-70757Performance problem in KaFirVisibilityChecker for KaFirPsiJavaClassSymbolKT-70529KaSymbol: reduce the number ofcachedusages
Fixes
KT-65618K2: resulted FirClass.psi != requested PsiClass from completionKT-70323FirLazyResolveContractViolationException:lazyResolveToPhase(TYPES)cannot be called from a transformer with a phase TYPESKT-69535Redesign 'containingSymbol'KT-70859Do not fail highlighting due to resolution problemsKT-67483K2 IDE: Serializable plugin causes infinite resolve recursion when there is a star import from a class with annotation callKT-63490Analysis API: Accessing the Analysis API should be prohibited during dumb modeKT-69416K2 IDE / Completion: βNo classifier foundβ on simple value creatingKT-70663KaFirDestructuringDeclarationSymbol: Failed requirementKT-70662NPE: FirLazyBodiesCalculatorKt.calculateLazyBodyForPropertyKT-70661Invalid FirDeclarationOrigin ScriptTopLevelDestructuringDeclarationContainerKT-70624Declaration symbols from code fragments are treated as not localKT-70257CCE: class kotlin.UInt cannot be cast to class java.lang.NumberKT-69070Analysis API: Querying declared member scope for Java symbols results in exception in some use casesKT-70199K2: ConcurrentModificationException at FirCallCompleter$LambdaAnalyzerImpl.analyzeAndGetLambdaReturnArgumentsKT-70376K2 IDE / Kotlin Debugger: IAE βOnly componentN functions should be cached this way, but got: toStringβ on evaluating toString() method for value classKT-70264AA: service registration via XML fails with AbstractMethodError in Lint CLIKT-69381Analysis API: Investigate the viability of currentKaSymbolcachesKT-69950Analysis API: IntroduceisSubtypeOf(ClassId)KT-68625K2: βlazyResolveToPhase(STATUS)cannot be called from a transformer with a phase STATUS.βKT-67009Analysis API: Add abbreviated type tests for type aliases from source modulesKT-69977KaFirFunctionalType#getAbbreviation is always nullKT-68341Analysis API: Expanded function types from libraries don't have an abbreviated typeKT-68857Analysis API: Refactor annotationsKT-70386Do not filter out overloads from different libraries in dangling filesKT-65552K2: CANNOT_CHECK_FOR_ERASED in KtTypeCodeFragmentKT-69360Lack of implicit receiver for the last statement under lambda in scriptsKT-69699Receiver type is not substituted in the case of conflict declarationsKT-70206anonymousSymbolAPI throws an exception for regular functionsKT-65803K2: Analysis API: KtFirTypeProvider#getSubstitutedSuperTypes throws an exception in the case of "Wrong number of type arguments"KT-68896Support VirtualFile binary dependency inputs to Analysis API modulesKT-69671TYPES phase contract violation through JavaSymbolProviderKT-69395K2 IDE: incorrect overload selection from binary dependencies in a shared native source setKT-68573ISE: "Unexpected constant value (kotlin/annotation/AnnotationTarget, CLASS)" at Kt1DescUtilsKt.toKtConstantValue()KT-69576Analysis API: FIR implementation of "isImplicitReferenceToCompanion" returns false for companion references in implicit invoke operator callsKT-69568Analysis API: FIR implementation of "isImplicitReferenceToCompanion" returns true for non-companion references in qualified callsKT-55124Design common ancestor for KtValueParameter and KtReceiverParameterSymbolKT-69436Analysis API Platform: EncapsulateLLFirDeclarationModificationServiceas an engine serviceKT-63004K2: Analysis API: Design API for querying declarations generated by compiler plugins (similar to indices)KT-69452AA FIR: wrong source PSI after compile-time evaluationKT-69679KaDelegatedConstructorCall should have substituted signatureKT-69696KaSymbolByFirBuilder should filter call-site substitutionsKT-69598AA: definitely not-null type at receiver position should be wrapped in parenthesisKT-60484Analysis API: add support for KtType pointers similar to KtSymbolPointerKT-68884Analysis API: Rename/deprecate/remove declarations as part of StabilizationKT-69292K2: Analysis API: A property'sMUST_BE_INITIALIZEDdiagnostic is not updated after changingfieldusage in an accessorKT-69453AA FIR: miss to handle expected type of lambda with explicit labelKT-69371Analysis API: expose only interfaces/abstract classes for the resolution APIKT-69533Protect implementation parts of Analysis API with opt-in annotationsKT-68268LLSealedInheritorsProvider: reduce scope to kotlin files
Analysis. Light Classes
KT-70710Provide light classes for KMP modules in Android LintKT-70548SLC: text of class object access expression is not the same as raw textKT-70572SLC: missingisInheritorimplementation for type parameterKT-70491SLC: inconsistent source PSI of no-arg constructor for all default valuesKT-70458SLC: missedauxiliaryOriginalElementfor delegated propertyKT-70232Support a companion object inside value classesKT-70349@delegate:` annotations are missed for light class fieldsKT-69833Support value classesKT-69998Drop redundant cache from ClassInnerStuffCacheKT-68328Move KtLightClassBase to ULC
Apple Ecosystem
KT-66262Deprecate and remove support for bitcode embedding from the Kotlin Gradle pluginKT-69119xcodeVersion task fails if Xcode isn't installed and apple-specific native targets aren't declared
Backend. Wasm
KT-70786Improve DX of the variable view during debugging in Chrome/Firefox for Kotlin/WasmKT-68185[WasmJs] Attach js exception object to JsExceptionKT-65799K/Wasm: remove default exports from wasm exportsKT-61130K/Wasm: Function signatures may clash with base class internal methods from a friend moduleKT-70394Investigate increased wasm binary size after switching stdlib compilation to K2KT-69627Remove `create###A...
Kotlin 2.0.20
Changelog
Analysis. API
New Features
KT-68143Analysis API: support KtWhenConditionInRange call resolution
Performance Improvements
KT-67195K2: do not call redundant resolve on body resolution phase for classes
Fixes
KT-67360Analysis API: KtDestructuringDeclarationSymbol#entries shouldn't be KtLocalVariableSymbolKT-67748K2: AllCandidatesResolver modifies the original FirDelegatedConstructorCallKT-68198Analysis API: Support application service registration in plugin XMLsKT-62936Analysis API: NativeForwardDeclarationsSymbolProvider is not supported for Kotlin/NativeKT-68689LL API: support analysis from builtins moduleKT-69630KAPT User project builds with KAPT4 enabled fail with Metaspace overflowKT-65417K2 IDE: KTOR false positive expect-actual matching error on enum class because of implicit clone() in non-JVM source setsKT-68882Analysis API: RefactorKaSymbolsKT-65413K2 IDE: KTOR unresolved serializer() call for@Serializableclass in common codeKT-67996Analysis API: rename Kt prefix to KaKT-67775Analysis API: expose only interfaces/abstract classes for the user surfaceKT-68009K2: lowering transformers of Compose compiler plugin access AbstractFir2IrLazyFunction modality, which results in null point exceptionKT-68918collectCallCandidates works incorrectly for parenthesis invokeKT-68462Analysis API: Integrateproject-structuremodule intoanalysis-apiandanalysis-api-platform-interfaceKT-69131AA: "provideDelegate" operator is not resolved from the delegation reference in FIR implementationKT-69055Analysis API: StabilizeKaScopesKT-66216K2 IDE. "FirDeclaration was not found for class org.jetbrains.kotlin.psi.KtProperty, fir is null" on incorrect string templateKT-68959Introduce KaSeverityKT-53669Analysis API: redesign KtSymbolOrigin to distinguish kotlin/java source/library declarationsKT-68846Mark KaFirReference and all implementations with internal modifierKT-68845Move KaSymbolBasedReference to resolution packageKT-68844Move KaTypeProjection to types packageKT-65849K2: Rename 'high-level-api' family of JARs to 'analysis-api'KT-62540Remove uses of TypeInfo.fromString and TypeInfo.createTypeText from Kotlin pluginKT-62889K2 IDE. FPMISSING_DEPENDENCY_CLASSon not available type alias with available underlying typeKT-68155Analysis API: Add PSI validity check toanalyzeKT-62343Analysis API: fix binary incopatibility problems cause byKtAnalysisSessionProvider.analyzebeing inlineKT-68498To get reference symbol the one should be KtSymbolBasedReferenceKT-68393Analysis API: RenameKaClassLikeSymbol. classIdIfNonLocaltoclassIdKT-62924Analysis API: rename KtCallableSymbol.callableIdIfNonLocal -> callableIdKT-66712K2 IDE. SOE on settings string template for string variable with the same nameKT-65892K2: "We should be able to find a symbol" for findNonLocalFunctionKT-68273AA: supportKtFirKDocReference#isReferenceToImportAliasKT-68272AA: KtFirReference.isReferenceToImportAlias doesn't work for references on constructorKT-66996Analysis API: Expose the abbreviated type of an expandedKtTypeKT-66646K2: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl from FirJsHelpersKt.isExportedObjectKT-68203K2: Analysis API: wrong type of receiver value in case of imported object memberKT-68031LL resolve crash in case of PCLA inference with local objectKT-67851K2:PsiReference#isReferenceToalways returns false for references to Java gettersKT-68076AA: use type code fragments for import alias detectionKT-65915K2: Analysis API: extract services registration into xml fileKT-68049Analysis API: do not expose imported symbolsKT-68075K2: Analysis API: Type arguments for delegation constructor to java constructor with type parameters not supportedKT-65190AA: reference to the super type is not resolvedKT-68070AA: KtExpressionInfoProvider#isUsedAsExpression doesn't work for KtPropertyDelegateKT-67743K2: Stubs & AbbreviatedTypeAttributeKT-67706K2: "KtDotQualifiedExpression is not a subtype of class KtNamedDeclaration" from UnusedCheckerKT-68021Analysis API: do not break the diagnostic collection in a case of exception from some collectorKT-67973AA FIR: wrong KtCall modeling for == from type boundKT-67949AA: Type arguments of Java methods' calls are not reported as used by KtFirImportOptimizerKT-67988AA: functional type at receiver position should be wrapped in parenthesisKT-66536Analysis API: ContextCollector doesn't provide implicit receivers from FirExpressionResolutionExtensionKT-67321AA: Type arguments of Java methods' calls are not resolvedKT-64158K2: "KotlinIllegalArgumentExceptionWithAttachments: No fir element was found for KtParameter"KT-60344K2 IDE. "KotlinExceptionWithAttachments: expectcreateKtCallto succeed for resolvable case with callable symbol" on attempt to assign value to param named getParamKT-64599K2: "expectcreateKtCallto succeed for resolvable case with callable" for unfinished if statementKT-60330K2 IDE. ".KotlinExceptionWithAttachments: expectcreateKtCallto succeed for resolvable case with callable symbol" on attempt to assign or compare true with somethingKT-66672K2 IDE. False positive INVISIBLE_REFERENCE on accessing private subclass as type argument in parent class declarationKT-67750Analysis API: Removeinfixmodifiers from type equality and subtyping functionsKT-67655Analysis API: declare a rule how to deal with parameters in KtLifetimeOwnerKT-61775Analysis API: KtKClassAnnotationValue lacks complete type informationKT-67168K2: Analysis API: Rendering is broken for JSR-305 enhanced Java typesKT-66689Analysis API: KtFirPackageScope shouldn't rely on KotlinDeclarationProvider for binary dependencies in standalone modeKT-60483Analysis API: add isTailrec property to KtFunctionSymbolKT-67472K2: Analysis API FIR: KtFunctionCall misses argument with desugared expressionsKT-65759Analysis API: Avoid hard references toLLFirSessionin session validity trackersKT-60272K2: Implement active invalidation ofKtAnalysisSessionsKT-66765K2: Analysis API: support classpath substituti...
Kotlin 2.0.20-RC2
Changelog
Backend. Wasm
KT-70591To much sources that don't exist inside SourceMap file
Compiler
KT-70186Kotlin 2.0.20-Beta2: Unexpected number of type arguments: 0KT-69835K2 / Native: kotlin.native.binary.gc=cms throws library cached but its dependency isn't errorKT-70417DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE leads to NPE in BEKT-69964K2: Returning from an in-place lambda doesn't compileKT-69995K2: Slow compilation when star projecting mutually recursive bounds from javaKT-69773K2: "Overload resolution ambiguity between candidate" with arraysKT-70238K2: false negative VOLATILE_ON_VALUE for constructor propertiesKT-69766K2: False negative: Internal setter of generic class is accessible from another moduleKT-69898K2: Performance degradation in fir2ir caused by changes around intersection types
Compose compiler
b/357878245Disallow open@Composablefunctions with default params to fix binary compatibility issues.
JavaScript
KT-70592"Error: HttpClientCall expected" on HTTP request when targeting es2015 with KTORKT-67355KJS / ES6: 'super' in lambda with enabled-Xir-generate-inline-anonymous-functionsleads to JS errors
Libraries
KT-70196Introduce ExperimentalUuidApi annotation for marking Uuid API
Native
KT-70166Native: EXC_BAD_ACCESS on watchOS when using DispatchersKT-69246K2: linkPodDebugFrameworkIosArm64 takes 15 (!!) times longer
Native. Runtime
KT-70043Native: EXC_BAD_ACCESS on watchOS when using Random
Tools. Compiler plugins. Serialization
KT-70516KxSerialization:@KeepGeneratedSerializerand sealed class cause initialization error
Tools. Gradle. JS
KT-70077[2.0.20-Beta2] KGP reports confusing warnings about js/wasmJS source sets
Tools. Wasm
KT-70220K/Wasm: Upgrade NPM dependencies