github JetBrains/kotlin v2.2.0-Beta2
Kotlin 2.2.0-Beta2

latest releases: build-2.3.0-dev-5671, build-2.3.0-dev-5665, build-2.3.0-dev-5661...
pre-release4 months ago

Changelog

Analysis API

  • KT-73337 Migrate analysis sources to new IR parameter API
  • KT-68393 Analysis API: Rename KaClassLikeSymbol. classIdIfNonLocal to classId
  • KT-62924 Analysis API: rename KtCallableSymbol.callableIdIfNonLocal -> callableId
  • KT-63718 Analysis API: Stub-based dependency symbol providers of library source sessions compute the wrong package name sets

Analysis API. FIR

Fixes

  • KT-76540 K2: Missing library dependency on Android SDK from androidx.activity-1.8.2 causes LiveEdit failures
  • KT-73266 K2. "Declaration should have non-local container" with unclosed annotation on top-level function
  • KT-76432 JavaClassUseSiteMemberScope: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl
  • KT-76217 K2 AA: "No fir element was found for KtParameter" with multiple context parameter lists
  • KT-76366 ContextCollector: annotations on class members don't have the class as implicit receiver
  • KT-76352 ContextCollector: wrong class annotation context in BODY mode
  • KT-76341 ContextCollector: support dangling modifiers
  • KT-76332 "Declaration should have non-local container" for declaration inside file annotation
  • KT-76331 Cleanup FileStructureElement for classes
  • KT-76115 Disable FirElementBuilder#getFirForElementInsideAnnotations optimization for files, classes and scripts
  • KT-76347 ContextCollector: avoid resolution for enum entry annotations
  • KT-76272 Cleanup AbstractFileStructureTest
  • KT-75542 K2 AA: "FirDeclaration was not found for class KtNamedFunction, fir is class FirErrorExpressionImpl" for unclosed annotation on member function
  • KT-73117 K2 AA: Exception "Setter is not found" when val has a setter without body
  • KT-73719 K2. "FirDeclaration was not found for class KtDestructuringDeclaration, fir is class FirBlockImpl" on incorrect chain call

Analysis API. Providers and Caches

  • KT-74541 Analysis API: Include files generated by resolve extensions in KaModule content scopes
  • KT-64236 Analysis API: Introduce a separate module for fallback dependencies of library source modules
  • KT-63780 Analysis API: Invalidate resolvable library sessions when binary library modules are modified

Analysis API. Stubs and Decompilation

  • KT-71787 PsiRawFirBuilder.Visitor#visitStringTemplateExpression forces AST loading

Analysis API. Surface

  • KT-76018 K2: Stop the wold leads to deadlock/freeze
  • KT-73669 Support psi-based symbol pointer for implicit primary constructors
  • KT-76011 KaFirNamedClassSymbol#companionObject doesn't provide generated objects generated by compiled plugins
  • KT-76008 Provide PSI-based implementation for KaFirNamedClassSymbol#companionObject

Backend. Native. Debug

  • KT-75991 Xcode 16.3: Fix lldb stepping test over an inline function

Backend. Wasm

  • KT-76747 [Wasm] Wasm name section absent for wasm structs
  • KT-76701 K/Wasm: custom formatters are not loaded when a project is built with incremental compilation
  • KT-66081 K/WASM: 0/0, 5/0 and 5%0throw not ArithmeticException, but RuntimeError
  • KT-76287 [Wasm] Enable stdlib and kotlin.test tests after compiler bootstrap
  • KT-75871 [Wasm] Implement new RTTI approach
  • KT-75872 Wasm / IC: IllegalStateException: IC internal error: can not find library
  • KT-73362 Migrate K/Wasm sources to new IR parameter API

Compiler

New Features

  • KT-70722 Implement better Kotlin warnings for value classes and JEP 390 (Warnings for Value-Based Classes)
  • KT-57919 Store all annotations in Kotlin metadata on JVM under a flag
  • KT-54205 Support jakarta Nullability annotations

Performance Improvements

  • KT-76422 FirJavaFacade#createFirJavaClass: do not compute super type references right away

Fixes

  • KT-75828 Store backing field/delegate annotations and extension receiver annotations in metadata
  • KT-76663 KJS: KotlinNothingValueException caused by expression return since 2.1.20
  • KT-76615 K2: "IllegalArgumentException: Inline class types should have the same representation: Lkotlin/UByte; != B" for mixed Java/Kotlin code
  • KT-76805 Wrong NPE occurs when assigning synthetic properties with platform types in Kotlin 2.1.20
  • KT-76253 K2 Compiler: Less precise diagnostic COMPONENT_FUNCTION_AMBIGUITY for flexible type
  • KT-76583 CCE: suspend lambda attempts to unbox value class parameter twice after lambda suspended
  • KT-59526 Store annotation default values in metadata on JVM
  • KT-63850 K2: setter with an annotated parameter has isNotDefault == false flag in metadata
  • KT-75712 -Wextra: false positive UNUSED_LAMBDA_EXPRESSION on functional type variable assignment with inferred type
  • KT-69624 Debugger: Missing local variable in Variables view (inline function)
  • KT-75992 Xcode 16.3: stacktraces on simulators are not symbolicated
  • KT-76199 Introduce -Xcontext-sensitive-resolution compiler flag
  • KT-75553 MISSING_DEPENDENCY_SUPERCLASS and MISSING_DEPENDENCY_SUPERCLASS_WARNING is reported at the same time on the same element
  • KT-76159 Obsolete error "'@JvmDefaultWithCompatibility' annotation is only allowed on interfaces" should be removed
  • KT-76660 False negative RETURN_NOT_ALLOWED in lambda in default argument leads to NoClassDefFoundError: $$$$$NON_LOCAL_RETURN$$$$$
  • KT-76301 Fail to infer types after syntactical change
  • KT-74999 K2: KotlinNothingValueException within Extension Function
  • KT-76675 KIAEWA exception at KaFirDataFlowProvider with non-local return from nested inline call
  • KT-75756 Backend Internal error: Exception during IR lowering when trying to access variable from providedProperties in class within kotlin custom script
  • KT-76171 "KotlinIllegalArgumentExceptionWithAttachments: Expected expression 'FirSingleExpressionBlock' to be resolved"
  • KT-76345 Enhance variable fixation
  • KT-76578 [FIR, K1/K2 Regression] lateinit is allowed on loop parameters
  • KT-76448 FirOverrideChecker: class ClsMethodImpl is not a subtype of class KtNamedDeclaration for factory VIRTUAL_MEMBER_HIDDEN
  • KT-73360 Migrate K/JVM sources to new IR parameter API
  • KT-76606 Enable 'Indy: Allow lambdas with annotations' by default
  • KT-74852 Kotlin/Native: allow caches for thread state checker and sanitizers
  • KT-76130 IR evaluator does not support array literals in annotation parameter default values
  • KT-76436 Missing K2 checker: non-local return through lambda passed to inline f/o
  • KT-74326 False negative: no variable must be initialized error though code doesn't compile
  • KT-74325 Explicit API mode does not enforce explicit return types for extension properties
  • KT-76572 FIR_NON_SUPPRESSIBLE_ERROR_NAMES does not contain deprecation errors
  • KT-75704 Refactor FirWhenSubjectExpression
  • KT-76284 Flexible captured type is not approximated in receiver position
  • KT-76192 RETURN_TYPE_MISMATCH with same expected and actual type: nullability of actual type is omitted
  • KT-75944 Allow using invokedynamic for lambdas with no 'Runtime' level retention annotations
  • KT-76396 FirIntegerConstantOperatorScope: NoSuchElementException: Collection contains no element matching the predicate
  • KT-76209 CONFLICTING_UPPER_BOUNDS on Nothing bound
  • KT-46119 NONE_APPLICABLE instead of NAMED_ARGUMENTS_NOT_ALLOWED with overloaded Java constructor call
  • KT-75503 Run lazy resolution in CallableCopyTypeCalculator and use withForcedTypeCalculator everywhere in checkers
  • KT-76485 Don't report EXTENSION_SHADOWED_BY_MEMBER if extension can be called with named arguments
  • KT-76154 False positive "EXTENSION_SHADOWED_BY_MEMBER" when extension adds default values to parameters
  • KT-76527 False positive UNSUPPORTED_CONTEXTUAL_DECLARATION_CALL with -Xcontext-receivers and implicit invoke
  • KT-63246 K2: False positive NOTHING_TO_OVERRIDE in generic property with context receiver in non generic class extending generic class
  • KT-58534 K2: "Argument type mismatch" with typealias to context receiver functional type
  • KT-71481 K2: drop pre-1.6 language features from compiler code
  • KT-74069 False positive UNUSED_EXPRESSION due to Long/Int conversion
  • KT-76381 K2: Expected expression 'FirPropertyAccessExpressionImpl' to be resolved
  • KT-75234 Add error for callsInPlace contracts on context parameters
  • KT-73805 K2: Investigate missing diagnostic in implicit invoke call on context function type with receiver from module with disabled context parameters
  • KT-41934 NI: a type variable for lambda parameter has been inferred to nullable type instead of not null one
  • KT-61258 Kotlin/Native: CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Base]
  • KT-75983 Backend Internal error: Exception during IR lowering 'IllegalStateException: Internal error: cannot convert Any to Int'
  • KT-76290 False positive UNUSED_EXPRESSION while returning Unit in the when branches
  • KT-32358 NI: Smart cast doesn't work with inline function after elvis operator
  • KT-76316 K2: Missing NON_PUBLIC_CALL_FROM_PUBLIC_INLINE on object extending private class in public inline function
  • KT-76324 Frontend diagnostic says "... this will be an error in Kotlin N.M" but N.M is already released
  • KT-76058 PCLA: compile-time failure on calling a higher-order function from another module inside a lambda assigned to a variable of a type with a postponed type variable
  • KT-75457 Native: cache machinery uses stdlib cache with default runtime options even if custom runtime options are supplied when partial linkage is disabled
  • KT-75571 K2: type mismatch error provides unsubstituted types
  • KT-31391 'Recursive call is not a tail call' with elvis operator in tailrec function
  • KT-73420 False-positive NON_TAIL_RECURSIVE_CALL on tailrec function with elvis in the return statement
  • KT-75169 Unnecessary EXTENSION_SHADOWED_BY_MEMBER on generic declarations
  • KT-76339 K2: Dangling modifier list is missed for enum entries in PSI mode
  • KT-75513 Avoid overrides traversal without preinitialization
  • KT-74587 Report an error when JvmDefaultWithoutCompatibility is used with -Xjvm-default=all
  • KT-76257 Annotations with class references are not supported when marking IR declarations as visible to metadata
  • KT-71793 Drop language versions 1.6 and 1.7
  • KT-59272 Incorrect bytecode generated: wrong line number table after condition
  • KT-69248 K2: IAE “class KtDotQualifiedExpression is not a subtype of class KtCallExpression for factory ENUM_CLASS_CONSTRUCTOR_CALL” with qualified enum constructor call
  • KT-73778 Kotlin Debugger: NSFE on accessing private property from dependencies during evaluation
  • KT-74131 Incorrect line numbers for static initializer with delegated local variable
  • KT-76320 K2: PsiRawFirBuilder: import alias triggers ast loading
  • KT-63851 K2: No setterValueParameter in metadata for property setter with an annotated parameter
  • KT-71002 Possible inheritance from nullable type through typealias
  • KT-75498 Forbid .declarations access from checkers
  • KT-75112 FE resolves wrong receivers order for property passed to delegate
  • KT-75924 K2. Incorrect generic type Inference "R? & Any" appears for "Add explicit type arguments"
  • KT-75242 Any use-site target can be applied to a lambda and an expression
  • KT-73051 incorrect direction of subtyping violation in type mismatch error's message for A<X> </: A<Y> given a Tv <: Rv == C constraint from a lambda return position
  • KT-75090 Argument type mismatch: actual type is 'SuspendFunction0', but 'SuspendFunction0' was expected when anonymous function is passed to function expecting suspend function type
  • KT-74956 K2: No USAGE_IS_NOT_INLINABLE with compiling an inlined function call
  • KT-75729 KtPsiFactory: no type-safe way to create triple-quoted KtStringTemplateExpression

Compose compiler

New features

  • 5f7e5d1 Enabled PausableComposition feature flag by default
  • e49ba7a Enabled OptimizeNonSkippingGroups feature flag by default
  • b/305035807 Add support for @Composable function references with K2

Fixes

  • b/409238521 Fix crash when searching for ComposableLambda::invoke function on JS
  • b/408752831 Fix early return with value from key groups
  • b/388505454 Treat context parameters the same way as extension receiver
  • b/408013789 Add missing return for the default function wrappers
  • b/405541364 Realize coalescable children in the body of key call

IR. Actualizer

  • KT-70907 Actualize fake override symbols in Ir Actualizer

IR. Inlining

Fixes

  • KT-70916 IR: Report errors on exposure of private types in non-private inline functions
  • KT-73155 Move Mapping from LoweringContext back to CommonBackendContext
  • KT-76186 [IR] Sanitize deserialized IR dump of anonymous classes
  • KT-76145 Enhance error message about poisoned KLIBs in KLIB-based compilers
  • KT-75788 IR inliner: Serialize preprocessed inline functions in a separate place inside KLIBs
  • KT-71416 Perform IR-level visibility diagnostics for inline functions after the first phase of inlining
  • KT-76224 [IR][Inliner] Dumb file is unsuported in IrSymbolBase.getDescriptor()
  • KT-75793 IR inliner: Stop injecting the deserialized function body to LazyIR inline function
  • KT-75791 IR inliner: NonLinkingIrInlineFunctionDeserializer should load inline functions from a separate location in a KLIB
  • KT-73708 Use some marker in KLIBs produced with IR inliner
  • KT-76024 [JS][IR Inliner] Partial linkage: No function found for symbol in kotlin package
  • KT-75733 Reorganize execution of the common prefix at 1st phase of compilation
  • KT-75951 [IR Inliner] Illegal non-local return reported by the partial linkage engine
  • KT-75932 Fix a problem with already bound symbol with public IR inline enabled

IR. Tree

  • KT-73189 Migrate compiler sources to new IR parameter API
  • KT-76600 Use a language feature to check error on cross-file IrGetField operations generated by compiler plugins
  • KT-75628 IR validator: Forbid IrExpressionBody for IrFunction

JavaScript

  • KT-76233 [JS] Extra invalid import line in testJsQualifier()
  • KT-31493 [Kotlin/JS] Can't put typealias in file marked with JsModule annotation
  • KT-64951 Kotlin-Multiplatform does not allow JSExport of expect
  • KT-77021 CompilationException: Encountered a local class not previously collected on inner classes inside anonymous objects
  • KT-76235 [JS] Extra invalid line tmp_0.tmp00__1 = Options; in testSuspendFunction()
  • KT-76234 [JS] Extra invalid line Parent in testNested()
  • KT-73226 Migrate K/JS to new IR parameter API
  • KT-75254 KJS: Merge AbstractSuspendFunctionsLowering from Common and JS backends
  • KT-75772 KJS: NullPointerException caused by reference of private class with @JsExport
  • KT-74384 Support new callable reference nodes in JS backend

Klibs

  • KT-76061 Add option for suppress warning of missing no-existent transitive klib dependencies
  • KT-72296 Use specialized signatures for serialized local fake overrides
  • KT-76158 Drop "description" from local signatures
  • KT-75749 KLIB: Fail with error on attempt to serialize/deserialize SpecialFakeOverrideSignature
  • KT-75941 [IR Inliner] Abstract function is not implemented in non-abstract anonymous object

Language Design

  • KT-57274 Allow generic argument to have explicit Nothing upper bound

Libraries

New Features

  • KT-70456 Base64: Support lineLength parameter for Mime
  • KT-76394 kotlin.time.TimeSource.asClock missing
  • KT-31857 Provide easy way to retrieve annotations for kotlinx-metadata
  • KT-76528 Instant.parseOrNull
  • KT-76163 K/N: Hide or remove CreateNSStringFromKString/CreateKStringFromNSString

Performance Improvements

  • KT-75647 Optimized sequenceOf(T) overload is missing

Fixes

  • KT-72138 Stabilize experimental API for 2.2
  • KT-76831 Atomic types: inconsistent behavior on JS and Wasm targets
  • KT-75290 kotlin-metadata: deprecate hasAnnotations flag, add JVM-only hasAnnotationsInBytecode instead
  • KT-76193 Common Atomics: 'AtomicArray.compareAndSetAt' and 'compareAndExchangeAt' docs incorrectly suggest they use == when actually they use ===
  • KT-54077 Consider using SecureDirectoryStream in deleteRecursively even when Path.parent is null
  • KT-72866 Standard library functions to work with context parameters
  • KT-76743 Add kotlin-scripting-jvm to projectsUsedInIntelliJKotlinPlugin list
  • KT-72483 Clean up redundant stdlib code for Kotlin 2.2
  • KT-76385 Remove suppression from functions to work with context parameters
  • KT-75337 Remove suppress annotations from @IgnorableReturnValue
  • KT-72137 Review deprecations in stdlib for 2.2
  • KT-75491 Non intuitive work of 'in' (contains) with String range

Native

  • KT-76552 LLVM Update: rebase the LLVM branch
  • KT-76662 LLVM 19 update: documentation
  • KT-56107 Support Enum.entries for C/ObjC interop enums
  • KT-76560 LLVM Update: investigate changes in filterStdargH test
  • KT-76283 LLVM Update: pass all tests
  • KT-75829 LLVM Update: port K/N on LLVM 19
  • KT-76280 LLVM Update: benchmarksAnalyzer build failed

Native. C and ObjC Import

  • KT-76551 LLVM Update: investigate CXFile equality problem further

Tools. BCV

  • KT-75686 Improve DSL for BCV in KGP
  • KT-75999 ABI validation filter doesn't apply excluded kotlin files
  • KT-75981 ABI validation filter not applying excluded classes without package names
  • KT-76129 Abi validation filtering functionality for included classes doesn't work

Tools. Build Tools API

  • KT-76455 BTA: Compilation is always non-incremental if BTA API >= 2.2.0 is used together with BTA impl < 2.2.0

Tools. CLI

  • KT-76095 Add JVM target bytecode version 24
  • KT-75588 [2.1.20-RC] "was compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler" warnings despite using the same compiler version
  • KT-75300 Lenient compiler mode which generates stubs for missing actuals
  • KT-75967 Implement generation of CLI arguments in compiler using new single representation
  • KT-75966 Declare all existing CLI arguments using the new DSL
  • KT-76498 Implement JSON dumper for performance stats
  • KT-75970 Extract all non-trivial logic from CommonCompilerArguments and its inheritors

Tools. CLI. Native

  • KT-69485 Native: remove adding $llvmDir\bin to PATH on Windows

Tools. Compiler Plugins

  • KT-70982 Deprecate declaration of atomic properties marked with @PublishedApi with error
  • KT-76429 Migrate kotlin-dataframe plugin to new IR parameter API
  • KT-76162 "IllegalStateException: No mapping for symbol: VALUE_PARAMETER INSTANCE_RECEIVER" after updating to 2.1.20
  • KT-75263 PowerAssert: no additional info is displayed for 'when' with subject

Tools. Gradle

New Features

  • KT-75823 Resources bundle with XCFrameworks for iOS

Fixes

  • KT-68325 Add to Compiler Types DSL exceptions message possible ways of a solution
  • KT-74007 Not all the DSL features related to kotlinOptions are deprecated
  • KT-54110 Change deprecation level to ERROR for kotlinOptions DSL
  • KT-74887 Compatibility with Gradle 8.13 release
  • KT-76951 'distribution-base' plugin is only applied in Gradle 8.13
  • KT-77011 Update build regression benchmarks for 2.2.0 release
  • KT-73968 KotlinDependencyManagement tries to mutate configuration after it was resolved
  • KT-73682 Compatibility with Gradle 8.12 release
  • KT-74890 Run Gradle integrations test against Gradle 8.13 release
  • KT-74889 Compile against Gradle 8.13 API
  • KT-76282 Add missing Android Gradle plugin versions in tests
  • KT-68597 Update KGP deprecations before 2.2
  • KT-76052 Support Gradle 8.13 for Problems API
  • KT-73684 Run integration tests against Gradle 8.12
  • KT-76377 Add integration tests for Problems API
  • KT-76374 Investigate and fix failing tests with configuration cache in KotlinDaemonIT: testDaemonMultiproject and testMultipleCompilations
  • KT-76379 Gradle: KotlinGradleFinishBuildHandler does not perform cleanup on configuration cache reuse
  • KT-61911 Gradle: make KGP to depend on fixated version of stdlib
  • KT-62963 Remove "kotlin.incremental.useClasspathSnapshot" property

Tools. Gradle. JS

  • KT-74735 KGP uses Gradle internal CompositeProjectComponentArtifactMetadata
  • KT-71879 Notice of upcoming deprecation for Boolean 'is-' properties in Gradle Groovy scripts

Tools. Gradle. Multiplatform

  • KT-66423 Configuration cache false recalculation because of Kotlin Native downloading during the execution phase
  • KT-74888 Use 'distribution-base' plugin in KMP/JVM
  • KT-76659 Write proper diagnostics for Uklib checks
  • KT-75808 KGP: MPP with jvm target and Gradle java-test-fixtures is broken
  • KT-71698 Remove preset APIs

Tools. Gradle. Native

  • KT-74953 Deprecate kotlinArtifacts with a warning

Tools. Incremental Compile

  • KT-75883 Follow-up: switch from INSTANCE heuristic to outerClass chain
  • KT-76041 Make lenient mode work with IC

Tools. JPS

  • KT-76495 JPS: delegated Maven builds use embeddable version of kotlin-serialization compiler plugin with non-embeddable Kotlin compiler
  • KT-60914 IC misses dependency to recompile when named kt file with JvmField instructed property was replaced with an object with the same name
  • KT-75917 Unused imports may lead to inc compilation failure
  • KT-63707 JPS: "Multiple values are not allowed for" caused by Compose

Tools. Kapt

  • KT-75936 K2 KAPT: unsupported FIR element kinds in constant evaluation
  • KT-76546 Kapt / CLI: ""compile" mode is not supported in Kotlin 2.x" with -version flag
  • KT-75942 K2 KAPT: underscore not allowed here
  • KT-40485 -Xjvm-default=all causes private interface methods to be generated in JVM target < 9 which is not supported in annotation processing

Tools. Maven

  • KT-77036 Kotlin Maven plugin: ClassNotFoundException com.google.common.base.Joiner with compiler plugins in debug mode

Tools. REPL

  • KT-76507 [K2 Repl] Delegated properties are not visible in the next snippet
  • KT-76508 [K2 Repl] Annotations on property accessors are not resolved
  • KT-75672 [K2 Repl] Serialization plugin crashes compiler backend
  • KT-75632 Contunue deprecation of the REPL built into kotlinc
  • KT-76009 [K2 Repl] Kotlin-specific imports does not work if dependency is added to the classpath after 1st snippet
  • KT-75580 [K2 Repl] Cannot access snippet properties using Kotlin reflection

Tools. Scripts

  • KT-76424 Dependencies in main.kts not working with 2.1.20
  • KT-76430 Migrate scripting plugin to new IR parameter API

Tools. Wasm

  • KT-76657 K/Wasm: Composite build does not work with wasm tasks
  • KT-76656 K/Wasm: Change NPM project name of wasm projects
  • KT-76587 Wasm lock check failure says to run the JS lock upgrade
  • KT-76161 Wasm: "export startUnitTests was not found" after updating to Kotlin 2.1.20
  • KT-76330 K/Wasm: update binaryen to 123 or newer

Don't miss a new kotlin release

NewReleases is sending notifications on new releases.