Kotlin 2.0.0-Beta4
Pre-release
Pre-release
Changelog
Analysis. API
Performance Improvements
KT-64987
Analysis API: 50GB memory allocation on creating empty kotlinx.collections.immutable.persistentMapOf
Fixes
KT-65268
K2: Checking the presence of the delegated constructor call forces AST loadingKT-63330
Analysis API: Stub-based deserialized symbol providers provide unresolved enum entry annotation argumentsKT-65418
Analysis API:LLFirAbstractSessionFactory
loads anchor module sessions eagerlyKT-64718
Analysis API: do not expose SealedClassInheritorsProvider and FirRegularClass to IDE PluginKT-65075
K2: getContainingDeclaration() is broken for declarations inside code fragmentsKT-61332
SupportKtTypeCodeFragment
inPsiRawFirBuilder
KT-65150
AA: incorrect result fromKtTypeProvider#getReceiverTypeForDoubleColonExpression
for Java static methodKT-55750
LL FIR: Implement multi-threaded resolveKT-56551
LL FIR: implement parallel resolve for jumping phasesKT-65223
Psi: avoid KtFile usagesKT-65307
Analysis API FE10: support KtFe10AnalysisSessionProvider.getAnalysisSessionByUseSiteKtModuleKT-62695
K2 IDE: Unresolved extension functions in KDocKT-65152
Analysis API: KDoc references to packages are not fully resolvedKT-64988
K2 IDE: Navigation from the named argument in safe call does not workKT-64074
K2: Investigate LL divergence for Script.testTopLevelPropertyInitializationKT-64921
K2 IDE: references in platform code resolve to expect classifier instead of actualKT-62441
K2: IDE K2: "No dangling modifier found"KT-64528
K2 IDE: MPP: unregistered component 'org.jetbrains.kotlin.fir.scopes.impl.FirDelegatedMembersFilter'KT-64993
Analysis API: KtExpressionTypeProvider.getExpectedType works incorrectly for arguments of safe callsKT-64883
Allow direct creation of KtCommonFileKT-64646
K2: properly forbid ast loading during raw fir phase in testsKT-64862
Psi: missed parenthesis in type reference presentationKT-62893
K2 IDE. FP 'when' expression must be exhaustive with Java sealed interface from libraryKT-63795
K2:lazyResolveToPhase(BODY_RESOLVE)
cannot be called from a transformer with a phase BODY_RESOLVE from SealedClassInheritorsProviderIdeImpl
Analysis. Light Classes
KT-65425
K2 IDE: Seeing a reference to the class generated by compiler plugin exposed from Java code caused NPE from light classesKT-64937
SLC: internal setters are not mangled
Apple Ecosystem
KT-63212
podInstall task fails without a proper diagnostic when xcodeproj gem is outdated
Backend. Wasm
KT-63939
Kotlin/Wasm Support lazy associated object initialisationKT-64803
K/Wasm: non-capturing lambdas are not singleton unlike same lambdas in jvmKT-64449
K2: Implement K1WasmWasiCodegenBoxTestGenerated for K2KT-64829
K/Wasm: division remainder has a wrong signKT-65009
Generate TypeScript definitions for the@JsExport
declarations in K/Wasm
Compiler
New Features
KT-63670
Implement platform specific declaration clash diagnostics across all backendsKT-62547
Introduce a language feature flag for smartcasts based on "memory" variables
Fixes
KT-63344
K2: False positive ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTEDKT-58845
K2: SAM checker can run incorrectly in presence of an expect supertypeKT-61843
K2: Missing TYPE_MISMATCH for nested array literalsKT-61798
K2 incorrectly calculates modality of property accessorsKT-65255
K2 / KJS: "IllegalArgumentException: Candidate is not successful, but system has no contradiction"KT-65341
K2: "Cannot find cached type parameter by FIR symbol" caused by not-null assertion operator inside string in throwKT-49283
Support contribution type info from a nested builder inference callKT-64077
K2: Builder inference ignores constraints from nested builder inferenceKT-49160
Couldn't infer a type argument through several builder inference calls broken by a local classKT-61310
K2: "Not enough information to infer type variable R" for transformLatestKT-63733
Builder-style type inference can't resolve to extension overloads when they're more applicable than member onesKT-57707
K1: inconsistent TYPE_MISMATCH in builder inferenceKT-55057
Builder inference changes behaviour sporadically based on BI annotation on unrelated callKT-60663
Builder inference does not work inside a nested unrelated builder inference lambdaKT-53639
TYPE_MISMATCH: compiler can't infer the list's type when usingbuildList {}
builder orCollection#isNotEmpty
KT-60291
K2: "IllegalStateException: Cannot serialize error type: ERROR CLASS: Cannot infer argument for type parameter T" during FIR serializationKT-65033
K2: Fir2LazyIr: Lazy type aliases not supportedKT-57709
Inconsistent extension function call resolution in builder inferenceKT-53740
Builder inference with multiple lambdas leads to unsound typeKT-60877
Builder inference from the null literal results in Nothing instead of Nothing? for producing positions of the postponed type variableKT-53553
Builder inference: inconsistent types in different lambda scopesKT-54400
K2: builder inference does not work with assignments of literals to member propertiesKT-53109
CompilationErrorException generateUnboundSymbolsAsDependencies with builder inference and lambdasKT-52757
Type inference for builders fails if inferred from a functionKT-63840
Builder inference fails on calls to identity-shaped functions with postponed type variables inside select-constructionsKT-64276
[K/N][K2] K2 behaviorial difference with inconsistent inheritance of ObjCNameKT-59782
K2: Forbid local delegated properties with private accessors in public inline functionsKT-65482
K2: NoSuchFieldError due to using unboxed typeKT-63208
K2: Implement deprecation cycle and fix missing errors for error-level nullable arguments of warning-level Java typesKT-64891
K2: consider supporting/forbidding foo.(bar)() syntaxKT-62134
K2: handle non-simple types during FirStatusResolver.isPrivateToThis checkKT-65290
K2: No override for FUN DEFAULT_PROPERTY_ACCESSORKT-65111
K2: Java star imports don't work in KJK interdependenciesKT-59012
K2: Support inferring types based on self upper boundsKT-65373
K2: there is a crash in KJK hierarchy with an extension member propertyKT-65277
IrFakeOverrideBuilder: NPE from IrJavaIncompatibilityRulesOverridabilityCondition.doesJavaOverrideHaveIncompatibleValueParameterKindsKT-62884
K2: different signature of delegate object for generic extension propertyKT-59630
K2: Implement running FIR Blackbox tests on different JDKsKT-64944
Can't assign null after early return smart cast with typed destructive assignmentKT-64910
K2: AA FIR: KtCall's argument mapping misses SAM conversion argumentKT-64846
K2: false negative CONFLICTING_JVM_DECLARATIONS on inheritance from Java collection subclass with a conflicting overrideKT-60732
K2 Scripting: TeamCity DSL testKT-65165
K2: "ClassCastException: class java.lang.String cannot be cast to class SampleClass"KT-64982
K2: false negative FUNCTION_CALL_EXPECTEDKT-64872
K2: do-while condition able to access uninitialized variableKT-65318
K2: Substitution stackoverflow on jspecify@NullMarked
superclassKT-65010
Kotlin/Native: code generation for a static field is failingKT-59921
K2: Disappeared NULL_FOR_NONNULL_TYPEKT-57299
K2: VerifyError due to overriding final methodsize
on a subclass of Collection and SetKT-57300
K2: subclass of MutableCollection with primitive element type has methods with boxed typeKT-58279
K2. False-negativeSmart cast to is impossible, because is a public API property declared in different module
for Java static fieldKT-64706
K2: Type inference cannot resolve nullable@Composable
lambdaKT-65058
K2: Protected function call from public-API inline function is prohibited in anonymous objectKT-53629
K2: forbid multiple labels per statementKT-65316
K2: False positive USAGE_IS_NOT_INLINABLE for expression labeled with illegal labelKT-57268
K2: extra methodsremove
and/orgetOrDefault
are generated for Map subclasses with JDK 1.6 in dependenciesKT-63151
K2: Assignment within function lambda should invalidate contract DFA implicationsKT-63351
K2. No smart cast with not-null assertion operator after a safe callKT-65324
atomicfu-plugin: top-level delegated properties cause NPEKT-60246
K2: origin is not set for getting array element operatorKT-64387
K2: Missing POSTFIX_INC/DEC origin for array element inc/decKT-61891
K2: POSTFIX_{INCR|DECR} of global misses an originKT-65019
K2: unexpected exception when executing inc/dec in finally block on WASMKT-64392
Factor out KLIB serialization logic from thebackend.native
moduleKT-65270
K2: Missing ACTUAL_WITHOUT_EXPECT when expect is fake-overrideKT-60367
K2: Support EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE diagnosticsKT-62704
Absent testrunner FirLightTreeDiagnosticTestSpecGeneratedKT-65044
K2 compiler crash on unresolved delegated extention receiverKT-65021
K2: Missing error and miscompilation in destructuring declaration delegationKT-63899
K2: Vararg parameter misses annotation in metadataKT-60175
JVM IR inline: accidental reification of typeOf type argumentKT-60174
JVM IR inline: accidental reification in various casesKT-65103
K2: IllegalArgumentException: IrErrorCallExpressionImpl(5388, 5392, "Unresolved reference: R?C|/cont|") found but error code is not allowedKT-64635
K2: "KotlinIllegalArgumentExceptionWithAttachments: Expected expression 'FirAnonymousFunctionExpressionImpl' to be resolved" when provideDelegate is extension of function with receiverKT-63434
K2. False positiveCannot access
with protected nested classifiers references inside anonymous object inherited from containing classKT-64314
K2: Rename FirConstExpression to FirLiteralExpressionKT-63577
K2: false-positive "wrong number of type arguments" error on callable reference to member of generic function's local classKT-64975
FIR: Deserialize enum entry annotation arguments from binary libraries with lookup tags instead of symbolsKT-61626
K2: Module "com.soywiz.korlibs.kmem:kmem" has a reference to symbol korlibs.memory/Buffer|null[1]KT-64268
K2: Data-flow from nested lambda not passed to outer lambdaKT-59729
K2: Investigate CFG buildings for inner lambdas in case of double-lambda builder inferenceKT-64841
K2: argument type mismatch with type parameter with recursive boundKT-62554
K2: incorrect "inherits multiple implementations" error when base Java method takes a parameter of primitive wrapper typeKT-65093
K2: Super constructor call able to access uninitialized object fieldsKT-56489
K2 allows reading uninitialized variable in object declarationKT-59987
K2: Disappeared REIFIED_TYPE_FORBIDDEN_SUBSTITUTIONKT-36786
Smartcast doesn't work in case of property infix callKT-65056
IrFakeOverrideBuilder: ISE "No override for FUN" on package-private Java method in K-J-K hierarchyKT-62045
IrFakeOverrideBuilder: incorrectly merged fake overrides for Java methods accepting wrapper Double and primitive doubleKT-57640
[K2/N] Investigate behaviour for intersection overrides for properties that have incompatible typesKT-59682
K2: Use proper source for vararg argumentsKT-63781
K2: Generated blocks appear in the IRKT-63779
K2: Regression for locations of 'if' statementsKT-63624
K2: incompatible declaration because of different visibilityKT-64400
K2: allow to use simple boolean expressions as constantsKT-59972
K2: Disappeared EXPRESSION_EXPECTED_PACKAGE_FOUNDKT-63256
K2: NOT_IDENTITY operator call is illegal in contract descriptionKT-63529
K2: Compiler does not detect tailrec call with nullable typeKT-65012
IR Evaluator:NoSuchFieldException
when evaluating protected/private fields of superclassesKT-64871
IrFakeOverrideBuilder: ISE "no override for " on HashMap subclassKT-60262
Support for inter-module interaction for@SubclassOptInRequired
KT-58739
K2: RewriteCallableId.classId
to be thread-safeKT-64979
K2: Missing REDUNDANT_TYPE_PARCELER when using type aliasKT-60019
K2: Introduced PARCELER_TYPE_INCOMPATIBLEKT-62500
K2: origin=GET_PROPERTY is wrongly set to GET_FIELD of backing field inside property's own getterKT-64743
K2: Non-expanded type serialized in metadataKT-64405
K2: Implement CompileJavaAgainstKotlinTestGenerated for K2KT-64837
K2: NPE in fir2ir when generic transitive dependency class is missingKT-60258
Support java-kotlin interop for@SubclassOptInRequired
KT-60260
K2: Implicit coercion to unit is not generated in adapted function referenceKT-60858
Remove redundantcreateDeprecatedAnnotation
necessary to workaround kotlinx-serialization compilation with nativeKT-64432
Unbound symbol access in Fir2Ir fake override builderKT-64466
K2: Delegated method annotations are not copied in IRKT-63589
K1: Unsound type inference for unbound callable reference to star-projected class's generic mutable propertyKT-61032
K2: False positive “Unused variable” for function callable referenceKT-64832
K2: False positive "Unused variable" checker report on suspend functional types, on overloaded functional types and on custom invoke operator typesKT-64609
K2: INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE diagnostic is missed for primary constructor propertiesKT-61937
K2: implicit script receiver from ScriptDefinition are not visible for invokeKT-27936
Write InnerClasses attribute for all class names used in a class fileKT-31367
IllegalStateException: Concrete fake override public open fun (...) defined in TheIssue[PropertyGetterDescriptorImpl@1a03c376
] should have exactly one concrete super-declaration: []
Docs & Examples
KT-63001
K2: Organize team-wide talks about new FIR2IR & PCLA
IR. Actualizer
KT-65274
IrFakeOverrideBuilder: ISE: "IrFieldPublicSymbolImpl is already bound"KT-65236
IrFakeOverrideBuilder: ISE: "should not be called"KT-65116
K2: IrFakeOverrideBuilder: "No override for FUN" if the function has already been overridden by another class in K <- J<- K <- J hierarchyKT-65499
IrFakeOverrideBuilder: ISE IrSimpleFunctionPublicSymbolImpl is already bound for irrelevant 'remove' clashing with a function from Java collection subclassKT-64150
IrFakeOverrideBuilder: Fake overrides for static java functions are not generatedKT-65432
IrFakeOverrideBuilder - No override for FUN IR_EXTERNAL_JAVA_DECLARATION_STUB name:elementDataKT-64895
K2:IrActualizer corrupts attributeOwnerId value
IR. Inlining
KT-64868
[K/N] Inlined assert is later not removed, even without-ea
IR. Tree
KT-64974
Consolidate visibility checks in IrFakeOverrideBuilder
JavaScript
KT-34995
JS: List, Map, and Set types are hard to use from JS because of mangled member namesKT-64548
KJS / K2: "Cannot find delegated constructor call" caused by external classes constructorsKT-63359
K2: support new ways to declare TestResult in JS TestGenerator loweringKT-44871
Add@JsExport
and@JsName
annotations to stdlib classes (especially collections) to avoid method name mangling and improve Kotlin usability from JSKT-64867
K2 JS: Name clash between constructors with same JsName but in different classesKT-64463
KJS / K2: "Name contains illegal chars that cannot appear in JavaScript identifier" caused by non-ASCII characterKT-65168
Introduce an ability to create type-safe JS objects
KMM Plugin
KT-59270
Update wizards in KMM AS plugin after 1.9.20 release
Klibs
KT-65063
Clashing KLIB signatures from different modules result in an exceptionKT-61143
[klib tool] Dump IR with unbound symbols
Language Design
KT-58881
K2: Run checkers in common code against platform sessionKT-64187
K2: False positive ABSTRACT_NOT_IMPLEMENTED caused by the fact that common code sees platform code of its dependenciesKT-62959
Value of captured type is not a subtype of the same captured typeKT-64739
Mark@SubclassOptInRequired
as an experimental
Libraries
KT-63397
kotlin-test should declare runtime dependency on "org.junit.platform:junit-platform-launcher"KT-65242
Update transitive dependencies of JVM test frameworks in kotlin-testKT-63355
Detect concurrent modifications in ArrayDequeKT-57150
Consider introducing Common protected property AbstractMutableList.modCountKT-64956
Implement optimized removeRange for ArrayDequeKT-57151
Consider introducing Common protected function AbstractMutableList.removeRangeKT-58039
Wasm: Implement unsigned numbers using wasm builtin capabilitiesKT-63714
K2: kotlinx-benchmarks fails with "Unable to find method ''org.gradle.api.tasks.TaskProvider" with register("js")
Native
KT-64249
Native: Implicit cache directory search is O(n^2)
Native. C and ObjC Import
KT-64105
[K2/N] cannot access Objective-C forward declared class used only in a dependent lib
Native. Runtime
KT-65170
Kotlin/Native: deprecate -Xworker-exception-handling=legacy with error
Native. Runtime. Memory
KT-63423
Kotlin/Native: huge dispose-on-main overheadKT-64313
Kotlin Native: Seg Fault during Garbage Collection on 1.9.21 (observed on iOS)
Reflection
KT-57972
Reflection: "KotlinReflectionInternalError" when usingcallBy
with overridden function in inline class
Tools. CLI
KT-64608
K2: Wrong end position of compiler diagnostics
Tools. Commonizer
KT-64376
Commonizer incorrectly retains UnsafeNumber annotation in target sets where it shouldn't
Tools. Compiler Plugins
KT-64591
Data class' copy method is never stripped from ABIKT-59074
K2: false-positive MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT if allOpen plugin is used and a val is defined with init {} blockKT-64589
jvm-abi-gen: Order of class members affects ABI jarKT-65072
jvm-abi-gen: SourceDebugExtension annotation isn't stripped along with corresponding attributeKT-64971
Exception is thrown when compiling kotlinx.coroutines to Native because of the new signature clash diagnosticsKT-54025
[K2] [NONE_APPLICABLE] compiler error in case @ AllArgConstructor annotation is used together with a static fieldKT-54054
[Lombok] An extra unneeded constructor parameter is expected by compiler if java class annotated with @ AllArgsConstructor and has private final initialized field
Tools. Daemon
KT-64283
Configure correct JVM arguments when starting the daemon
Tools. Fleet. ObjC Export
KT-65108
ObjCExport: Tests: Check if 'requirePlatformLibs' is necessaryKT-65281
ObjCExport: AA: Run already passing Unit Tests on CIKT-65080
ObjCExport: Analysis-Api: error handlingKT-64952
ObjCExport: Analysis-Api: objectKT-64869
ObjCExport: Analysis-Api: Support 'MustBeDocumented' annotationsKT-64839
ObjCExport: Enable tests on CI for aggregateKT-64888
ObjCExport: Analysis Api: Support exporting KDoc
Tools. Gradle
KT-62639
Compatibility with Gradle 8.4 releaseKT-65143
Use the new ConfigurationContainer dependencyScope method to create dependency declaration configurationsKT-64848
Log K/Native compiler arguments with log level specified for compiler argumentsKT-65213
Collect logic for FUS metrics calculation in one placeKT-61698
Compiler options configured inside metadata {} target set up all targets in a projectKT-59024
Compatibility with Gradle 8.3 releaseKT-60664
Gradle 8.3: KGP eagerly creates compile task
Tools. Gradle. JS
KT-64119
K/JS: Migrate package manager from Yarn onto NPMKT-65295
Gradle: K/N and K/JS tests may produce unrequested TeamCity service messages
Tools. Gradle. Multiplatform
KT-61943
Mark thecheckKotlinGradlePluginConfigurationErrors
as UP-TO-DATE when possibleKT-61559
Include stdlib and platform dependencies to KotlinNativeCompilation.compileDependencyFiles APIKT-65196
Add high-level DSL to configure compiler options in the multiplatform projectKT-61430
K2/KMP: metadata compilation fails with Unresolved reference for property in actual class
Tools. Gradle. Native
KT-49268
Only download Kotlin/Native Compiler when there are valid targetsKT-52567
Use Gradle dependency management for downloading Kotlin/Native compiler when compiling with GradleKT-64903
Add maven repo with dev versions into ITKT-51255
Kotlin/Native should not download compiler artifacts when not necessaryKT-58303
Kotlin multiplatform Gradle plugin downloads Kotlin/Native compiler during configuration
Tools. JPS
KT-65043
JPS dumb mode should respect maps needed for the compiler
Tools. Kapt
KT-65684
KAPT: (Re)enable fallback to K1 KAPT and make it defaultKT-61080
Kapt: investigate suspicious check for KMutableMap.Entry in KaptTreeMakerKT-64479
Kapt4 + Compose. Error: scoping construct cannot be annotated with type-use annotation:@androidx
.compose.runtime.Composable
Tools. Wasm
KT-64851
Wasm. Support Gradle configuration cache