Kotlin 2.1.0-Beta2
Pre-release
Pre-release
KotlinBuild
released this
14 Oct 12:52
·
133 commits
to 2.1.0
since this release
Changelog
Analysis API. Caches and Invalidation
KT-71700
Cache result of resolveToCallKT-71520
Analysis API:LLFirNativeForwardDeclarationsSymbolProvider
spends a lot of time in indices
Analysis API. Lazy Resolution
KT-71567
LLFirCompilerRequiredAnnotationsTargetResolver should calculate annotation arguments on demandKT-71584
getNonLocalContainingOrThisDeclaration
treats KtParameter from functional type as non-localKT-71566
FirElementBuilder#getFirForNonKtFileElement should iterate a Psi file over and overKT-71224
Analysis API:FirElementFinder.collectDesignationPath
relies on naive iteration through FIR files
Analysis API. Light Classes
KT-71693
Wrong name mangling for JvmField class property and companion property clashKT-71469
KtLightClassForDecompiledDeclaration: missed kotlinOrigin
Analysis API. Stubs and Decompilation
KT-71565
KtClassOrObject should use isLocal from greenStub
Analysis API. Surface
KT-71731
directlyOverridenSymbols/allOverridenSymbols works incorrectly for intersection overrides
Analysis. API
Performance Improvements
KT-70165
Introduce PSI-basedKaSymbol
s for K2
Fixes
KT-64984
Analysis API: Support Wasm targetKT-70375
K2: NPE at org.jetbrains.kotlin.analysis.api.fir.symbols.KaFirNamedClassSymbolBase.createPointerKT-57733
Analysis API: Use optimizedModuleWithDependenciesScope
s in combined symbol providersKT-70437
Class reference is not resolvableKT-70327
Analysis API: Batch inspection causes deadlock inValueWithPostCompute
KT-71259
K2 evaluator: Invalid smart cast info collecting for Code FragmentsKT-65110
Analysis API: In Standalone mode the order of symbols is unstableKT-71468
Drop redundant logic from LLFirJavaFacadeForBinariesKT-70890
Analysis API: Experiment with weak references to LL FIR/analysis sessions in session cachesKT-70474
FirLazyResolveContractViolationException from JavaSymbolProviderKT-70657
Analysis API: Inner types from classes with generics are incorrectly represented by the compiled jarsKT-71055
Suspend calls inside 'analyze()' break the block guaranteesKT-70815
Analysis API: Implement stop-the-world session invalidationKT-69819
K2 IDE: LHS type in callable references is unresolved when it has type arguments and is qualifiedKT-68761
Analysis API: Experiment with limited-size cache inKaFirSessionProvider
KT-70384
Analysis API Standalone: The same class in the same two renamed jars is unresolvedKT-71067
Exceptions from references cancel Find UsagesKT-69190
K2: False-positive "redundant private modifier"KT-63390
K2: Analysis API: add annotations to KtClassInitializerSymbolKT-71025
K2 IDE: Scopes in "importingScopeContext" have reversed ordering and "indexInTower" values
Apple Ecosystem
KT-69093
Xcode 16 support in KotlinKT-66894
XCFramework task fails when name passed to xcframework DSL is different from framework's nameKT-65675
XCFrameworkTask produces an xcframework with mismatched casing in embedded frameworks
Backend. Native. Debug
KT-71374
lldb: step out breaks breaking in Xcode 16
Backend. Wasm
KT-72156
custom-formatters.js exists in JAR after publishToMavenLocal but not in the published artifact in Maven publicKT-70331
Support incremental compilation for the Wasm backendKT-71686
K/Wasm: Add functions to convert between Kotlin and JS array typesKT-71473
K/Wasm: Use--closed-world
and related options for BinaryenKT-71800
Wasm compiler: Fix member generation for data classes with an array-type propertyKT-71580
String::toFloat on wasm behaves differently compared to other targetsKT-71523
K/Wasm: cleanup after fix for KT-71474KT-71475
K/Wasm: KClass::qualifiedName returns incorrect result for nested or companion objectsKT-71474
K/Wasm: KProperty*Impl equals work incorrectly for clabbale reference created in different files or modulesKT-71294
Wasm Artifacts/Resource are being loaded relatively instead of absolutely
Compiler
New Features
KT-71094
Kotlin/Native incremental compilation: fail compilation if cache build failedKT-70679
Kotlin/Native: fill WritableTypeInfo from Swift Export type mappingKT-54227
Cannot use nullable Nothing as reified type parameterKT-71430
Kotlin-to-Java direct actualization implementationKT-68163
Expose supplementary compiler warnings via CLI
Performance Improvements
KT-71159
[K2] OOM on large enum classes with fields
Fixes
KT-71480
JAVA_CLASS_INHERITS_KT_PRIVATE_CLASS isn't reported while java object isn't createdKT-71508
JAVA_CLASS_INHERITS_KT_PRIVATE_CLASS isn't reported when java class is inherited from an effectively private classKT-71260
K2: Internal compiler error in IrFakeOverrideSymbolBase.getOwner when there is no actual for expectKT-58820
OPT_IN_USAGE_ERROR's message text does not account for SubclassOptInRequiredKT-71034
Failing compiler/testData/codegen/box/inlineClasses/kt70461.ktKT-71016
K/Wasm: Failing compiler/testData/codegen/box/inlineClasses/kt70461.ktKT-60521
Drop language versions 1.4 and 1.5KT-72154
Dokka fails withnot array: KClass<out Annotation>
on Kotlin 2.1.20-dev with@SubclassOptInRequired
KT-70562
@SubclassOptInRequired
cannot accept multiple experimental markerKT-71708
False negative UNSUPPORTED for collection literals as trailing return valueKT-52469
Deprecate 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-71756
K2 evaluator: broken resolve of private members during debug of Kotlin project itselfKT-71550
JVM IR: NPE on identity equals of boolean true with nullKT-71490
K2: missing REDUNDANT_ELSE_IN_WHENKT-64403
Implement BlackBoxCodegenTestSpecGenerated for K2KT-71551
JVM IR K1: NPE on generating a function imported from an object from another moduleKT-71210
K2: false negative FUNCTION_CALL_EXPECTED / NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE with companion objectsKT-69549
Try to move callable reference transformation earlier in pipelineKT-71228
K2: "IllegalArgumentException: Failed requirement" caused by lambda parameter and class typeKT-71738
K2: False negative REDECLARATION inside object expressionKT-70407
Error/warning message for@SubclassOptInRequired
-annotated class should provide more contextKT-71701
K2: false positive CAN_BE_VAL with lateinit and non-in-place lambdaKT-68694
K2 IDE / Kotlin Debugger: AE “Unresolved reference: <HIDDEN: samples/gen/classes/enum class/EnumClass.lam is invisible” on evaluating private lambda inside enum entryKT-70970
K2 IDE / Kotlin Debugger: AE “Only assignable IrValues can be set” on calling overloaded inc() operator on interfaceKT-70824
K2: NoSuchFieldException when evaluating private extension propertyKT-70390
K2 IDE / Kotlin Debugger: can't invoke lambda from private class during evaluationKT-68701
K2 IDE / Kotlin Debugger: AE “ERROR_CALL 'Unresolved reference: <HIDDEN: /privateLambda is invisible>#' type=IrErrorType(null)” on evaluating private top-level lambdaKT-68695
K2 IDE / Kotlin Debugger: AE “Unsupported callable reference” on evaluating ::lateinitStr on private lateinit propertyKT-70861
K2 IDE / Kotlin Debugger: can't evaluate Clazz::class call for private classKT-34911
Improve error message for WRONG_ANNOTATION_TARGET: list applicable targetsKT-8322
Prohibit use of Nothing as catch parameterKT-71601
K2: When with a subject of type dynamic always considered exhaustiveKT-33091
Kotlin/Native: Compiler crashes if an external class is declaredKT-59651
K1/K2: Assertion error on external enum usage attemptKT-71121
Kotlin/JS incremental compilation fails with KotlinIllegalArgumentExceptionWithAttachmentsKT-69939
Extract a category of internal FIR checkers from supplementary FIR checkersKT-71122
Regression in Kotlin Compiler 2.0 causing NPE in the runtimeKT-71117
K2: "IllegalArgumentException: No type for StarProjection" with star projection and function typeKT-71251
Native & JS K2: Missing check for callingisInitialized
inside inline funKT-71215
K2: UB due to the erroneous greening of the red code with multiple delegation with javaKT-59386
K2: Missing CONSTANT_EXPECTED_TYPE_MISMATCHKT-69040
PCLA: deal with "deep" calls that can be fully analyzed properlyKT-71046
K/N: a separate lowering to convert function reference to IrConstantObjectKT-70931
K2 / Scripts: "cannot convert IrExpression to ConstantValue" when using function annotationKT-69223
Drop parallel lowering mode in JVM backendKT-70260
@JsPlainObject
: improve compiler error if a method is presentKT-67739
Improve error message when JDK used in -Xjdk-release has corrupted class filesKT-63964
K2: different naming of classes defined in script in metadataKT-70014
Common inference: introduce rigidTypeMarkerKT-71352
Cannot load script definition class org.gradle.kotlin.dsl.KotlinProjectScriptTemplateKT-63502
Getting java.lang.ClassNotFoundException: javaslang.λ during compilationKT-66316
Kotlin/Native: make@Escapes
annotation required for all external functionsKT-70965
FIR/AA: Initializers for Java annotation arguments mapping capture use-site sessionsKT-64453
K2: Implement ComposeLikeIr...TestGenerated for K2KT-30424
Confusing error message "modality is different"KT-70846
ReplaceConeKotlinType.nullability
withisMarkedNullable
on specific typesKT-56720
K2: false positive MANY_IMPL_MEMBER_NOT_IMPLEMENTED in case of delegation in diamond inheritanceKT-69937
Define & enforce user-friendly terminology for extended checkersKT-64406
K2: Implement CompileKotlinAgainstJavaTestGenerated for K2KT-69938
Validate sets of default compiler warnings and supplementary compiler warningsKT-68971
Investigate suspicious fragmentation of FIR trees for string literals with interpolationKT-71213
Rethrow exceptions in checkers with some useful attachmentsKT-71189
K2: emit 'DELEGATE_SPECIAL_FUNCTION_MISSING' and 'DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE' on 'by' keywordKT-71178
K2: False negative NO_ELSE_IN_WHEN in when over nullable type with!is Nothing?
checkKT-70812
False positive NO_ELSE_IN_WHEN with nullable type argument as subjectKT-70947
False positive NO_ELSE_IN_WHEN with DNN subject and nullable sealed class upper boundKT-67383
Incorrect optimisation when optimising for loop with UByteKT-70752
Review diagnostics with whole declaration as rangeKT-71160
K2: Rendering of flexible collection types and arrays is too verboseKT-61227
Definitely non-nullable types cause "Any was expected" for@Nullable
parameterKT-69389
K2: NONE_APPLICABLE instead of more useful "type mismatch" error with overloads and parameter nullability mismatchKT-70930
K2: Java annotations not present on ENUM_ENTRY IR elementsKT-69794
K2: Wrong target is reported for EXPOSED_SUPER_INTERFACE diagnosticKT-70724
False-positive UNINITIALIZED_VARIABLE for inline constructor with late-initialized variablesKT-70749
False-positive UNINITIALIZED_VARIABLE for inline fun with crossinline modifier
Compose compiler
New features
b/328817808
Added the PausableComposition feature flags
Fixes
b/366040842
,b/365066530
Replace deep copy in Compose plugin with in-place type mutationb/329477544
Force open / overridden Composable functions to be non-restartable.b/361652128
Disable live literal transform if the corresponding flag is disabled
IR. Actualizer
KT-71631
Kotlin-to-Java direct actualization: java annotation element isn't actualizedKT-71597
Kotlin-to-Java direct actualization: it is possible to actualize a function with default parametersKT-71592
Kotlin-to-Java direct actualization: constructor of nested class can't be actualizedKT-71577
Kotlin-to-Java direct actualization: method can be actualized by java static methodKT-71817
Actualization of static members is broken for non-JVM platforms
IR. Inlining
Fixes
KT-69565
Don't generate synthetic accessors for private symbols inside local classesKT-71137
Generate synthetic accessors for backing fieldsKT-64865
Explicitly generate accessors for private declarations in inline functionsKT-70420
Enable double-inlining in Native & JS backends by defaultKT-71657
K/JS: Double-inlining causes failures in IC with top-level synthetic accessorsKT-71659
IR Inliner fails to inline function expressions due to implicit cast from the 1st phase of inliningKT-71078
Inline all functions in local classes at the 1st stage of inliningKT-66508
IR inliner: Add implicit cast for initializer of temporary variablesKT-66507
IR inliner: Enable implicit casts in all KLib backendsKT-69466
IrInlinedFunctionBlock: Refactor it to make it possible to serialize in KLIBsKT-69317
IR Inlining. Try to place inlined arguments outsideIrInlinedFunctionBlock
KT-69307
Source offsets seem incorrect after IR inliningKT-67149
Common Native/JS lowering prefix at the 2nd phase of compilationKT-69681
IR: Report warnings on exposure of private types in non-private inline functionsKT-71232
Implement an IR validation check that ensures that all IrFields are private on non-JVM backendsKT-67304
Keep in common prefix: Shared variables + local classes in inline lambdasKT-70583
Internal error in body lowering: java.lang.IllegalStateException: An attempt to generate an accessor after all accessors have been already added to their containers
IR. Tree
KT-71826
stdlib fails to compile with-Xserialize-ir=all
KT-67752
Make copyRemappedTypeArgumentsFrom and transformValueArguments methods in DeepCopyIrTreeWithSymbols protected instead of privateKT-69644
Report warning on cross-file IrGetField operations generated by compiler pluginsKT-71191
SymbolTable: Check if the provided signature is public before adding a symbol to the SymbolTable
JavaScript
Fixes
KT-70117
Generate debug info for code fromjs
callKT-69408
[JS] Enable insertAdditionalImplicitCasts=true (as in other KLIB-based backends)KT-67452
K2: Consider hiding dynamic type creation under FlexibleTypeFactory for JS onlyKT-70226
Delete JS tests that were only run with the legacy JS backendKT-71338
K/JS: Add a flag for switching generating arrow functions on & offKT-70707
KJS: asJsReadonlyMapView does not implement ReadonlyMap correctlyKT-71220
Fix invalid IrFunctionReference creation in InnerClassConstructorCallsLoweringKT-70229
Remove test classes related to the legacy JS backendKT-70359
Remove legacy backend-related test directives from Kotlin/JS testsKT-70362
Clean up Gradle tasks for running JS tests against the legacy JS backendKT-30016
JS BE does not generate special bridge methods
Klibs
KT-64169
[KLIB Resolve] Don't skip libraries that happen to have the sameunique_name
KT-67448
[KLIB Resolve] Deprecate passing KLIB unique names via CLIKT-71455
[KLIB Resolve] Forbid passing KLIB unique names via CLIKT-67474
K2: Missing@ExtensionFunctionType
in metadata in KLIBsKT-67450
[KLIB Resolve] Kotlin/Native: Only one implicit repository should remain for the compiler ("dist")KT-61098
[KLIB Resolve] Don't allow working with KLIB "repositories"KT-66218
Clean-up the code for serialization & deserialization of DFGs to & from KLIBs
Language Design
KT-71222
Remove@ExperimentalSubclassOptIn
from SubclassOptInRequiredKT-67675
Allow usage of Array<Nothing?>KT-69924
Mention 'if' guard when '&&' is used incorrectly
Libraries
Performance Improvements
KT-66715
Performance: faster alternative to String.lines()
Fixes
KT-71628
Review deprecations in stdlib for 2.1KT-71660
Stabilize experimental API for 2.1KT-54299
Extract org.w3c declarations to separate library from K/Wasm StdlibKT-68027
Document caveats and deincentivise usage of measureTimeMillisKT-71581
Update outdated documentation to common lazy and provide samplesKT-71796
Improve documentation for Path.walk and Path.visitFileTree functionsKT-69545
Kotlin/Native: Deprecate API marked with FreezingIsDeprecated to errorKT-38754
Deprecate appendln in favor of appendLineKT-68019
Fill in missing package descriptions for standard library documentationKT-52181
Native: Inconsistent behaviour of LinkedHashMap#entries on JVM and NativeKT-71570
Document suspend lambda builderKT-46785
Get rid of !! after readLine() in the standard library
Native
KT-71435
Native: cannot access class 'objcnames.classes.Protocol'
Native. Build Infrastructure
KT-71820
Update the coroutines version used in kotlin-native build infrastructure
Native. Platform Libraries
KT-70032
Rebuild platform libraries in 2.1.0 with Xcode 16KT-71624
Eliminate remaining UIKit/AppKit removed signaturesKT-70031
Rebuild platform libraries in 2.0.21 with Xcode 16
Native. Runtime
KT-70680
Kotlin/Native: Use WritableTypeInfo when creating Swift wrapper from the runtimeKT-70568
Native: revert workaround for debug with LLVM 16
Native. Runtime. Memory
KT-70364
Kotlin/Native: data race during GC initialization
Native. Swift Export
KT-71539
Swift Export: export class member overridesKT-70678
Swift Export: generate Kotlin<->Swift type mappingKT-70920
Swift Export Nullability: primitive typeKT-71087
Swift Export: Nullability: NeverKT-71086
Swift Export: Nullability: StringsKT-70919
Swift Export Nullability: reference typeKT-71026
Swift Export: function overloading with ref types does not workKT-70960
Swift Export nullability: add nullability to sir and printer
Reflection
KT-71378
KotlinReflectionInternalError: Inconsistent number of parameters in the descriptor and Java reflection object
Tools. CLI
KT-70179
K2: Building a file with kotlin-test-junit without junit does not include annotationsKT-71537
Add JVM target bytecode version 23KT-61745
K2: support light tree in multi-module chunk modeKT-70885
Errors are not reported for wrong arguments in -Xsuppress-warning flag for non-jvm backendsKT-70991
K2: Compilation fails if project version has a comma
Tools. CLI. Native
KT-68673
Kotlin/Native "You have not specified any compilation arguments. No output has been produced" when no source nor-Xinclude
is passed
Tools. Compiler Plugins
KT-71658
Transform top-level atomic properties to Java boxed atomicsKT-65645
Atomicfu-plugin: compilation hangs on a long string concatenationKT-69038
Power-Assert does not display const valsKT-71525
Setting JvmAbiConfigurationKeys.REMOVE_PRIVATE_CLASSES = true triggers java.util.ConcurrentModificationExceptionKT-41888
IrExpression startOffset and endOffset are inconsistent with raw file textKT-69856
Compose Plugin: IrType.erasedUpperBound throws NullPointerException when evaluating IrScript nodes due to missing targetClassKT-69410
PowerAssert: Cannot find overload of requireNotNull without existing messageKT-66293
Atomicfu-plugin: wrong return types for lowered extension functionsKT-71038
PowerAssert: Constant on RHS of elvis operator leads to compiler crash
Tools. Daemon
KT-69929
compileKotlin task reports that daemon has terminated unexpectedly
Tools. Fleet. ObjC Export
KT-71162
ObjCExport: nullable functional type with reference argumentsKT-71022
ObjCExport: enum c keywords translationKT-71082
ObjCExport: KotlinUnit translated as Function1KT-70781
ObjCExport: classifiers and callables type parameters translationKT-70943
ObjCExport: extension orderKT-70840
ObjCExport: duplicated interfaces
Tools. Gradle
New Features
KT-71602
Introduce KotlinTopLevelExtensionKT-71603
Introduce KotlinJvmExtension and KotlinAndroidExtensionKT-70383
KotlinJvmFactory registerKaptGenerateStubsTask() function should also request compilation task providerKT-69927
Need ability to pass KotlinJvmCompilerOptions to registerKotlinJvmCompileTask()KT-69940
Expose supplementary compiler warnings via KGPKT-71227
[Compose] Add PausableComposition feature flag to the Compose Gradle Plugin
Performance Improvements
KT-65285
Use uncompressed Klibs
Fixes
KT-69851
Compatibility with Gradle 8.10 releaseKT-58956
Offer a shared interface for JVM and Android compilerOptions in Project extensionKT-71405
Compose compiler gradle plugin: project.layout.file can't be used as a value of the 'stabilityConfigurationFiles' optionKT-65565
Remove deprecated common platform plugin idKT-70430
Clean-up obsolete Gradle plugin variants for Gradle versions <7.6KT-69853
Compile against Gradle API 8.10KT-69852
Run Gradle integration tests against Gradle 8.10 releaseKT-71411
Add FUS statistics for new Dokka tasksKT-71291
Log plugins from the list as Gradle pluginsKT-66049
KGP JVM: Publishing isn't compatible with isolated projects and project dependenciesKT-65990
UpdateGradleDeprecatedOption.level
values for arguments removed from the DSL after 2.1
Tools. Gradle. JS
KT-69628
K/Wasm: Node.js version per projectKT-71536
[JS, Wasm] Stop collecting information about KLIB IC in Kotlin2JsCompile
Tools. Gradle. Multiplatform
New Features
KT-70897
Add KotlinBaseApiPlugin.kotlinAndroidExtension
Fixes
KT-72068
Distribution for klib cross-compilation is not downloaded during compile tasksKT-69412
ChangeKotlinTargetAlreadyDeclaredChecker
's severity from warning to errorKT-66461
Promote compiler options DSL for multiplatform projects to stableKT-71529
Deprecate targetFromPreset API with an errorKT-71423
Xcode archive missing dSYM files since Kotlin 2.0.20KT-71209
Drop Hierarchy Template diagnostic about used shortcutsKT-71675
checkSandboxAndWriteProtection collides with Compose's syncComposeResourcesKT-71428
Change deprecation message for KMP target shorcutsKT-71444
Certain POMs produced by Kotlin 2.0.20 cannot be consumed by KMP projects with Android targetsKT-69974
KMP: POM dependency rewriter doesn't work with Included Builds OR dependencySubstitutionKT-58231
Kotlin Gradle Plugin: set deprecation level to Error for KotlinTarget.useDisambiguationClassifierAsSourceSetNamePrefix and overrideDisambiguationClassifierOnIdeImportKT-71206
KGP: Test source set may get duplicated KLIBs of different versions
Tools. Gradle. Native
KT-71398
kotlinNativeBundleConfiguration should not contain dependencies on unsupported platformsKT-45559
CInteropProcess: Changes to header files are not recognized; Task is still UP-TO-DATEKT-71722
kotlinNativeBundleConfiguration present in JVM-only Gradle project
Tools. JPS
KT-71450
Constant build failure: com.intellij.util.io.ClosedStorageException: storage is already closed
Tools. Kapt
KT-71431
K2KAPT fails on modules without any annotation processors
Tools. REPL
KT-71109
Kotlin Scripting REPL doesn't support keyboard shortcuts
Tools. Scripts
KT-68685
K2 / Script: "KotlinReflectionInternalError: Unresolved class:" caused by main.kts script with nested classes and reflection