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-66216K2 IDE. "FirDeclaration was not found for class org.jetbrains.kotlin.psi.KtProperty, fir is null" on incorrect string templateKT-53669Analysis API: redesign KtSymbolOrigin to distinguish kotlin/java source/library declarationsKT-62889K2 IDE. FPMISSING_DEPENDENCY_CLASSon not available type alias with available underlying typeKT-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-67360Analysis API: KtDestructuringDeclarationSymbol#entries shouldn't be KtLocalVariableSymbolKT-68198Analysis API: Support application service registration in plugin XMLsKT-68273AA: supportKtFirKDocReference#isReferenceToImportAliasKT-68272AA: KtFirReference.isReferenceToImportAlias doesn't work for references on constructorKT-67996Analysis API: rename Kt prefix to KaKT-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-67748K2: AllCandidatesResolver modifies the original FirDelegatedConstructorCallKT-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-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 substitution with library dependencies in super type transformerKT-67265K2: status phase should resolve original declarations in the case of classpath subsitutionKT-67244K2: StackOverflowError in the case of cyclic type hierarchy and library classpath substitutionKT-67080K2: clearer contract for lazyResolveToPhaseWithCallableMembersKT-65413K2 IDE: KTOR unresolved serializer() call for@Serializableclass in common codeKT-66713K2 FIR: Expose a way to get the module name used for name manglingKT-61892KtType#asPsiType could provide nullability annotationsKT-66122Analysis API: PassKtTestModuleinstead ofTestModuleto tests based onAbstractAnalysisApiBasedTest
Analysis. Light Classes
KT-68275LC: no arg constructor is not visible in light classesKT-66687Symbol Light Classes: Duplicate field names for classes with companion objectsKT-66804Symbol Light Classes: Fields from the parent interface's companion are added to DefaultImpls
Apple Ecosystem
KT-68257Xcode incorrectly reuses embedAndSign framework when moving to and from 2.0.0KT-65542Cinterop tasks fails if Xcode 15.3 is used
Backend. Wasm
KT-65798K/Wasm: make an error on default export usageKT-68453K/Wasm: "Supported JS engine not detected" in Web WorkerKT-64565Kotlin/wasm removeEventListener function did not remove the event listenerKT-66099Wasm: local.get of type f64 has to be in the same reference type hierarchy as (ref 686) @+237036
Compiler
New Features
KT-67611Implement improved handling of $ in literalsKT-39868Allow access to protected consts and fields from a super companion objectKT-67787Implement guard conditions for when-with-subjectKT-68165Native: type checks on generic types boundaryKT-66169useContentslacks acontractKT-67767Introduce an ability to enforce explicit return types for public declarations without enabling Explicit API modeKT-65841Allow to actualize expect types in kotlin stdlib to builtins in JVMKT-53834Support for JSpecify@NullUnmarked
Performance Improvements
KT-68034Devirtualization analysis fails to devirtualize string.get
Fixes
KT-68568K2: False-positive ACCIDENTAL_OVERRIDE caused by missing dependency classKT-66723K2: NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS for actual typealias that extends to Java class with complicated hierarchy that includes default methodKT-68492JVM IR backend: IDE / Kotlin Debugger: AE “Non-reified type parameter under ::class should be rejected by type checker” on evaluating private generic functionKT-61875Native: remove support for bitcode embeddingKT-35305"Overload resolution ambiguity" on function for unsigned types (UByte, UShort, UInt, ULong)KT-59679K2: Investigate extracting uncompleted candidates from blocksKT-68193JDK 21: new MutableList.addFirst/addLast methods allow adding nullable value for non-null typesKT-68383K2: "Argument type mismatch: actual type is 'kotlin.String', but 'T & Any' was expected." with intersection typesKT-68351K2: "Suspension functions can only be called within coroutine body"KT-68674False positive ACTUAL_WITHOUT_EXPECT in K2KT-64335K2: improve rendering of captured types in diagnostic messagesKT-67933K2: no conversion between fun interfaces if target hassuspendKT-68350K2: "Inapplicable candidate(s)" caused by parameter reference of local class with type parameters from functionKT-68362False-positive ABSTRACT_MEMBER_NOT_IMPLEMENTED for inheritor of java class which directly implements java.util.MapKT-68446K2: compile-time failure on smart-casted generic value used as a when-subject in a contains-check with rangeKT-68571K2: "IllegalStateException: Fake override should have at least one overridden descriptor" caused by exceptions and when statementKT-68339K2: "Enum entry * is uninitialized here" caused by lazy property with enum inwhenexpressionKT-66688K2: false-negative "upper bound violated" error in extension receiverKT-64106Native: the compiler allows using-optand-gat the same timeKT-67887Expection on assigning to private field of value typeKT-67801NSME on evaluating private member function with value class parameterKT-67800NSME on evaluating private top-level function with value class parameterKT-57996Usages ofFoo @Nullable []produce only warnings even with-Xtype-enhancement-improvements-strict-mode -Xjspecify-annotations=strictKT-68630DiagnosticsSuppressor is not invoked with Kotlin 2.0KT-68222K2. KMP. False negativeExpected declaration must not have a bodyfor expected top-level property with getter/setterKT-64103FirExpectActualDeclarationChecker reports diagnostic error for KtPsiSimpleDiagnostic with KtFakeSourceElementKT-68191K2. Static fake-overrides are not generated for kotlin Fir2IrLazyClassKT-64990K2: Remove usages of SymbolTable from FIR2IRKT-67798NSME on assigning to private delegated property of value classKT-68264K2: confusing INVISIBLE_* error when typealias is involvedKT-68024K2: Gradle repo testaccessors to kotlin internal task types...fails on K2KT-67943Approximation should not generate types with UPPER_BOUND_VIOLATION errorsKT-67503K2: False negative "Type Expected" when attempting to annotate a wildcard type argumentKT-68187K2: Create IrBuiltins in fir2ir only after IR actualizationKT-66443K2: ArrayIterationHandler doesn't work if UIntArray declared in sourcesKT-68291K2 / Contracts: Non-existent invocation kind is suggested as a fixKT-67692Native: support LLVM opaque pointers in the compilerKT-68209K2: Strange import suggestion when lambda body contains invalid codeKT-67368"NullPointerException: Parameter specified as non-null is null" local lambda creates new not-null checks with 2.0.0-Beta5KT-66554K2. Drop FIR based fake-override generator from fir2irKT-64202K2: Drop old methods for calculation of overridden symbols for lazy declarationsKT-55851K2: reference to a field from package private class crashes in runtimeKT-67895K2: Properly implement generation of fake-overrides for fieldsKT-54496K2:REDUNDANT_MODALITY_MODIFIERdiagnostic disregards compiler pluginsKT-63745K2: Approximation of DNN with nullability warning attribute leads to attribute incorrectly becoming not-nullKT-63362AbstractTypeApproximator fixes only first local type in hierarchyKT-67769K2: "variable must be initialized" on unreachable access in constructorKT-51195FIR IC: Incremental compilation fails with@PublishedApipropertyKT-67966No JVM type annotation is generated on a class supertypeKT-55128Wrong type path in type annotations when type arguments are compiled to wildcardsKT-46640Generate JVM type annotations on wildcard boundsKT-67952Annotations on type parameters are not generated for parameters other than the firstKT-68012K2. No'operator' modifier is required on 'component'error in K2KT-61835K2: FirStubTypeTransformer receives unresolved expressions in builder inference sessionKT-63596K1/K2: Different behavior for lambda with different return typeKT-67688K2: False positive CANNOT_INFER_PARAMETER_TYPE for Unit constraint type variableKT-62080False positive UNUSED_VARIABLE for variable that is used in lambda and in further code with several conditionsKT-60726K2: Missed TYPE_MISMATCH error: inferred type non-suspend function but suspend function was expectedKT-41835[FIR] Green code turns to red in presence of smartcasts and redundant type argumentsKT-67579K1/JVM: false-negative annotation-based diagnostics on usages of ABI compiled with non-trivially configured generation of default methodsKT-67493K2: argument type mismatch: actual type is 'T', but 'T' was expectedKT-64900K2:getConstructorKeywordcall inPsiRawFirBuilder.toFirConstructorforces AST loadKT-67648K2: wrong exposed visibility errors with WRONG_MODIFIER_CONTAINING_DECLARATION on top-level enum classKT-58686FIR2IR: Don't use global countersKT-67592K2: Success execution of:kotlin-stdlib:compileKotlinMetadataKT-60398K2: consider forbidding FirBasedSymbol rebindKT-54918Refactor transformAnonymousFunctionWithExpectedTypeKT-63360K2: Malformed type mismatch error with functional typeKT-67266K2: disappeared INLINE_CLASS_DEPRECATEDKT-67569K2: Fix default value parameters of Enum's constructor if it's declared in source codeKT-67378K2: Don't usewrapScopeWithJvmMappedfor common source setsKT-67738K2: Introducekotlin.internal.ActualizeByJvmBuiltinProviderannotationKT-67136Put $this parameter to LVT for suspend lambdasKT-62538K2: Declarations inside external classes should be implicitly externalKT-67627K2: External interface companion isn't external in IRKT-60290K2: origin is not set for !in operatorKT-67512K2: false positive WRONG_GETTER_RETURN_TYPE when getter return type is annotatedKT-67635K2: No warning TYPE_MISMATCH_WHEN_FLEXIBILITY_CHANGES for SAM constructor with inferred typeKT-67598K2: Fix incorrect castingUBytetoNumberinFirToConstantValueTransformerKT-56564False positive "non-exhaustive when" in case of intersection typeKT-63969K2: extra property in metadataKT-63968K2: extra property in metadata for anonymous variable in scriptKT-67547K/N can't build caches, fails with "clang++: error=2, No such file or directory"KT-64457K2: Fix DecompiledKnmStubConsistencyK2TestGeneratedKT-67102IR Evaluator: NoSuchFieldException when accessing a private delegated propertyKT-66377IR Evaluator: "no container found for type parameter" when evaluating nested genericsKT-66378IR Evaluator: Symbol is unboundKT-64506IDE, IR Evaluator: NPE in ReflectiveAccessLowering.fieldLocationAndReceiver when evaluating private static propertiesKT-67380K2: Don't check forequalsoverriding for classAnyKT-67038K2: Missing type of FirLiteralExpression causes an exception for property initializer type resolutionKT-59813K2: Fix the TODO aboutfirEffect.sourceinFirReturnsImpliesAnalyzerKT-59834K2: Fix the TODO aboutmerge(other)inUnusedCheckerKT-59833K2: Stop modifying values of enum entriesKT-59188K2: Change positioning strategy forWRONG_NUMBER_OF_TYPE_ARGUMENTSerrorKT-59108K2. SMARTCAST_IMPOSSIBLE instead of UNSAFE_IMPLICIT_INVOKE_CALLKT-65503The inline processor cannot handle objects inside the lambda correctly when calling an inline function from another moduleKT-30696NoSuchMethodError if nested anonymous objects are used with propagation reified type parameterKT-58966Incorrect type inference for parameters with omitted type of anonymous function that is being analyzed as value of function type with receiverKT-67458Use@PhaseDescriptionfor JVM backend lowering phasesKT-65647K2 ignores diagnostics on sourcelessFirTypeRefsKT-64489K2: Rename FirAugmentedArraySetKT-67394FIR: Make FIR repr of For from PSI and LightTree the sameKT-60261K2: No origin is set for composite assignment operatorsKT-66724K2 IDE. False positive errors because of wrong type inference in complex case of delegated property and type argumentsKT-40248Confusing error message NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODYKT-66947K2: false-positive JSpecify nullability enhancement warning on Java wildcard type argument with same base type but different nullabilities as upper and lower boundsKT-66974K2: false-negative JSpecify nullability enhancement warning on nullable projection of Java wildcard type argument with non-null bounds in out-positionKT-66946K2: false-negative JSpecify nullability enhancement warning on Java wildcard type argument with nullable upper bound in out-positionKT-66442K2: No visibility error on importing private aliasesKT-66598K2: Allow comparisons,is-checks and casts between Kotlin and platform typesKT-55966K2: Not enough information to infer type variable K if smartcast is usedKT-64957K1: drop ModuleAnnotationResolverKT-64894OPT_IN_ARGUMENT_IS_NOT_MARKER diagnostic message is unclearKT-67019K2: IR has incorrect EQ origins for some inplace updating operatorsKT-59810K2: Support other ConstraintPosition-sKT-55383K1/K2: isClassTypeConstructor behaves differently for stub typesKT-60089K2: Introduced ERROR_IN_CONTRACT_DESCRIPTIONKT-60382K2: Refactor ExpectActualCollectorKT-62929K2: investigate if guessArrayTypeIfNeeded is necessary in annotation loaderKT-65642K2: IR: Array access desugaring doesn't have originsKT-24807No smartcast to Boolean in subject of when-expression when subject type is non-nullableKT-66057K2: incorrect supertype leads to class declaration being highlighted redKT-63958K2: drop support of UseBuilderInferenceOnlyIfNeeded=falseKT-63959K2: treat stub types as non-nullable for isReceiverNullable checkKT-65100IrFakeOverrideBuilder: support custom 'remove(Int)' handling logic in MutableCollection subclasses
Compose compiler
New features
- cdfe659 Changed how compiler features being rolled out are enabled and disabled in compiler plugin CLI. Features, such as strong skipping and non-skipping group optimizations are now enabled through the "featureFlag" option instead of their own option.
IR. Actualizer
KT-66307K2: property fake override isn't generated for protected field
IR. Inlining
KT-67660Suspicious package part FQN calculation in InventNamesForLocalClassesKT-67208KJS: put ReplaceSuspendIntrinsicLowering after IR inlinerKT-64958KJS: Put as many as possible lowerings after the inlinerKT-67297Implement IR deserializer with unbound symbols
IR. Tree
KT-67650Add default implementations to methods for non-leaf IrSymbol subclasses from SymbolRemapperKT-67649Autogenerate IrSymbol interface hierarchyKT-44721IR: merge IrPrivateSymbolBase and IrPublicSymbolBase hierarchiesKT-67580Autogenerate SymbolRemapperKT-67457Introduce a way to simplify IR lowering phase creation
JavaScript
New Features
KT-18891JS: provide a way to declare static members (JsStatic?)
Fixes
KT-68053K2: NON_EXPORTABLE_TYPE on a typealias of primitive typeKT-68740Kotlin/JS 2.0.0 IrLinkageError with dynamic function parameters inside data classesKT-62304K/JS: Investigate the compiler assertion crash in JS FIR with backend testsKT-65018JS: Deprecate error toleranceKT-64801K2 + JS and WASM: Inner with default inner doesn't work properlyKT-67248ModuleDescriptor in JS Linker contains incorrect friend dependeciesKT-67273Creating Kotlin Collections from JS collectionsKT-64424K2: Migrate JsProtoComparisonTestGenerated to K2KT-52602Kotlin/JS + IR: incompatible ABI version is not reported when no declarations are actually used by a Gradle compilationKT-66092K/JS & Wasm: .isReified for reified upper bound is wrongly falseKT-67112Unable to apply@JsStaticfor common sources: [NO_CONSTRUCTOR]KT-62329KJS: "UnsupportedOperationException: Empty collection can't be reduced" caused by external enum with "@JsExport"KT-67018K/JS: Executable js file for module-kind=umd contains top level this instead of globalThisKT-64776Test infra for JS can't process dependency in mpp moduleKT-65076Use the same instance when a fun interface doesn't capture or capture only singletons
Klibs
KT-68202KLIB metadata: nested classes are sometimes inside a different 'knm' chunkKT-66968Provide K/N platforms libs for all available targetsKT-66967Provide K/N stdlib for all available targets in all distributionsKT-65834[KLIB Resolve] Drop library versions in KLIB manifestsKT-67446[KLIB Tool] Drop "-repository " CLI parameterKT-67445[KLIB Tool] Drop "install" and "remove" commandsKT-66557Check, that no bad metadata in klib is produced, when we failed to compute constant value
Language Design
KT-11914Confusing data class copy with private constructor
Libraries
KT-51483Documentation of trimMargin is (partly) difficult to understandKT-64649Add explanation to "A compileOnly dependency is used in the Kotlin/Native target" warning messageKT-67807JS/Wasm: ByteArray.decodeToString incorrectly handles ill-formed 4-byte sequences with a 2nd byte not being continuation byteKT-67768Wasm: ByteArray.decodeToString throws out-of-bounds exception if the last byte is a start of a 4-byte sequenceKT-66896Improve Array contentEquals and contentDeepEquals documentation
Native
KT-68094K2/Native: Member inherits different '@Throws' when inheriting from generic typeKT-67583compileKotlin-task unexpectedly downloads K/N dependencies on Linux (but doesn't on Mac)
Native. C and ObjC Import
KT-65260Native: compiler crashes when casting to an Obj-C class companion
Native. ObjC Export
KT-65666Native: enable objcExportSuspendFunctionLaunchThreadRestriction=none by default
Native. Runtime. Memory
KT-67779Native: SpecialRefRegistry::ThradData publication prolongs the pause in CMSKT-66644Native: threads are too often paused to assist GC (with concurrent mark)KT-66918Native: scan global root set concurrently
Native. Swift Export
KT-68259Swift export: secondary constructs lead to compilation errorsKT-67095Native: fix testNativeRefs export testKT-67099Remove SirVisitor and SirTransformer from codeKT-67003Abandon PackageInflator implementation in favour of PackageProvider component
Native. Testing
KT-68500Native: Drop custom logic in ExtTestCaseGroupProvider, mute codegen/box tests explicitly
Tools. CLI
Tools. CLI. Native
KT-64524Introduce a CLI argument to override native_targets field in klib manifest
Tools. Compiler Plugin API
KT-68020K2: run FirSupertypeGenerationExtension over generated declarations
Tools. Compiler Plugins
KT-67605K2 parcelize: false positive NOTHING_TO_OVERRIDE in one testKT-64455K2: Implement ParcelizeIrBoxTestWithSerializableLikeExtension for K2
Tools. Fleet. ObjC Export
KT-68051[ObjCExport] Support reserved method names
Tools. Gradle
KT-68447ill-added intentionally-broken dependency source configurationsKT-68278Spring resource loading in combination withjava-test-fixturesplugin brokenKT-66452Gradle produces false positive configuration cache problem for Project usage at execution timeKT-68242Run tests against AGP 8.4.0KT-61574Add project-isolation test for Kotlin/Android pluginKT-65936Provide a detailed error for changing kotlin native version dependency.KT-67888Remove usages of deprecated Configuration.fileCollection() methodKT-62684PropertiesBuildService should load extraProperties only onceKT-67288Test DSL should not fail the test if build scan publishing has failed
Tools. Gradle. JS
KT-68482KotlinNpmInstallTask is not compatible with configuration cacheKT-68072K/JS, K/Wasm: Module not found in transitive caseKT-68103K/JS, K/Wasm: Generation of test compilation's package.json requires main compilationKT-67924K/JS, K/Wasm: kotlinNpmInstall can rewrite root package.json
Tools. Gradle. Kapt
KT-64627Kapt3KotlinGradleSubplugin uses property lookup that breaks project isolation
Tools. Gradle. Multiplatform
KT-64109Using compileOnly/runtimeOnly dependencies in K/N-related configurations leads to odd behaviourKT-58319kotlin.git: ProjectMetadataProviderImpl "Unexpected source set 'commonMain'"
Tools. Gradle. Native
KT-65761Missing JDK Platform ClassLoader when compiling Kotlin native in daemonKT-67935OverriddenKotlinNativeHomeChecker does not work well with relative pathsKT-64430Remove deprecated KotlinToolRunner(project) constructorKT-64427Stop using deprecated KotlinToolRunner(project) constructor call
Tools. Incremental Compile
KT-63476Investigate the debug output of JVM compilation in KMP IC smoke tests
Tools. JPS
KT-63707JPS: "Multiple values are not allowed for" caused by Compose
Tools. Kapt
KT-67495File leak in when building with kaptKT-66780K2 KAPT Kotlinc should exit with an exit code 1 (compilation error) if a Kapt task failsKT-66998K2 KAPT: Reimplement support for DefaultImpls
Tools. Scripts
KT-67575FromConfigurationsBase script definition unexpected behaviour with regex from gradle templatesKT-67066DeepCopyIrTreeWithSymbols does not copy IrScript nodes correctlyKT-67071K2: ScriptCompilationConfigurationFromDefinition is not serializableKT-67063LauncherReplTest flaky on Windows