Skip to content

Releases: JetBrains/kotlin

Kotlin 2.3.10

05 Feb 11:48

Choose a tag to compare

Changelog

Compiler

  • KT-83984 Data races around kotlinx.serialization plugin protobuf extensions registration
  • KT-83317 ClassCastException: with cast kotlin.UInt to java.lang.Number when defining constant
  • KT-83031 K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused code
  • KT-81700 flaky overload resolution behaviors (false-positive errors, different final candidates, compile-time failures)
  • KT-83983 Revert of KT-83081
  • KT-83314 JSpecify @NullMarked changes Java equals(Object) to equals(Any?) causing override conflict in Kotlin 2.3
  • KT-82863 @NoInfer regression since 2.2.20
  • KT-82841 "kotlin.NoWhenBranchMatchedException" in when with !is check & non-sealed class in the middle of hierarchy

JVM. Reflection

  • KT-83608 Kotlin-reflect: "Unknown origin of public abstract operator fun invoke(p1: P1, p2: P2): R"
  • KT-83361 "KotlinReflectionInternalError: Type parameter not found: 0" on super types with Kotlin 2.3.0
  • KT-42199 "KotlinReflectionInternalError: Unknown origin of public abstract operator fun invoke" on function reference to FunctionN.invoke
  • KT-81024 Reflection: New KType implementation fails on arguments comparison for a Nothing type parameter

Tools. Compiler Plugins

  • KT-83266 "Unsupported class file major version 69" for "produceReleaseComposeMapping" task with Kotlin 2.3
  • KT-83099 Compose compiler does not generate stack trace mappings for project files

Tools. Gradle

  • KT-83070 The KGP api reference is missing a description
  • KT-82459 Improve iOS simulator boot implementation

Tools. Gradle. JS

  • KT-82946 Js, Wasm: Upgrade NPM dependencies

Tools. Gradle. Multiplatform

  • KT-83687 Revert deprecation of 'androidTarget' for AGP lower than 9

Kotlin 2.3.10-RC2

02 Feb 11:07

Choose a tag to compare

Kotlin 2.3.10-RC2 Pre-release
Pre-release

ChangeLog

Compiler

  • KT-83984 Data races around kotlinx.serialization plugin protobuf extensions registration
  • KT-83983 Revert of KT-83081

Kotlin 2.3.20-Beta2

29 Jan 11:23

Choose a tag to compare

Kotlin 2.3.20-Beta2 Pre-release
Pre-release

Changelog

Analysis API. FIR

  • KT-83467 Package-level JSpecify annotations are ignored when coming from jars or libraries
  • KT-82846 AA: unresolved KtExpression.expressionType for the reference to the parameter with default value

Analysis API. Infrastructure

  • KT-83173 Analysis API Tests: Library names with RC versions aren't sanitised

Analysis API. Surface

Performance Improvements

  • KT-83694 Provide psi-based implementation of KaDeclarationSymbol#isExternal
  • KT-70868 KaSymbol: support PSI-only visibility and modality for the case without compiler plugins

Fixes

  • KT-83152 [Analysis API, KDoc] Make class name links on constructors point to the class
  • KT-83695 Deprecate KaSymbolInformationProvider#{getter, setter}DeprecationStatus
  • KT-82853 Add a convenience property for testing declarations for effective external-ness
  • KT-83226 Support "Collection literals" in the Analysis API
  • KT-83225 Support "@IntroduceAt" in the Analysis API
  • KT-83222 Support "Improve use-site defaulting for annotations" in the Analysis API
  • KT-83351 Rename KaSession context parameter from 's' in bridges to something nicer
  • KT-83199 Clarify API around extension points
  • KT-83074 Inner enum entry class has incorrect default visibility
  • KT-82442 Add Ka prefix to org.jetbrains.kotlin.analysis.api.symbols.AdditionalKDocResolutionProvider
  • KT-82443 Add Ka prefix to org.jetbrains.kotlin.analysis.api.symbols.DebugSymbolRenderer
  • KT-82441 Add Ka prefix to org.jetbrains.kotlin.analysis.api.compile.CodeFragmentCapturedValue
  • KT-82439 Add Ka prefix to org.jetbrains.kotlin.analysis.api.components.DebuggerExtension
  • KT-82438 Add Ka prefix to org.jetbrains.kotlin.analysis.api.components.DefaultTypeClassIds

Backend. Wasm

  • KT-67461 Use new lowering phase creation API in Wasm backend
  • KT-83664 Wasm: Colon and space are not sanitized in output file names
  • KT-82309 K/Wasm: refactor _initialize function
  • KT-65779 JsExport declaration name clash
  • KT-83025 Wasm: Compose application is not loading

Compiler

New Features

  • KT-55548 JSR-305: Overload resolution ambiguity: Platform Types vs Kotlin Types
  • KT-74860 Support Unit coercion (incl. fun refs) in unused return value checker
  • KT-83401 Collection literals: support different types of expected types for CL
  • KT-80492 Checkers for operator of
  • KT-82638 Collection literals: resolve to factory functions for standard library classes
  • KT-82655 Bridges generated for non-fake overrides shall include annotations from target methods
  • KT-75736 Enable reading/writing annotations in metadata on JVM by default

Performance Improvements

  • KT-83036 Native: too many casts emitted with -Xgeneric-safe-casts=true
  • KT-73687 Inefficient KtCommonFile#getFileAnnotationList

Fixes

  • KT-83031 K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused code
  • KT-78443 Refactor session component initialization for multi-target compilation
  • KT-82579 Update specificity rule for context parameters
  • KT-83427 Arguments of plugin-generated annotations are serialized incorrectly
  • KT-83395 Kotlin/Native 2.3.0 iOS release framework fails with Invalid LLVM module (PHI node type mismatch)
  • KT-83538 OPERATOR_RENAMED_ON_IMPORT is not reported for 'provideDelegate' operator
  • KT-83537 OPERATOR_RENAMED_ON_IMPORT is not reported for 'of' operator
  • KT-81567 Add a use-site warning if a @DslMarker-marked annotation is used on entities where it is a no-op
  • KT-83657 [K/N] Pre-codegen inline produces invalid bitcode
  • KT-82721 Inconsistent explicit backing fields behavior
  • KT-83317 ClassCastException: with cast kotlin.UInt to java.lang.Number when defining constant
  • KT-83314 JSpecify @NullMarked changes Java equals(Object) to equals(Any?) causing override conflict in Kotlin 2.3
  • KT-83589 Explicit backing fields don't likely work with intersection overrides
  • KT-83588 Explicit backing field is falsely accessible from a subclass via a substitution override
  • KT-78783 K2: absence of warning for KTLC-284 migration
  • KT-83363 VerifyError: "Bad type on operand stack" on multi-line suspending call with default parameter value since API version 2.4
  • KT-83570 K2: Resolve problematic IR when referencing Kotlin const from annotation in Java
  • KT-83362 Starting from 2.3 DefaultImpls bridge functions deprecated with the level HIDDEN are no longer synthetic
  • KT-9182 Java interoperability: Overload resolution ambiguity on Java's @NotNull and primitives
  • KT-83633 Forbid inline functional context parameters in inline functions
  • KT-83449 compile-time IR failure on smart cast information leaking from capturing closure
  • KT-82375 Add ATOMIC_REF_WITHOUT_CONSISTENT_IDENTITY warning for any argument without consistent identity
  • KT-83282 JvmExposeBoxed: Duplicate annotation interface kotlin.coroutines.jvm.internal.DebugMetadata in class %class%$1 for suspend inline class value
  • KT-83367 VolatileFieldsLowering may emit wrong parameter types for atomic intrinsic calls
  • KT-83382 K2: Unreachable method exit breaks MUST_BE_INITIALIZED checks for succeeding value declarations
  • KT-82211 False positive SENSELESS_NULL_IN_WHEN with nullable var
  • KT-83157 ExplicitBackingFields: "Property with explicit backing field should be final" in 2.3.0
  • KT-83269 K2: Wrong types in IR for explicit backing fields
  • KT-83324 Native: problem with loops handling in types computation pass
  • KT-83241 K2: "NoSuchElementException: List is empty" with top-level destructuring declaration and lambda initializer
  • KT-82277 Misleading Inapplicable candidate(s): fun <K> WHEN_CALL(vararg branches: K): K when a when expression branch contains an unresolved reference
  • KT-80839 Get rid of an obsolete -Xcompile-builtins-as-part-of-stdlib flag once previous changes are bootstrapped
  • KT-82900 Language Feature EnhancedBridgesGeneration
  • KT-82651 Do not generate self-recursive bridges in JVM backend
  • KT-83185 Kotlin repeatable annotations are incorrectly deserialized from bytecode
  • KT-82863 @NoInfer regression since 2.2.20
  • KT-82311 Header mode: Error expression when assigning function declaration to a property
  • KT-81763 Incorrect comparison result when using elvis ?: with nullable Long values
  • [KT-83153](https://yo...
Read more

Kotlin 2.3.10-RC

19 Jan 11:06

Choose a tag to compare

Kotlin 2.3.10-RC Pre-release
Pre-release

Changelog

Compiler

  • KT-83314 JSpecify @NullMarked changes Java equals(Object) to equals(Any?) causing override conflict in Kotlin 2.3
  • KT-83317 ClassCastException: with cast kotlin.UInt to java.lang.Number when defining constant
  • KT-83031 K2: unstable resolution of EnhancedNullability from type-use NotNull in presence of unused code
  • KT-82863 @NoInfer regression since 2.2.20
  • KT-82841 "kotlin.NoWhenBranchMatchedException" in when with !is check & non-sealed class in the middle of hierarchy

Compose compiler

  • b/195200551 Fix classId for detecting protobuf enums
  • b/463961757 Simplify Compose group analysis
  • b/463961757 Fix analysis of boolean captures in composable lambda
  • b/461766771 Fix IrSimpleFunction.isLegacyOpenFunctionWithDefault

JVM. Reflection

  • KT-83608 Kotlin-reflect: "Unknown origin of public abstract operator fun invoke(p1: P1, p2: P2): R"
  • KT-42199 "KotlinReflectionInternalError: Unknown origin of public abstract operator fun invoke" on function reference to FunctionN.invoke
  • KT-81024 Reflection: New KType implementation fails on arguments comparison for a Nothing type parameter
  • KT-83361 "KotlinReflectionInternalError: Type parameter not found: 0" on super types with Kotlin 2.3.0

Tools. Compiler Plugins

  • KT-83266 "Unsupported class file major version 69" for "produceReleaseComposeMapping" task with Kotlin 2.3
  • KT-83099 Compose compiler does not generate stack trace mappings for project files

Tools. Gradle

  • KT-83070 The KGP api reference is missing a description
  • KT-82459 Improve iOS simulator boot implementation

Tools. Gradle. JS

  • KT-82946 Js, Wasm: Upgrade NPM dependencies

Tools. Gradle. Multiplatform

  • KT-83687 Revert deprecation of 'androidTarget' for AGP lower than 9

Kotlin 2.3.20-Beta1

08 Jan 11:05

Choose a tag to compare

Kotlin 2.3.20-Beta1 Pre-release
Pre-release

Changelog

Analysis API. FIR

New Features

  • KT-78090 Implement stubs support for new conditional returns and holdsIn contracts

Fixes

  • KT-80485 False positive UNRESOLVED_REFERENCE on nested interface from super-super class in the super type position inside an anonymous object
  • KT-82948 'FirRegularClass' expected as a containing declaration, got 'FirTypeAliasImpl'
  • KT-82057 K2. Cannot infer type parameter 'R' in Ktor routing post() function with explicit response type
  • KT-82772 Flaky false positive deprecation warning on PersistentMap.put in Kotlin repo in IDE mode
  • KT-76487 StdLibSourcesLazyDeclarationResolveTestGenerated.testWrappedInt is unstable
  • KT-82618 Various tests are failing with NPE in kt-master after updating the compiler on 19.11.25
  • KT-82076 Error querying members of JavaClass created for SymbolLightClassForAnnotationClass during library analysis
  • KT-71596 Include Js/Wasi checkers in AbstractLLFirDiagnosticsCollector
  • KT-82085 No OUTER_CLASS_ARGUMENTS_REQUIRED on type parameter bound in IDE
  • KT-81873 Provide a way of including traces in phase JFR events
  • KT-71929 Consider leaving the non-post-compute version at EnhancementSymbolsCache.enhancedFunctions

Analysis API. Infrastructure

  • KT-65140 LL FIR: Implement AbstractFirPsiJsDiagnosticTest for LL FIR
  • KT-82212 [Analysis API, LL FIR] Implement AbstractDiagnosticsFirWasmTest and AbstractDiagnosticsFirWasmWasiTest for LL FIR

Analysis API. Light Classes

  • KT-82227 Value classes should expose regular static methods

Analysis API. PSI

  • KT-81710 'KtTypeReference.getTypeText' does not account for 'suspend' modifier on suspend lambdas
  • KT-82258 Prepare PSI for migration from context receivers to context parameters
  • KT-81074 KDoc: List rendering is broken

Analysis API. Providers and Caches

  • KT-82449 K2 IDE Analysis Freezes During Gradle Sync (Recursive Module Dependency Computation in KotlinModuleDependentsProviderBase.computeTransitiveDependents)
  • KT-82629 'collectDiagnostics' returns stale syntax error after editor fix
  • KT-74907 Analysis API: Apply platform-based library module content restrictions consistently

Analysis API. Standalone

  • KT-81107 AA: KtSourceModuleBuilder.sourceRoots doesn't works with symbolic links

Analysis API. Stubs and Decompilation

  • KT-82792 Stub for KtValueArgumentList inside KtAnnotationEntry should be present if it is present in psi
  • KT-82527 TypeClsStubBuilder.createFunctionTypeStub throws NullPointerException
  • KT-82558 Deserialized DNN type should have a fully qualified Any
  • KT-81928 KaArrayAnnotationValueImpl.values missing first element
  • KT-82139 Support contracts for property accessors
  • KT-82198 Support context parameters in contracts

Analysis API. Surface

New Features

  • KT-82851 Property accessors should inherit KDoc from the parent property
  • KT-63339 Analysis API: Provide a way to extract KDoc for symbols
  • KT-79070 KaTypeProvider: add API to build a default type with star projections
  • KT-66566 AA: api to create functional types
  • KT-66043 KtTypeCreator doesn't provide a way for creating annotated types

Performance Improvements

  • KT-81627 KaFirSymbolDeclarationOverridesProvider#processOverrides should process only relevant declarations

Fixes

  • KT-68577 asPsiType and mapTypeToJvmType: leading delimiter for class in a root package
  • KT-81734 MIssing "ARGUMENT_TYPE_MISMATCH" caused by self-referential generic type
  • KT-82856 Redesign KotlinReferenceProviderContributor to make it extensible
  • KT-82615 Clarify KtReference#resolvesByNames contract
  • KT-82534 No expected type for property accessor without body
  • KT-82406 Add a test to ensure that all top-level classes in the Analysis API Surface have Ka prefix
  • KT-78397 investigate if there is a need in Extra support for the "various little features in contracts"
  • KT-74009 Analysis API: Expose "isOverloadable" check for callable symbols similar to "OverloadChecker.isOverloadable"
  • KT-78399 Check return value - check how we see from Java(+Stub) we see β€œannotated” signatures
  • KT-80357 [Analysis API] KaType.enhancedType doesn't enhance type parameters
  • KT-73659 Analysis API: The name of KaType.enhancedType is too general
  • KT-80545 [Analysis API] Deprecate KaFunctionType.arity
  • KT-77708 K2 Mode: Potentially redundant smart cast highlighing when passing smartcasted expressions as arguments
  • KT-81264 K2 AA: KaValueParameterSymbol.hasDefaultValue is false for overriding or actual functions
  • KT-81166 Forbid the usage of KaSessionComponent implementation types directly
  • KT-74801 Analysis API: Publish/subscribe to modification events with a single message bus topic

Backend. Native. Debug

  • KT-81741 Native: stepping into data class hashCode in lldb goes to line 1

Backend. Wasm

New Features

  • KT-81485 [Wasm] DebuggerCustomFormatters generation support for single module mode
  • KT-81483 [Wasm] Typescript generation support for single module mode
  • KT-81484 [Wasm] Dwarf generation support for single module mode

Performance Improvements

  • KT-81524 Unnecessary Any-JsAny conversions are generated for external instanceofs

Fixes

  • KT-79937 K/Wasm: support kotlin.js.nativeInvoke annotation
  • KT-82202 [Wasm] SourceMap generation support for single module mode
  • KT-82162 [Wasm] Run single module tests with standalone vm's
  • KT-81325 [Wasm] Remove string pool initialiser dependent code
  • KT-82645 K/Wasm: wasmJs use js "String" for number2String conversion
  • KT-73238 K/Wasm: stop using linear memory inside our code
  • KT-83025 Wasm: Compose application is not loading
  • KT-73240 K/Wasm: consider using JS String Builtins proposal in String implementation for wasm-js target
  • KT-73239 K/Wasm: use JS String Builtins proposal to transfer strings to and from JS
  • KT-83046 K/Wasm: don't use StringBuilder implicitly for string concatenations
  • KT-82309 K/Wasm: refactor _initialize function
  • KT-83194 K/Wasm: create WasmIR test infrastructure
  • KT-65234 K/Wasm Ensure that fp operations are aligned with other b-ends
  • KT-81856 K/JS/Wasm interop: external instanceofs do not link in singleModule mode
  • KT-81610 [Wasm] Add CLI test for performance metrics for klibs->binary scenario
  • [KT-81550](https://youtrack.jetbrains.com/iss...
Read more

Kotlin 2.3.0

16 Dec 13:29

Choose a tag to compare

Changelog

Analysis API

  • KT-80082 K2. False positive "Cannot resolve method" for self-bounded generic with wildcard return type in Java interop
  • KT-80303 Move :native:analysis-api-klib-reader to :libraries:tools

Analysis API. Code Compilation

  • KT-70860 K2 IDE / Kotlin Debugger: CCE β€œjava.lang.String cannot be cast to java.lang.Void” on evaluating not-null variable on the line with assigning null to that var
  • KT-78554 K2 IDE / Kotlin Debugger: ISE β€œNo override for FUN IR_EXTERNAL_DECLARATION_STUB” on calling toString() for local class instance during evaluation
  • KT-73201 K2 IDE: Error while evaluating expressions with local classes

Analysis API. FIR

  • KT-81378 Expected expression 'FirFunctionCallImpl' to be resolved caused by suspend {}
  • KT-80473 Add events for tracking LL activities
  • KT-46375 Analysis API: Support cross-file class redeclaration checks using indices
  • KT-80471 Analysis API: Deduplicate equivalent call candidates in resolveToCallCandidates
  • KT-79653 [Analysis API] ContextCollector: BODY context of enum classes doesn't contain enum entries
  • KT-75858 K2 AA: False positive 'property must be initialized' on incremental analysis with 'field' usage and semicolon in setter
  • KT-80231 AnnotationArgumentsStateKeepers doesn't restore the initial annotation in some cases
  • KT-80233 Pull mutation out of AnnotationArgumentsStateKeepers
  • KT-71466 LLFirBuiltinsSessionFactory uses createCompositeSymbolProvider
  • KT-76432 JavaClassUseSiteMemberScope: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl

Analysis API. Infrastructure

  • KT-80717 Support IntelliJ Bazel build in the Kotlin Coop development mode

Analysis API. Light Classes

  • KT-80656 Duplicate no-args constructor in PSI
  • KT-60490 Symbol Light Classes: Property accessors from a delegated interface don't present in the delegating class
  • KT-79689 SymbolLightClassForClassLike.toString() causes PSI tree loading
  • KT-80690 Private interface functions are not present in light classes
  • KT-80256 K2: Certain actions in JPA code causes infinite PIEAE: "Element class CompositeElement of type REFERENCE_EXPRESSION (class KtNameReferenceExpressionElementType)"
  • KT-79012 Add a high-level overview of light classes

Analysis API. Providers and Caches

Fixes

  • KT-81476 Analysis API: AlreadyDisposedException from low-memory cache cleanup
  • KT-80911 Analysis API: Execute session invalidation in a non-cancelable section
  • KT-81242 Analysis API: Add UUID/lifetime properties to LL FIR session structure logging
  • KT-80622 Analysis API: Visualise LL FIR session structure & weight
  • KT-80904 Analysis API: "Invalid dangling file module" exception during session invalidation
  • KT-78882 K2 AA: Calling containingSymbol on getProgressionLastElement causes exception
  • KT-58325 Analysis API: Combine LLKotlinStubBasedLibrarySymbolProviders in session dependencies (optimization)
  • KT-77825 Analysis API: CheckersComponent consumes a lot of memory while being unused in LL FIR sessions
  • KT-76526 Incorrect built-in module is provided for non-JVM sources in Standalone
  • KT-62549 Analysis API: Cache callables in combined Kotlin symbol providers
  • KT-70721 LL FIR: investigate possibility of moving LLFirFirClassByPsiClassProvider . getClassByPsiClass (PsiClass) to symbol providers
  • KT-72998 Analysis API: Introduce getClassLikeSymbolByPsi to LL FIR symbol providers

Analysis API. Standalone

  • KT-81108 AA: java.lang.ClassCastException: class org.jetbrains.kotlin.fir.FirBinaryDependenciesModuleData cannot be cast to class org.jetbrains.kotlin.analysis.low.level.api.fir.projectStructure.LLFirModuleData
  • KT-80573 Potential performance issue on class ID computation
  • KT-80559 Try to optimize KotlinStandaloneDeclarationProviderFactory startup for tests
  • KT-71706 Analysis API Standalone: StandaloneProjectFactory.createSearchScopeByLibraryRoots creates inefficient file-based search scopes

Analysis API. Stubs and Decompilation

Performance Improvements

  • KT-77097 Support ReplaceWith deprecation annotation argument via stubs

Fixes

  • KT-80350 Drop K1 decompiler
  • KT-77082 StackOverflowError in CreateFreshTypeVariableSubstitutorStage.shouldBeFlexible
  • KT-80798 Improve stubs tests coverage
  • KT-75318 Read context parameter fields from metadata in CallableClsStubBuilder
  • KT-77874 AA disagrees with the compiler on descriptions of context parameters from binaries in messages for context argument ambiguity errors
  • KT-80276 Implement native coping for stubs
  • KT-79780 Decompiled MultifileClass has Facade kind
  • KT-79398 isClsStubCompiledToJvmDefaultImplementation flag is inconsistent for compiled and decompiled stubs
  • KT-79798 Prettify stub usages in LL stub-based deserializer
  • KT-78949 AbstractLLStubBasedResolutionTest: tests against real stub-based files
  • KT-80251 Inconsistent decompiled and compiled stub for properties with an initializer and a delegate
  • KT-74547 Implement decompiler for K2
  • KT-79555 Move KotlinFileStubImpl serialization/deserialization to the Analysis API
  • KT-79487 "null DefinitelyNotNullType for 'T'" from decompiler
  • KT-60764 Stub Builder: fix differences between K1 and K2 stub building on decompiled files
  • KT-79484 An empty enum class with a member decompiles with a synthetic error
  • KT-79730 Decompiled files have an extra Kt suffix
  • KT-79483 data modifier is not present on object modifier
  • KT-75398 Local classes from scripts have ClassId in stubs
  • KT-79412 Context parameters with type annotations cause inconsistency errors while building stubs

Analysis API. Surface

New Features

  • KT-80084 Provide endpoints for Analysis API to understand when the context sensitive resolution is used
  • KT-64340 Analysis API: no way to get a type of vararg parameter
  • KT-68387 AA: provide context for type approximations

Performance Improvements

  • KT-80713 Optimize KaDeclarationSymbol#visibility for class-like symbols
  • KT-79097 KaFirNamedFunctionSymbol#isSuspend shouldn't trigger resolution
  • KT-79095 isOverride shouldn't trigger resolution if not compiler plugins present

Fixes

  • KT-80234 Incorrect value of isActual for the implicitly actual constructor of annotation class
  • KT-81132 Use KaSession instead of a particular KaSessionComponent for context parameter bridges
  • KT-81129 K2: KaSymbolInformationProvider#importableFq...
Read more

Kotlin 2.3.0-RC3

09 Dec 14:15

Choose a tag to compare

Kotlin 2.3.0-RC3 Pre-release
Pre-release

Changelog

Compiler

  • KT-82869 Green-to-Red change in 2.3 after prioritizing non-suspend-function-type overloads

Libraries

  • KT-82901 Long.MIN_VALUE.milliseconds produces invalid denormalized Duration

Kotlin 2.3.0-RC2

02 Dec 14:29

Choose a tag to compare

Kotlin 2.3.0-RC2 Pre-release
Pre-release

Changelog

Compiler

  • KT-82590 ClassCastException when instantiating class with generics implemented by fun interface and lambda

Tools. Compiler Plugin API

  • KT-82563 Improve compiler error messages to identify incompatible plugins causing compilation failures

Kotlin 2.3.0-RC

18 Nov 13:25

Choose a tag to compare

Kotlin 2.3.0-RC Pre-release
Pre-release

Changelog

Backend. Wasm

  • KT-82075 K/Wasm: kotlin.wasm.internal.getSimpleName crashes on iOS Safari older than 26

Compiler

  • KT-82138 Debugger: Cannot evaluate JvmInline value class parameter
  • KT-78413 Kotlin Debugger: value classes as context parameters have incorrect names in Variables View during debugging
  • KT-80549 Call of Java method with type parameter bounds: Expected FirResolvedTypeRef with ConeKotlinType but was FirJavaTypeRef
  • KT-82132 False-positive type mismatch with -language-version 2.2
  • KT-81988 K2: Any?.toString() causes NPE inside lambda with Java
  • KT-82022 K/N: Unexpected "Annotation @JvmInline is missing on actual declaration" warning with value classes

Compose compiler

  • CMP-9167 iOS: Platform declaration clash: The following functions have the same IR signature

IR. Actualizer

  • KT-77337 IrNoExpectSymbolsHandler finds expect class reference after enabling annotation traversal in IR

IR. Tree

  • KT-81952 "IllegalStateException: Callable reference with vararg should not appear at this stage" for callable references to functions with generic vararg parameters

JVM. Reflection

  • KT-81967 isSubtypeOf: ClassCastException: CapturedKType cannot be cast to class AbstractKType
  • KT-81619 Reflection: Function supertype of a FunctionN class has flexible type in new implementation

JavaScript

  • KT-82005 KJS: "TypeError: callAgent.jsonRpcCall_ij3z26_k$ is not a function" after code change in 2.3.0-Beta1/2
  • KT-79514 java.lang.IllegalStateException: IrClassSymbolImpl is unbound. Signature: kotlin.js/Promise|null[0] on running jsBrowserTest

Libraries

  • KT-81995 K/N: CMP: Undefined symbol _kfun:kotlin.time.Duration.kotlin.time.Duration
  • KT-72111 Change Duration.parseOrNull logic to not throw exceptions internally

Tools. Compiler Plugin API

  • KT-82099 Compiler plugin ordering has no effect

Tools. Gradle

  • KT-79482 Report webMain / webTest usage in FUS metrics
  • KT-82244 Conflicting warnings when using AGP 9.0.0-alpha with built-in Kotlin disabled
  • KT-82068 Workaround iOS Simulator start failure in IT
  • KT-81161 Gradle plugin api reference: compiler arguments types are not available

Tools. Gradle. Multiplatform

  • KT-81601 With android.builtInKotlin=false AGP 9.0+, using kotlin-multiplatform plugin will fail with aClass Cast Exception
  • KT-81980 KGP warning gives incorrect suggestion for AGP application compatibility

Tools. Gradle. Native

  • KT-81510 commonizeCInterop exception with 'kotlinNativeBundleConfiguration' not found

Tools. Maven

  • KT-82180 kotlin-maven-plugin: IC succeeds after dependent source deletion

Tools. Wasm

  • KT-82365 K/Wasm: NodeRun tasks in Wasi depend on kotlinWasmToolingSetup

Kotlin 2.3.0-Beta2

28 Oct 09:40

Choose a tag to compare

Kotlin 2.3.0-Beta2 Pre-release
Pre-release

Changelog

Analysis API

  • KT-80082 K2. False positive "Cannot resolve method" for self-bounded generic with wildcard return type in Java interop

Analysis API. Code Compilation

  • KT-70860 K2 IDE / Kotlin Debugger: CCE β€œjava.lang.String cannot be cast to java.lang.Void” on evaluating not-null variable on the line with assigning null to that var

Analysis API. FIR

  • KT-81378 Expected expression 'FirFunctionCallImpl' to be resolved caused by suspend {}
  • KT-80473 Add events for tracking LL activities

Analysis API. Providers and Caches

  • KT-81476 Analysis API: AlreadyDisposedException from low-memory cache cleanup
  • KT-80911 Analysis API: Execute session invalidation in a non-cancelable section
  • KT-81242 Analysis API: Add UUID/lifetime properties to LL FIR session structure logging
  • KT-80622 Analysis API: Visualise LL FIR session structure & weight
  • KT-80904 Analysis API: "Invalid dangling file module" exception during session invalidation
  • KT-78882 K2 AA: Calling containingSymbol on getProgressionLastElement causes exception

Analysis API. Standalone

  • KT-81108 AA: java.lang.ClassCastException: class org.jetbrains.kotlin.fir.FirBinaryDependenciesModuleData cannot be cast to class org.jetbrains.kotlin.analysis.low.level.api.fir.projectStructure.LLFirModuleData

Analysis API. Stubs and Decompilation

  • KT-77097 Support ReplaceWith deprecation annotation argument via stubs

Analysis API. Surface

New Features

  • KT-80084 Provide endpoints for Analysis API to understand when the context sensitive resolution is used

Fixes

  • KT-81132 Use KaSession instead of a particular KaSessionComponent for context parameter bridges
  • KT-81129 K2: KaSymbolInformationProvider#importableFqName: should return null for dynamic declarations
  • KT-81128 K2: KaSymbolInformationProvider#importableFqName: should return null for error destructuring declarations
  • KT-81127 K2: KaSymbolInformationProvider#importableFqName: should return null for anonymous functions
  • KT-81126 K2: KaSymbolInformationProvider#importableFqName: should return null for enum entry initializer constructors
  • KT-81125 K2: KaSymbolInformationProvider#importableFqName: should return null for property accessors
  • KT-81124 K2: KaSymbolInformationProvider#importableFqName: type alias constructor should have a reference to the type alias and not to the underlying class
  • KT-70127 Analysis API: 'KaFirReceiverParameterSymbol' does not implement 'KaFirSymbol'; leads to exception from importableFqName
  • KT-81123 Reimplement KaFirSymbolInformationProvider#importableFqName
  • KT-81122 Drop KaImportOptimizer
  • KT-79772 Migrate from 'validityAsserted' to 'withValidityAssertion'
  • KT-59857 KaExpressionTypeProvider#returnType shouldn't throw an exception for class like declarations

Backend. Wasm

  • KT-79244 [Wasm] Drop K1-specific tests, testrunners and test directives
  • KT-80397 K/Wasm: turn on by default using a new version of the exception handling proposal for wasm-wasi target
  • KT-76204 K/Wasm: support generating a wasm module per kotlin module/klib
  • KT-81372 K/Wasm: JsException: Exception was thrown while running JavaScript code on Safari 18.2/18.3
  • KT-80106 devServer in Kotlin/Wasm overwrites defaults, causing missing static paths

Compiler

New Features

  • KT-80837 Warn about extension function with a context shadowed by member
  • KT-80031 Check spotbugs's @CheckReturnValue in Kotlin's unused return value checker

Performance Improvements

  • KT-81617 Native: casts optimizations pass explodes on deep nested loops
  • KT-81340 K/N: severe compilation time degradation after turning on casts optimization pass
  • KT-52283 Never ending type inference while compiling Kotlin code with lots of self pointing generics

Fixes

  • KT-81618 "Number of arguments should not be less than number of parameters" on JVM on Kotlin 2.3.0-Beta1
  • KT-81652 Native: ClassCastException: ApplicationForegroundStateListener.Companion
  • KT-74999 K2: KotlinNothingValueException within Extension Function
  • KT-81254 "AssertionError: There should be at least one non-stub type to compute common supertype": Parser issue during generic type inference
  • KT-80250 ISE: flow for PostponedLambdaExitNode not initialized - traversing nodes in wrong order?
  • KT-81186 Only allow local type aliases in REPL/scripts until full stabilization
  • KT-80929 IC Native: Undefined symbols on ktor
  • KT-81657 K2: put warning about "exposing package-private in internal" under experimental language feature
  • KT-81241 Konanc exit while lowering org.jetbrains.kotlin.ir.util.IrUtilsKt.remapTypeParameters
  • KT-74819 K2: False-positive overload resolution ambiguity for flatMap inside PCLA
  • KT-79506 Contract for getter and setter doesn't work if a property is called from another module
  • KT-71420 Report error when reified type parameter is inferred to intersection type
  • KT-77727 Move some of the extra checkers to the default list
  • KT-81257 Native: "Unexpected boolean predicate" when generating 'static_cache'
  • KT-81525 Report REDUNDANT_SPREAD_OPERATOR on (*) instead of argument expression
  • KT-81522 Fix Light Tree SPREAD_OPERATOR diagnostic positioning
  • KT-77008 K2: Incorrectly force casting to a wrong type
  • KT-78127 K2: Too precise inference for if/when with expected type in assignment
  • KT-80208 K2: ClassCastException: "class java.util.ArrayList cannot be cast to class java.lang.Void" type inference picks Void for generic function
  • KT-79231 Inconsistent InnerClass entry flags for abstract inner enum
  • KT-20677 Improve diagnostic about implicit default constructor absence for expected annotation class
  • KT-9111 Improve diagnostic for call with access to outer class from nested class
  • KT-81385 Missing error of nullable expression in class literal in case of reified type parameter
  • KT-81141 Fix FirUnsupportedArrayLiteralChecker to forbid array literals inside non-annotation contexts
  • KT-81383 Return type of anonymous function used as run argument is incorrectly inferred to Nothing
  • KT-80577 "Return type mismatch" for self-referential types used as generic parameters
  • KT-81198 Move type and type parameter annotations from jvm_metadata.proto to metadata.proto
  • KT-81057 Wrong handling of boxing during redundant casts optimization
  • KT-76479 Backend. JVM: Report errors on exposure of types in inline functions
  • KT-81191 K2: "null cannot be cast to non-null type ConeTypeParameterLookupTag" with invalid code
  • KT-81115 Allow converting lambda wi...
Read more