Skip to content

Kotlin 2.0.0-Beta3

Pre-release
Pre-release
Compare
Choose a tag to compare
@KotlinBuild KotlinBuild released this 18 Jan 12:17
· 2 commits to 2.0.0-Beta3 since this release

Changelog

Analysis. API

Fixes

  • KT-62895 K2 IDE. FP 'when' expression must be exhaustive with sealed interface from library
  • KT-64805 Analysis API: introduce common entry point for multi-file test cases
  • KT-64714 K2: Analysis API: CollectionsKt.map doesn't resolves from Java in kotlin repo
  • KT-64647 K2: Allow to calculate decompiled inheritors for sealed classes in tests
  • KT-64595 AA: stackoverflow while simplifying a type with a recursive type parameter
  • KT-64825 Analysis API. Cannot compute containing PSI for unknown source kind 'org.jetbrains.kotlin.KtFakeSourceElementKind$DefaultAccessor' exception on getContainingSymbol call for default setter parameter
  • KT-64080 K2: Analysis API: On-air resolve does not trigger resolution of delegated super call arguments
  • KT-64243 K2: proper lazy resolution for fake overrides
  • KT-62891 K2 IDE. FP [EXPOSED_FUNCTION_RETURN_TYPE] on overriding library method which returns protected type
  • KT-61890 Analysis API: Migrate KtFirScopeProvider to ContextCollector instead of onAirResolve
  • KT-64197 K2: Code fragments are only supported in JVM
  • KT-64604 K2: IDE K2: "Modules are inconsistent during performance tests"
  • KT-62357 K2 IDE. False positive on generated component methods and false negative on getter of @JvmRecord classes in Java
  • KT-62892 K2 IDE. Java outer class from other module is not resolved when nested class is accessed with fq name in a type position
  • KT-62888 K2 IDE. IDE infers reference to KMutableProperty as reference to just KProperty
  • KT-64584 K2: StubBasedFirDeserializedSymbolProvider: support deserialization of delegated declarations
  • KT-60324 K2 IDE: "NoSuchElementException: List is empty at JavaOverrideChecker#buildErasure"
  • KT-62896 K2 IDE. FP ABSTRACT_MEMBER_NOT_IMPLEMENTED on inheriting class from library which implements interface by delegation
  • KT-62947 Analysis API: Error while resolving FirPropertyImpl
  • KT-64468 Analysis API: Implement mixed multi-module tests which support different kinds of KtModules
  • KT-63547 K2 IDE. False Positive AMBIGUOUS_ANNOTATION_ARGUMENT
  • KT-62832 K2: ClassCastException: FirDeclarationStatusImpl cannot be cast to FirResolvedDeclarationStatus
  • KT-64205 Analysis API: Do not import non-top-level callables by default
  • KT-63056 K2: Cannot mutate an immutable ImplicitReceiverValue on FirCodeFragment analysis
  • KT-64108 K2: KtFirSymbolDeclarationOverridesProvider shouldn't provide fake overrides
  • KT-63752 K2: java.lang.StackOverflowError FirFieldSymbol.getHasInitializer
  • KT-63718 Analysis API: Stub-based dependency symbol providers of library source sessions compute the wrong package name sets
  • KT-64186 Analysis API: ContextCollector provides incorrect scopes for anonymous objects
  • KT-63979 K2 IDE: presentation of types in completion is too verbose
  • KT-63681 K2: LL FIR: Improve isResolved check coverage of after lazy resolution

Analysis. Light Classes

  • KT-63087 K2 IDE: in .java source reference to JvmName names on unsigned type / value class are unresolved
  • KT-64605 K2 IDE: usage of @Repeatable annotation in Java: false positive "Duplicate annotation"
  • KT-64795 SLC: distinguish last v.s. non-last vararg value parameter type during binary resolution
  • KT-61605 K2 IDE: Light elements do not obey platform contracts
  • KT-57536 SLC: no need to populate members with expect modifier
  • KT-63949 K2 IDE. Analyze hang on @Autowired constructor analysis
  • KT-64320 Decouple kotlin psi from java PSI
  • KT-64282 Decouple KotlinIconProviderService from java PSI

Apple Ecosystem

  • KT-63821 Copy framework to BUILT_PRODUCTS_DIR in the embedAndSign task

Backend. Wasm

  • KT-58852 WASM: two methods with different varargs: Class korlibs.template.dynamic.DynamicShape has 2 methods with the same signature [register(kotlin.Array)

Compiler

New Features

  • KT-4113 Smart casts for properties to not-null functional types at invoke calls

Fixes

  • KT-64261 K2 / WASM: Extension function with star projection throws "RuntimeError: unreachable"
  • KT-64877 K2: PCLA doesn't allow infer types from value parameter having TV type
  • KT-63932 K2/Native codegen test failures around builder inference
  • KT-64222 K2: "return type is not a subtype of the return type of the overridden member"
  • KT-57094 K1: wrong type inferred for an instance of a local class inside a generic property
  • KT-62069 K2: ASSIGNMENT_TYPE_MISMATCH is reported in addition to NO_ELSE_IN_WHEN
  • KT-62776 FirLazyResolveContractViolationException: "lazyResolveToPhase(STATUS) cannot be called from a transformer with a phase TYPES" on Java annotation usage
  • KT-60056 K2: Introduced UNRESOLVED_REFERENCE
  • KT-59791 K2: Implement partially constrained lambda analysis
  • KT-42020 Psi2ir: IllegalStateException: "IrSimpleFunctionPublicSymbolImpl for public [...] is already bound" on generic function whose substitution leads to IdSignature clash
  • KT-64771 Investigate subtle FIR_DUMP difference for reversed order analysis
  • KT-62584 K2: different signature in subclass of local class declared in extension value getter
  • KT-64615 Inconsistent error messages for platform type nullability assertions
  • KT-59938 K2: Disappeared AMBIGUOUS_ACTUALS
  • KT-64501 K2: False-positive WRONG_INVOCATION_KIND when using default arguments
  • KT-64640 Prevent mutating SequenceCollection methods from JDK 21 be available on read-only collections
  • KT-63644 K2: Create special IR symbols for fake-overrides in fir2ir in mode with IR f/o generator
  • KT-62476 K2: Enable building fake overrides by ir on non-JVM targets
  • KT-63638 K2: Compiler crashes with "Inline class types should have the same representation"
  • KT-36220 NI: false positive NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE if one use cannot resolve
  • KT-64121 K2: Actual modifier is missed on override fun toString() fro value class in native
  • KT-63703 K2: Eliminate call to Candidate.usesSAM and samResolver.getFunctionTypeForPossibleSamType in AbstractConeCallConflictResolver.toTypeWithConversion
  • KT-64435 K2: FIR2IR: Source offsets for data class members are inconsistent with PSI2IR
  • KT-64090 K2: false-positive new inference error on invoking from another module a generic function on Java list type with wildcard type argument bounded by raw-typed Java inner class
  • KT-64044 K2: Java mapped method should have a source from Java method, not from mapped Kotlin source class
  • KT-46674 ClassCastException with smartcast if plus operator returns a different type
  • KT-59369 K2: Missing BUILDER_INFERENCE_STUB_RECEIVER
  • KT-64644 K2: Compiler crash in FirTypeParameterBoundsChecker
  • KT-64312 K2: FirPropertySymbol.hasBackingField() always returns true for properties from other modules
  • KT-64420 K2: Wrong module descriptor for builtin classes
  • KT-64127 K2: incorrect resolution of inherited members on Java classes inheriting classes from different packages in the presence of identically named classes in the same packages
  • KT-63446 IrFakeOverrideBuilder: AbstractMethodError due to missing bridge for generic method in a Java superclass
  • KT-63441 IrFakeOverrideBuilder: "accidental override" when implementing a Java function taking an array parameter
  • KT-63867 K2: Smartcast is allowed inside changing lambda with cycles
  • KT-63414 K2 / Contracts: false positive "Result has wrong invocation kind" when invoking a function returning a value with contract InvocationKind.EXACTLY_ONCE and try/finally
  • KT-63777 K2: Smartcast is allowed inside changing lambda with bounds
  • KT-64059 K2: CYCLIC_INHERITANCE_HIERARCHY while using nested annotation in an outer class declaration
  • KT-63528 K2: Missing UNNECESSARY_SAFE_CALL for warning level annotated java declarations
  • KT-64607 K2: extension functions on UInt and Number lead to JVM ClassCastException
  • KT-62816 K2: Annotation use site targets printing could be improved in diagnostics' messages
  • KT-62815 K2: FIR renderings leak through some diagnostics' message
  • KT-35289 Confusing warning message "Duplicate label in when"
  • KT-49084 Contracts: error message is unclear
  • KT-63228 K2: Upper bound violation diagnostic renders compiler internals about SourceAttribute
  • KT-62386 K2: Proofread quotes in diagnostic messages
  • KT-64081 K2: Incorrect smartcast candidate calculation in MemberScopeTowerLevel
  • KT-63994 K2: Investigate K2 failures in IntelliJ-Rust plugin
  • KT-58767 Inheritance opt-in enforcement via @SubclassOptInRequired can be avoided with type aliases
  • KT-63941 K2: "IllegalStateException: Unsupported compile-time value STRING_CONCATENATION" caused by class reference in string expression as annotation parameter
  • KT-59818 K2: Explore the TODO about suspend functions overridden in Java in FirHelpers
  • KT-63233 K2 : false negative Class is not abstract and does not implement abstract member with abstract suspend function
  • KT-63379 K2. Argument type mismatch on creating functional interface instance with function literal as an argument with in type projection
  • KT-64308 K2: prefer call with Unit conversion at lower level to one without Unit conversion at upper level
  • KT-64307 K2: prefer function with default arguments at lower level to one without them at upper level during callable reference resolve
  • KT-64306 K2: prefer SAM at lower level to a functional type at upper level
  • KT-63827 K2: Array += desugaring doesn't have origin
  • KT-64341 Kotlin/JVM: Missing line number generation for intrinsic comparisons
  • KT-64238 Add proper documentation to the IdeCodegenSettings class
  • KT-63667 K2/KMP: exception when expect property matched to java field
  • KT-63563 K2: False negative RETURN_TYPE_MISMATCH with empty return
  • KT-62525 K2: IllegalStateException: Can't find KotlinType in IrErrorType: IrErrorType(null)
  • KT-57427 Fix inconsistencies in name manglers that use different declaration representations
  • KT-57755 K2/JVM: Fix computing a "signature" mangled name for the main function
  • KT-63645 K2: Replace special f/o symbols with normal ones after actualization
  • KT-63076 K2: change in behavior for synthetic properties in Kotlin-Java hierarchy
  • KT-63723 Frontend manglers improperly handle error type
  • KT-63738 K2: Some declarations are missing in the hierarchy of overridden symbols
  • KT-62242 K2: Uniformly treat enum entries as anonymous objects
  • KT-62281 K2: build DuckDuckGo Android user project and pass it to CI
  • KT-60266 K2: origin is not set for FOR_LOOP_ITERATOR
  • KT-59875 K2: Disappeared UNRESOLVED_REFERENCE_WRONG_RECEIVER
  • KT-62715 K2: Missing WASM_IMPORT_EXPORT_UNSUPPORTED_PARAMETER_TYPE
  • KT-62723 K2: Missing WASM_IMPORT_ON_NON_EXTERNAL_DECLARATION
  • KT-62722 K2: Missing NESTED_WASM_IMPORT
  • KT-62721 K2: Missing WASM_EXPORT_ON_EXTERNAL_DECLARATION
  • KT-62720 K2: Missing JS_AND_WASM_EXPORTS_ON_SAME_DECLARATION
  • KT-62719 K2: Missing NESTED_WASM_EXPORT
  • KT-62718 K2: Missing WASM_IMPORT_EXPORT_UNSUPPORTED_RETURN_TYPE
  • KT-62717 K2: Missing WASM_IMPORT_EXPORT_PARAMETER_DEFAULT_VALUE
  • KT-62716 K2: Missing WASM_IMPORT_EXPORT_VARARG_PARAMETER
  • KT-60225 K2: compiler FIR symbol resolution crash on a call to an extension function whose receiver contains a type parameter with a recursive upper bound
  • KT-63530 K2: Disable passing data flow info from in-place lambdas
  • KT-60958 K2: smart cast does not work with definite return from if block
  • KT-60090 K2: Introduced DEPRECATED_PARCELER
  • KT-59949 K2: Disappeared DEPRECATED_PARCELER
  • KT-61768 Wrong bytecode index in LineNumberTable when there is an incremental operation
  • KT-64045 K2: "Expect declaration * is incompatible with actual" when function parameter names are different
  • KT-62018 K2: prohibit suspend-marked anonymous function declarations in statement positions
  • KT-63973 K2: "NoSuchElementException: Array is empty" with vararg used within tail recursive function
  • KT-63612 K2: Class is not abstract and does not implement abstract member
  • KT-61792 KMP: Backend error on @Deprecated usage with DeprecationLevel.HIDDEN in K2
  • KT-63709 K2: Argument smartcasting impacting receiver and call resolution for implicit invoke
  • KT-57788 Fix computing mangled names of types with @EnhancedNullability from IR-based declaration descriptors
  • KT-63249 K2: change in annotation resolve when ambiguous
  • KT-63514 ISE “Inline class types should have the same representation: [I != I” during compilation on submitting UIntArray to vararg
  • KT-62553 K2: Add topLevelClassifierPackageNames to symbol name providers
  • KT-64148 K2: class cast exception org.jetbrains.kotlin.fir.types.ConeStarProjection
  • KT-63665 K2: "NullPointerException" caused by class with the companion object and extra curly brace
  • KT-59715 K2: Check behaviour of property + operator in operator position
  • KT-62347 Prohibit using property+invoke convention for delegated properties
  • KT-59421 K2: Missing CONTEXT_RECEIVERS_WITH_BACKING_FIELD
  • KT-59903 K2: Disappeared DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE
  • KT-62926 K2: IR has missing receivers during expect-actual matching
  • KT-62565 K2 cannot infer type parameters in case of expected functional type
  • KT-63328 K2: Top-level properties in scripts can be used while uninitialized
  • KT-59683 K2: Add control flow graph to FirScript
  • KT-63524 K2: "Not enough information to infer type argument"
  • KT-63835 K2: metadata compilation with constants is falling for Native
  • KT-60251 K2: delegated method are delegating to different methods in hierarchy compared to K1
  • KT-63695 JVM: Don't use plugin extensions when compiling code fragment
  • KT-63574 K2: "IllegalStateException: IrFieldPublicSymbolImpl for java.nio/ByteOrder.LITTLE_ENDIAN"
  • KT-60504 K2: difference between LL FIR and FIR in enhanced return type with annotation
  • KT-64147 K2: Generate FIR diagnostics with explicit types
  • KT-63042 K2: proper processing of propagated annotations
  • KT-59368 K2: Missing SUBTYPING_BETWEEN_CONTEXT_RECEIVERS
  • KT-64083 K2: "KotlinIllegalArgumentExceptionWithAttachments: Unexpected returnTypeRef. Expected is FirResolvedTypeRef, but was FirJavaTypeRef"
  • KT-37308 No smart cast when the null check is performed on a child property through a function with a contract
  • KT-59894 K2: Disappeared ANNOTATION_ARGUMENT_MUST_BE_CONST
  • KT-63329 K2: difference in SAM-conversion casts generation
  • KT-64062 K2 IDE. NPE on typing nullable parameter in return
  • KT-58579 K2: false-positive new inference error on invoking a generic function on Java wildcard type bounded by raw-typed Java inner class
  • KT-64031 K2: Revise naming in FirBuilderInferenceSession
  • KT-50453 Improve builder inference diagnostics with type mismatch due to chosen inapplicable overload
  • KT-56949 K2: Builder inference violates upper bound
  • KT-63648 K2: values of postponed type variable don't introduce type constraints in extension receiver positions during builder-style type inference
  • KT-64028 K2: Investigate questionable condition in FirBuilderInfernceSession
  • KT-63848 ReflectiveAccessLowering does not count arguments of super-calls
  • KT-61920 K2: False negative CONST_VAL_WITH_NON_CONST_INITIALIZER when initializer is Java field
  • KT-63508 K2: "IllegalArgumentException: Not FirResolvedTypeRef (String) in storeResult" caused by @Deprecated Java function and typo
  • KT-63522 K2: wrong context for delegated field type
  • KT-53308 TYPE_MISMATCH: Contracts on boolean expression has no effect on referential equality to null
  • KT-51160 Type mismatch with contracts on narrowing sealed hierarchy fail to smart cast
  • KT-49696 Smart cast to non-null with inline non-modifying closures sometimes doesn't work
  • KT-46586 SMARTCAST_IMPOSSIBLE when assigning value inside lambda instead of if expression
  • KT-41728 False positive no smart cast with unreachable code after return in if expression
  • KT-22904 Incorrect bytecode generated for withIndex iteration on Array

IR. Actualizer

  • KT-58861 K2: Improve the new pipeline of FIR2IR conversion, IR actualization and fake-override generation
  • KT-63347 K2: Fix overridden symbols inside LazyDeclarations
  • KT-62535 K2: FakeOverrideRebuilder can't handle f/o without overridden symbols

JavaScript

  • KT-61929 KJS: "IllegalStateException: No dispatch receiver parameter for FUN LOCAL_FUNCTION_FOR_LAMBDA" caused by run function in init block
  • KT-64366 KJS / K2: Exported declaration uses non-exportable return type: 'kotlin.?'
  • KT-64426 K2: Implement JsIrLineNumberTestGenerated for K2
  • KT-64422 K2: Implement IrJsSteppingTestGenerated for K2
  • KT-64364 K2 / KJS: @JSExports generates clashing declarations for companion objects that extends its own class
  • KT-63038 Compilation of suspend functions into ES2015 generators

Klibs

  • KT-64085 Different klib signatures for K1/K2 for overridden properties assigned in init block
  • KT-64395 API for ABI: Add a check for the file's existence to KLIB ABI Reader
  • KT-63573 K2: Dependency problems with dependencies with same artifact id
  • KT-64082 Different klib signatures in K1/K2 for the same locally used constant declaration
  • KT-63931 [K/N] Relative path to klib option of cinterop tool doesn't work
  • KT-60390 KLIBs: Wrong IrSymbol is used for deserialized expect property's backing field & accessors

Libraries

  • KT-61969 Migrate kotlin-test to the current Kotlin Multiplatform Plugin
  • KT-64361 Optimization opportunity in Int.sign
  • KT-63157 Make sure that all deprecation levels are raised to ERROR for declarations intended for removal from kotlinx-metadata
  • KT-64230 Prohibit writing versions of metadata that are too high

Native

  • KT-61695 [K/N] Empty list error in FakeOverridesActualizer with K2
  • KT-64508 IndexOutOfBoundsException in Konan StaticInitializersOptimization

Native. C and ObjC Import

  • KT-63049 NPE in BackendChecker.visitDelegatingConstructorCall compiling ObjC-interop class
  • KT-59597 [K\N] Usage of instancetype in block return type crashes

Native. ObjC Export

  • KT-62091 KMP for iOS framework with private api : __NSCFBoolean
  • KT-64076 ObjCExport: Do not retain descriptors in stubs
  • KT-64168 ObjCExport: Split header generator module into K1 and Analysis Api
  • KT-64227 ObjCExport: Extract Header Generation to base module

Native. Runtime. Memory

  • KT-62689 Native: generate signposts for GC performance debugging

Native. Testing

  • KT-64256 IR_DUMP directive doesn't enforce FIR_IDENTICAL when it is possible
  • KT-62157 Native: Migrate FileCheck tests to new native test infra

Tools. CLI

  • KT-64013 CLI REPL: "com.sun.jna.LastErrorException: [14] Bad address" on invoking kotlinc from CLI on ARM Mac

Tools. Compiler Plugin API

  • KT-64444 K2: IrGeneratedDeclarationsRegistrar.addMetadataVisibleAnnotationsToElement doesn't work for declarations in common module

Tools. Compiler Plugins

  • KT-33020 Support stripping debug information in the jvm-abi-gen plugin
  • KT-64707 K2: Parcelize ignores @TypeParceler set for typealias

Tools. Compiler plugins. Serialization

  • KT-64447 K2: Implement Serialization...IrBoxTestGenerated for K2
  • KT-64124 Different klib signatures in K1/K2 for a serializable class

Tools. Gradle

  • KT-64653 Add Kotlin DslMarker into Gradle plugin DSL
  • KT-64251 KGP: Cannot re-use tooling model cache with Project Isolation due to "~/.gradle/kotlin-profile" changing
  • KT-58768 Support configuration cache and project isolation for FUS statistics
  • KT-64379 Remove kotlin.useK2 gradle property
  • KT-62527 Gradle: get rid of the Project.buildDir usages
  • KT-55322 Kotlin daemon: Cannot perform operation, requested state: Alive > actual: LastSession

Tools. Gradle. Cocoapods

  • KT-57650 Gradle Cocoapods: use pod install --repo-update instead of pod install

Tools. Gradle. JS

  • KT-64561 K/JS tests are not executed after upgrade to 1.9.22
  • KT-63435 KJS: Get rid of deprecated outputFileProperty of Kotlin2JsCompile

Tools. Gradle. Multiplatform

  • KT-56440 TCS: Gradle Sync: Add API to populate extras only during sync
  • KT-63226 KGP Multiplatform Ide Dependency Resolution: Use gradle variants instead/in addition of ArtifactResolutionQuery

Tools. Gradle. Native

  • KT-62745 iOS application build is failing if script sandboxing option is enabled in Xcode
  • KT-62800 CInteropProcess should not require .def file to exist
  • KT-62795 CInteropProcess task resolves cinterop def file eagerly, breaking Gradle task dependencies

Tools. Incremental Compile

  • KT-63837 Implement baseline fix for common sources getting access to platform declarations
  • KT-64513 Simplify adding configuration properties to incremental compilation
  • KT-21534 IC doesn't recompile file with potential SAM-adapter usage
  • KT-63839 Measure impact of rebuilding common sources, using nightly IC benchmarks
  • KT-64228 K2: After switching to LV20 branch incremental tests are not running on PSI anymore
  • KT-46743 Incremental compilation doesn't process usages of Java property in Kotlin code if getter is removed
  • KT-60522 Incremental compilation doesn't process usages of Java property in Kotlin code if return type of getter changes

Tools. JPS

  • KT-55393 JPS: Java synthetic properties incremental compilation is broken

Tools. Kapt

  • KT-64719 K2 KAPT Stub genertaion doesn't fail on files with syntax errors
  • KT-64680 Kapt: remove the flag to enable old JVM backend
  • KT-64639 KAPT+JVM_IR: erased error types in JvmStatic and JvmOverloads
  • KT-64389 K2 KAPT generates invalid code for multiple generic constraints
  • KT-61776 K2: KAPT tasks fail with parallel gradle
  • KT-64021 Kapt3 + Kapt4. NullPointerException: processingEnv must not be null
  • KT-64303 K2 KAPT: Kapt doesn't dispose resources allocated by standalone analysis API
  • KT-64301 K2 KAPT: Kapt doesn't report invalid enum value names to log
  • KT-64297 K2 KAPT: Deprecated members are not marked with @java.lang.Deprecated

Tools. REPL

  • KT-18355 REPL doesn't quit on the first line after pressing Ctrl+D or typing :quit