Skip to content

Kotlin 2.0.0-Beta4

Pre-release
Pre-release
Compare
Choose a tag to compare
@KotlinBuild KotlinBuild released this 13 Feb 12:07

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 loading
  • KT-63330 Analysis API: Stub-based deserialized symbol providers provide unresolved enum entry annotation arguments
  • KT-65418 Analysis API: LLFirAbstractSessionFactory loads anchor module sessions eagerly
  • KT-64718 Analysis API: do not expose SealedClassInheritorsProvider and FirRegularClass to IDE Plugin
  • KT-65075 K2: getContainingDeclaration() is broken for declarations inside code fragments
  • KT-61332 Support KtTypeCodeFragment in PsiRawFirBuilder
  • KT-65150 AA: incorrect result from KtTypeProvider#getReceiverTypeForDoubleColonExpression for Java static method
  • KT-55750 LL FIR: Implement multi-threaded resolve
  • KT-56551 LL FIR: implement parallel resolve for jumping phases
  • KT-65223 Psi: avoid KtFile usages
  • KT-65307 Analysis API FE10: support KtFe10AnalysisSessionProvider.getAnalysisSessionByUseSiteKtModule
  • KT-62695 K2 IDE: Unresolved extension functions in KDoc
  • KT-65152 Analysis API: KDoc references to packages are not fully resolved
  • KT-64988 K2 IDE: Navigation from the named argument in safe call does not work
  • KT-64074 K2: Investigate LL divergence for Script.testTopLevelPropertyInitialization
  • KT-64921 K2 IDE: references in platform code resolve to expect classifier instead of actual
  • KT-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 calls
  • KT-64883 Allow direct creation of KtCommonFile
  • KT-64646 K2: properly forbid ast loading during raw fir phase in tests
  • KT-64862 Psi: missed parenthesis in type reference presentation
  • KT-62893 K2 IDE. FP 'when' expression must be exhaustive with Java sealed interface from library
  • KT-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 classes
  • KT-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 initialisation
  • KT-64803 K/Wasm: non-capturing lambdas are not singleton unlike same lambdas in jvm
  • KT-64449 K2: Implement K1WasmWasiCodegenBoxTestGenerated for K2
  • KT-64829 K/Wasm: division remainder has a wrong sign
  • KT-65009 Generate TypeScript definitions for the @JsExport declarations in K/Wasm

Compiler

New Features

  • KT-63670 Implement platform specific declaration clash diagnostics across all backends
  • KT-62547 Introduce a language feature flag for smartcasts based on "memory" variables

Fixes

  • KT-63344 K2: False positive ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
  • KT-58845 K2: SAM checker can run incorrectly in presence of an expect supertype
  • KT-61843 K2: Missing TYPE_MISMATCH for nested array literals
  • KT-61798 K2 incorrectly calculates modality of property accessors
  • KT-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 throw
  • KT-49283 Support contribution type info from a nested builder inference call
  • KT-64077 K2: Builder inference ignores constraints from nested builder inference
  • KT-49160 Couldn't infer a type argument through several builder inference calls broken by a local class
  • KT-61310 K2: "Not enough information to infer type variable R" for transformLatest
  • KT-63733 Builder-style type inference can't resolve to extension overloads when they're more applicable than member ones
  • KT-57707 K1: inconsistent TYPE_MISMATCH in builder inference
  • KT-55057 Builder inference changes behaviour sporadically based on BI annotation on unrelated call
  • KT-60663 Builder inference does not work inside a nested unrelated builder inference lambda
  • KT-53639 TYPE_MISMATCH: compiler can't infer the list's type when using buildList {} builder or Collection#isNotEmpty
  • KT-60291 K2: "IllegalStateException: Cannot serialize error type: ERROR CLASS: Cannot infer argument for type parameter T" during FIR serialization
  • KT-65033 K2: Fir2LazyIr: Lazy type aliases not supported
  • KT-57709 Inconsistent extension function call resolution in builder inference
  • KT-53740 Builder inference with multiple lambdas leads to unsound type
  • KT-60877 Builder inference from the null literal results in Nothing instead of Nothing? for producing positions of the postponed type variable
  • KT-53553 Builder inference: inconsistent types in different lambda scopes
  • KT-54400 K2: builder inference does not work with assignments of literals to member properties
  • KT-53109 CompilationErrorException generateUnboundSymbolsAsDependencies with builder inference and lambdas
  • KT-52757 Type inference for builders fails if inferred from a function
  • KT-63840 Builder inference fails on calls to identity-shaped functions with postponed type variables inside select-constructions
  • KT-64276 [K/N][K2] K2 behaviorial difference with inconsistent inheritance of ObjCName
  • KT-59782 K2: Forbid local delegated properties with private accessors in public inline functions
  • KT-65482 K2: NoSuchFieldError due to using unboxed type
  • KT-63208 K2: Implement deprecation cycle and fix missing errors for error-level nullable arguments of warning-level Java types
  • KT-64891 K2: consider supporting/forbidding foo.(bar)() syntax
  • KT-62134 K2: handle non-simple types during FirStatusResolver.isPrivateToThis check
  • KT-65290 K2: No override for FUN DEFAULT_PROPERTY_ACCESSOR
  • KT-65111 K2: Java star imports don't work in KJK interdependencies
  • KT-59012 K2: Support inferring types based on self upper bounds
  • KT-65373 K2: there is a crash in KJK hierarchy with an extension member property
  • KT-65277 IrFakeOverrideBuilder: NPE from IrJavaIncompatibilityRulesOverridabilityCondition.doesJavaOverrideHaveIncompatibleValueParameterKinds
  • KT-62884 K2: different signature of delegate object for generic extension property
  • KT-59630 K2: Implement running FIR Blackbox tests on different JDKs
  • KT-64944 Can't assign null after early return smart cast with typed destructive assignment
  • KT-64910 K2: AA FIR: KtCall's argument mapping misses SAM conversion argument
  • KT-64846 K2: false negative CONFLICTING_JVM_DECLARATIONS on inheritance from Java collection subclass with a conflicting override
  • KT-60732 K2 Scripting: TeamCity DSL test
  • KT-65165 K2: "ClassCastException: class java.lang.String cannot be cast to class SampleClass"
  • KT-64982 K2: false negative FUNCTION_CALL_EXPECTED
  • KT-64872 K2: do-while condition able to access uninitialized variable
  • KT-65318 K2: Substitution stackoverflow on jspecify @NullMarked superclass
  • KT-65010 Kotlin/Native: code generation for a static field is failing
  • KT-59921 K2: Disappeared NULL_FOR_NONNULL_TYPE
  • KT-57299 K2: VerifyError due to overriding final method size on a subclass of Collection and Set
  • KT-57300 K2: subclass of MutableCollection with primitive element type has methods with boxed type
  • KT-58279 K2. False-negative Smart cast to is impossible, because is a public API property declared in different module for Java static field
  • KT-64706 K2: Type inference cannot resolve nullable @Composable lambda
  • KT-65058 K2: Protected function call from public-API inline function is prohibited in anonymous object
  • KT-53629 K2: forbid multiple labels per statement
  • KT-65316 K2: False positive USAGE_IS_NOT_INLINABLE for expression labeled with illegal label
  • KT-57268 K2: extra methods remove and/or getOrDefault are generated for Map subclasses with JDK 1.6 in dependencies
  • KT-63151 K2: Assignment within function lambda should invalidate contract DFA implications
  • KT-63351 K2. No smart cast with not-null assertion operator after a safe call
  • KT-65324 atomicfu-plugin: top-level delegated properties cause NPE
  • KT-60246 K2: origin is not set for getting array element operator
  • KT-64387 K2: Missing POSTFIX_INC/DEC origin for array element inc/dec
  • KT-61891 K2: POSTFIX_{INCR|DECR} of global misses an origin
  • KT-65019 K2: unexpected exception when executing inc/dec in finally block on WASM
  • KT-64392 Factor out KLIB serialization logic from the backend.native module
  • KT-65270 K2: Missing ACTUAL_WITHOUT_EXPECT when expect is fake-override
  • KT-60367 K2: Support EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE diagnostics
  • KT-62704 Absent testrunner FirLightTreeDiagnosticTestSpecGenerated
  • KT-65044 K2 compiler crash on unresolved delegated extention receiver
  • KT-65021 K2: Missing error and miscompilation in destructuring declaration delegation
  • KT-63899 K2: Vararg parameter misses annotation in metadata
  • KT-60175 JVM IR inline: accidental reification of typeOf type argument
  • KT-60174 JVM IR inline: accidental reification in various cases
  • KT-65103 K2: IllegalArgumentException: IrErrorCallExpressionImpl(5388, 5392, "Unresolved reference: R?C|/cont|") found but error code is not allowed
  • KT-64635 K2: "KotlinIllegalArgumentExceptionWithAttachments: Expected expression 'FirAnonymousFunctionExpressionImpl' to be resolved" when provideDelegate is extension of function with receiver
  • KT-63434 K2. False positive Cannot access with protected nested classifiers references inside anonymous object inherited from containing class
  • KT-64314 K2: Rename FirConstExpression to FirLiteralExpression
  • KT-63577 K2: false-positive "wrong number of type arguments" error on callable reference to member of generic function's local class
  • KT-64975 FIR: Deserialize enum entry annotation arguments from binary libraries with lookup tags instead of symbols
  • KT-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 lambda
  • KT-59729 K2: Investigate CFG buildings for inner lambdas in case of double-lambda builder inference
  • KT-64841 K2: argument type mismatch with type parameter with recursive bound
  • KT-62554 K2: incorrect "inherits multiple implementations" error when base Java method takes a parameter of primitive wrapper type
  • KT-65093 K2: Super constructor call able to access uninitialized object fields
  • KT-56489 K2 allows reading uninitialized variable in object declaration
  • KT-59987 K2: Disappeared REIFIED_TYPE_FORBIDDEN_SUBSTITUTION
  • KT-36786 Smartcast doesn't work in case of property infix call
  • KT-65056 IrFakeOverrideBuilder: ISE "No override for FUN" on package-private Java method in K-J-K hierarchy
  • KT-62045 IrFakeOverrideBuilder: incorrectly merged fake overrides for Java methods accepting wrapper Double and primitive double
  • KT-57640 [K2/N] Investigate behaviour for intersection overrides for properties that have incompatible types
  • KT-59682 K2: Use proper source for vararg arguments
  • KT-63781 K2: Generated blocks appear in the IR
  • KT-63779 K2: Regression for locations of 'if' statements
  • KT-63624 K2: incompatible declaration because of different visibility
  • KT-64400 K2: allow to use simple boolean expressions as constants
  • KT-59972 K2: Disappeared EXPRESSION_EXPECTED_PACKAGE_FOUND
  • KT-63256 K2: NOT_IDENTITY operator call is illegal in contract description
  • KT-63529 K2: Compiler does not detect tailrec call with nullable type
  • KT-65012 IR Evaluator: NoSuchFieldException when evaluating protected/private fields of superclasses
  • KT-64871 IrFakeOverrideBuilder: ISE "no override for " on HashMap subclass
  • KT-60262 Support for inter-module interaction for @SubclassOptInRequired
  • KT-58739 K2: Rewrite CallableId.classId to be thread-safe
  • KT-64979 K2: Missing REDUNDANT_TYPE_PARCELER when using type alias
  • KT-60019 K2: Introduced PARCELER_TYPE_INCOMPATIBLE
  • KT-62500 K2: origin=GET_PROPERTY is wrongly set to GET_FIELD of backing field inside property's own getter
  • KT-64743 K2: Non-expanded type serialized in metadata
  • KT-64405 K2: Implement CompileJavaAgainstKotlinTestGenerated for K2
  • KT-64837 K2: NPE in fir2ir when generic transitive dependency class is missing
  • KT-60258 Support java-kotlin interop for @SubclassOptInRequired
  • KT-60260 K2: Implicit coercion to unit is not generated in adapted function reference
  • KT-60858 Remove redundant createDeprecatedAnnotation necessary to workaround kotlinx-serialization compilation with native
  • KT-64432 Unbound symbol access in Fir2Ir fake override builder
  • KT-64466 K2: Delegated method annotations are not copied in IR
  • KT-63589 K1: Unsound type inference for unbound callable reference to star-projected class's generic mutable property
  • KT-61032 K2: False positive “Unused variable” for function callable reference
  • KT-64832 K2: False positive "Unused variable" checker report on suspend functional types, on overloaded functional types and on custom invoke operator types
  • KT-64609 K2: INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE diagnostic is missed for primary constructor properties
  • KT-61937 K2: implicit script receiver from ScriptDefinition are not visible for invoke
  • KT-27936 Write InnerClasses attribute for all class names used in a class file
  • KT-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 hierarchy
  • KT-65499 IrFakeOverrideBuilder: ISE IrSimpleFunctionPublicSymbolImpl is already bound for irrelevant 'remove' clashing with a function from Java collection subclass
  • KT-64150 IrFakeOverrideBuilder: Fake overrides for static java functions are not generated
  • KT-65432 IrFakeOverrideBuilder - No override for FUN IR_EXTERNAL_JAVA_DECLARATION_STUB name:elementData
  • KT-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 names
  • KT-64548 KJS / K2: "Cannot find delegated constructor call" caused by external classes constructors
  • KT-63359 K2: support new ways to declare TestResult in JS TestGenerator lowering
  • KT-44871 Add @JsExport and @JsName annotations to stdlib classes (especially collections) to avoid method name mangling and improve Kotlin usability from JS
  • KT-64867 K2 JS: Name clash between constructors with same JsName but in different classes
  • KT-64463 KJS / K2: "Name contains illegal chars that cannot appear in JavaScript identifier" caused by non-ASCII character
  • KT-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 exception
  • KT-61143 [klib tool] Dump IR with unbound symbols

Language Design

  • KT-58881 K2: Run checkers in common code against platform session
  • KT-64187 K2: False positive ABSTRACT_NOT_IMPLEMENTED caused by the fact that common code sees platform code of its dependencies
  • KT-62959 Value of captured type is not a subtype of the same captured type
  • KT-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-test
  • KT-63355 Detect concurrent modifications in ArrayDeque
  • KT-57150 Consider introducing Common protected property AbstractMutableList.modCount
  • KT-64956 Implement optimized removeRange for ArrayDeque
  • KT-57151 Consider introducing Common protected function AbstractMutableList.removeRange
  • KT-58039 Wasm: Implement unsigned numbers using wasm builtin capabilities
  • KT-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 overhead
  • KT-64313 Kotlin Native: Seg Fault during Garbage Collection on 1.9.21 (observed on iOS)

Reflection

  • KT-57972 Reflection: "KotlinReflectionInternalError" when using callBy 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 ABI
  • KT-59074 K2: false-positive MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT if allOpen plugin is used and a val is defined with init {} block
  • KT-64589 jvm-abi-gen: Order of class members affects ABI jar
  • KT-65072 jvm-abi-gen: SourceDebugExtension annotation isn't stripped along with corresponding attribute
  • KT-64971 Exception is thrown when compiling kotlinx.coroutines to Native because of the new signature clash diagnostics
  • KT-54025 [K2] [NONE_APPLICABLE] compiler error in case @ AllArgConstructor annotation is used together with a static field
  • KT-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 necessary
  • KT-65281 ObjCExport: AA: Run already passing Unit Tests on CI
  • KT-65080 ObjCExport: Analysis-Api: error handling
  • KT-64952 ObjCExport: Analysis-Api: object
  • KT-64869 ObjCExport: Analysis-Api: Support 'MustBeDocumented' annotations
  • KT-64839 ObjCExport: Enable tests on CI for aggregate
  • KT-64888 ObjCExport: Analysis Api: Support exporting KDoc

Tools. Gradle

  • KT-62639 Compatibility with Gradle 8.4 release
  • KT-65143 Use the new ConfigurationContainer dependencyScope method to create dependency declaration configurations
  • KT-64848 Log K/Native compiler arguments with log level specified for compiler arguments
  • KT-65213 Collect logic for FUS metrics calculation in one place
  • KT-61698 Compiler options configured inside metadata {} target set up all targets in a project
  • KT-59024 Compatibility with Gradle 8.3 release
  • KT-60664 Gradle 8.3: KGP eagerly creates compile task

Tools. Gradle. JS

  • KT-64119 K/JS: Migrate package manager from Yarn onto NPM
  • KT-65295 Gradle: K/N and K/JS tests may produce unrequested TeamCity service messages

Tools. Gradle. Multiplatform

  • KT-61943 Mark the checkKotlinGradlePluginConfigurationErrors as UP-TO-DATE when possible
  • KT-61559 Include stdlib and platform dependencies to KotlinNativeCompilation.compileDependencyFiles API
  • KT-65196 Add high-level DSL to configure compiler options in the multiplatform project
  • KT-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 targets
  • KT-52567 Use Gradle dependency management for downloading Kotlin/Native compiler when compiling with Gradle
  • KT-64903 Add maven repo with dev versions into IT
  • KT-51255 Kotlin/Native should not download compiler artifacts when not necessary
  • KT-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 default
  • KT-61080 Kapt: investigate suspicious check for KMutableMap.Entry in KaptTreeMaker
  • KT-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