Kotlin 1.4.0
Contents
The release contents the JVM version of the Kotlin compiler, and also the Kotlin/Native compiler for the supported platforms: Linux, macOS and Windows.
Changelog
1.4.0
Compiler
New Features
KT-23729Provide a way to generate JVM default method bodies in interfaces delegating to DefaultImplsKT-30330Introduce KotlinNothingValueException and throw it instead of NPE on expressions of type NothingKT-38435Support suspend conversion on callable references in JVM backend
Fixes
KT-35483NI: compatibility modeKT-39728Declarations fromkotlin.reflectresolved to expect-classes even in JVM modules in IDEKT-40153REPL IDE services completion fails on imports completionKT-40404Mixed named/positional arguments: argument can be passed twiceKT-40544NI: "TYPE_MISMATCH: Required: MutableList<out T!> Found: List" caused by Java interface functionKT-40555NI: Spread operator allows inferred nullable typesKT-40646NI: TYPE_MISMATCH: "inferred type is Unit but Observer was expected" caused by LieData.observe inferenceKT-40691False positive CAPTURED_VAL_INITIALIZATION with EXACTLY_ONCE contractKT-40693UnsupportedOperationException: no descriptor for type constructor of (CapturedType(out TResult)..CapturedType(out TResult)?)KT-40824Usages of a typealias lose nullability and annotations in deserializationKT-40843Unhandled exception for suspending methods that return Result typeKT-40869Recursion computation inside compiler resolve on a correct codeKT-40893Error "Captured values initialization is forbidden due to possible reassignment" when attempting to use the plusAssign operator with a java list inside an inline functionKT-40919kotlin.collections.ArrayDeque requires an explicit import when compiling with kotlinc 1.4-RC and -language-version 1.3KT-40920Regression in JvmDefault: incorrect access to missing DefaultImpls on default methods in Java interface overriding Kotlin interfaceKT-40978Prohibit using suspend functions as SAM in fun interfaces
Kotlin/Native
- Objective-C/Swift interop:
- Added native-specific frontend checkers (implemented in the main Kotlin repository: GH-3293, GH-3091, GH-3172)
- .dSYMs for release binaries on Apple platforms (GH-4085)
- Improved compilation time of builds with interop libraries by reworking cinterop under the hood.
- Experimental mimalloc allocator support (-Xallocator=mimalloc) to improve execution time performance. (GH-3704)
- Tune GC to improve execution time performance
- Various fixes to compiler caches and Gradle daemon usage
Docs & Examples
KT-35218Fix misleading in JavaDoc forcreateTempDir/createTempFileKT-36981Provide a visual illustration of source sets structure generated byios(),watchos(),tvos()presetsKT-38050Language Guide: MPP reference: add sample of language settings for all roots instead of common root only
IDE
KT-30265IDE, MPP: False negative TYPE_PARAMETER_AS_REIFIED in common codeKT-40494UAST: "NoSuchElementException: No element of given type found" with use-site target annotationKT-40639Shift IDE plugins updater numbers for Kotlin plugin
IDE. Code Style, Formatting
KT-40636Hard freeze on formatter: infinite recursion
IDE. Gradle Integration
KT-30116IDE: Unresolved reference in MPP module (androidMain source set) for annotation from common module (defined in commonMain and with JVM target)
IDE. Gradle. Script
KT-34552Deadlock in ScriptDefinitionsManagerKT-40675Gradle build file is not highlighted until navigating to symbol
IDE. JS
KT-40461Create new projects with kotlin.js.generate.executable.default=false
IDE. Script
KT-39547Kotlin script support freezes IDEAKT-40242gradle.kts: Deadlock in ScriptClassRootsUpdater
IDE. Wizards
KT-36153New Project Wizard: provide more referential info on project structure editor screenKT-39904New Project wizard 1.4: update Frontend Application to make it run with JS IRKT-40149Gradle project wizard: templates for Kotlin/JS are not properly formatted
JavaScript
KT-25859JS: support function references to functions with vararg if expected type ends with repeated vararg element typeKT-40083K/JS-IR: java.lang.IllegalStateException: has not acquired a symbol yetKT-40892KJS, IR: Unresolved references on importing classes from kotlinx-nodejs
Libraries
KT-39051Libraries native artifacts are published without sources
Tools. Gradle
KT-27816Provide a possibility to specify intermediate source sets between platform-agnostic and platform-specific test source setsKT-37720Replace ArtifactTransform with TransformActionKT-40559Adding the stdlib by default triggers warning in the Android Gradle Plugin
Tools. Gradle. JS
KT-40093Incorrect updating version of Kotlin/JS dependencies in package.json
Tools. Gradle. Multiplatform
KT-27320Provide a way to reuse same sources for similar Native targetKT-40058NPE from mpp gradle plugin on kotlinx.benchmarks
Tools. Gradle. Native
KT-40801Gradle CocoaPods integration: Cannot change a framework name
1.4-RC
Backend. Native
KT-40209java.lang.UnsupportedOperationException: org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl@76484173KT-40367Kotlin/Native-Swift interop (iOS): Array member initialization failing in release builds
Compiler
Fixes
KT-31025Type mismatch when callable reference is resolved with a functional expected type and SAM conversionKT-37388Consider relaxing rules about inferring Nothing inside special constructions (if, try, when)KT-37717NI: "IllegalStateException: Error type encountered" with @BuilderInferenceKT-38427New inference in branched conditions (if, when) results in odd behavior with inconsistent compiler warnings and runtime errorsKT-38899NI: False positive IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION leads to NPEKT-39468NI: overload resolution ambiguity between functions passingTandFoo<T>with a contravariant receiverKT-39618NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER: unable to infer generic type on @BuilderInference annotated lambda parameter with receiver typeKT-39633NI: Incorrect type parameter instantiation based on contravariant type argumentKT-39691NI: Missing SAM conversion for nullable lambdaKT-39860Make Kotlin binaries publicly available (set KotlinCompilerVersion.IS_PRE_RELEASE = false)KT-39900NI: Incorrect type inference in a lambda returning UnitKT-39925New JVM default compilation mode doesn't check that JVM target is 1.8KT-39943Write information about all-compatibility mode in metadataKT-39953NI: ClassCastException "cannot be cast to java.lang.Void" with if-else in return statement in ANdroid projectKT-40045NI: lambda’s receiver type isn't inferred properlyKT-40057NI: provideDelegate org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: wrong bytecode generated for static initializerKT-40060NI: postponed variable from the builder inference flows to back-end and leads to throw an exceptionKT-40112Kotlin Gradle DSL: COMPATIBILITY_WARNING onkotlin.sourceSetsblockKT-40113Kotlin Gradle DSL: "Expression 'main' cannot be invoked as a function" fordistributions.mainDSL blockKT-40128Introduce compiler key to disable compatibility resolution mechanism for new inference featuresKT-40151NI: postponed variable isn't substituted for top-level CR inside builder inferenceKT-40214AbstractMethodError in gradle subplugin which is used in Android appKT-40234Deprecation level "hidden" has no effect on callable reference argumentKT-40247NI: false positive "function should be called from coroutine or another suspend function" for suspend invoke operator in try-catchKT-40254Rewrite at slice with two callable reference argumentsKT-40269NI: "disabled Unit conversions" error has appeared on green codeKT-40337NI: false positive "function should be called from coroutine or another suspend function" for suspend invoke operator inwhenblockKT-40406Prohibit reflection on adapted callable references
IDE
KT-39968Paths in KotlinJavaRuntime library aren't updated after you run IDE from a different directoryKT-39989NullPointerException when opening Kotlin facets in Project Structure dialog in IDEA 192KT-40311Create change_notes for 1.4 in IDE plugin description
IDE. Debugger
KT-39808(CoroutineDebugger) Doesn't start with kotlinx-coroutines-core >= 1.3.6KT-40073(CoroutineDebugger) Change minimum supported kotlinx.coroutines version to 1.3.8*KT-40172Restored frame variables isn't shown for suspended coroutinesKT-40635Coroutines Debugger: make IDE plugin accept coroutines 1.3.8-rc* versions as well
IDE. Gradle Integration
KT-38744No dependency between Androidtestand commonTest source sets with kotlin.mpp.enableGranularSourceSetsMetadata=trueKT-39037'None of the consumable configurations have attributes' in MPP IDE import with transitive project dependency on self
IDE. Gradle. Script
KT-31137IntelliJ would get very slow when editing gradle buildSrc(using the kotlin dsl)KT-36078Gradle Kotlin script context is not reloaded when gradle/wrapper/gradle-wrapper.properties file is changedKT-39317ISE “Calling invokeAndWait from read-action leads to possible deadlock.” on importing simple Gradle-based project in nightly IJ
IDE. Inspections and Intentions
KT-28662Inspection to flag usage of the wrong Transient annotation on Kotlin Serializable classKT-34209Switch default behaviour in 1.4 for insertion (to build script) via quick fix of the compiler option enabling inline classesKT-36131Suggest to add a missing module dependency on an unresolved reference in Kotlin codeKT-37462Add "Add dependency to module" quickfix in multimodule Maven projectKT-39869Add whole project migration usages of kotlin.browser.* & kotlin.dom.* to kotlinx.browser.* & kotlinx.dom.* respectively
IDE. Wizards
KT-40004New Project wizard 1.4+: nohttps://dl.bintray.com/kotlin/kotlinxrepository is added for kotlinx-htmlKT-40037New Project wizard: update Ktor versionKT-40092Wizard: the templates panel on mac OS is too wideKT-40232New Wizard: Android Sdk path doesn't have backslash escaping on WindowsKT-40371New Project Wizard: Frontend Application / Library results in broken run configurationKT-40377New Project Wizard: Frontend Application defines NPM dependencies that are unnecessary with Kotlin 1.4-RC+KT-40378New Project Wizard: Frontend Application, Disabling JavaScript test framework has no effectKT-40407Wizard: do not add stdlib by default for Gradle projects in wizard
JS. Tools
KT-39984Update dukat version in toolchain near to release of 1.4-RC
JavaScript
KT-32186Make sure K/JS Reflection API documentation is correct and fix it.KT-37563K/JS: stacktrace is not captured for exceptions without primary constructor inherited from Exception/ErrorKT-37752Generated typescript incorrect for constructors of derived classesKT-37883KJS: Generated TypeScript uses 'declare' rather than 'export'KT-38771JS: support non-reified type parameters in typeOfKT-39873Update Kotlin JavaScript wrappers due to NON_EXPORTABLE_TYPE diagnostic introductionKT-40126[JS / IR] NPE while compiling interfaces with invoke which is passed as a delegateKT-40216KJS / IR: AssertionError caused by an anonymous object in the dependency project
Libraries
KT-33069StringBuilder common functionsKT-35972Add contract to builder functionsKT-37101Mark following api with DeprecatedSinceKotlin("1.4")KT-38360Make sure that JB libraries correctly define their npm deps and republish them (after KT-30619)KT-38817'capitalize' should convert digraphs to title caseKT-40168Remove StringBuilder.capacity from common and JS parts
Middle-end. IR
KT-40520Assert during fake-override generation
Tools. Commonizer
KT-40199Commonizer loses nullability of abbreviated types
Tools. Compiler Plugins
KT-40036Add diagnostic that shows is serialization plugin compatible with serialization-runtime
Tools. Gradle
KT-39755[KJS / Gradle / Legacy mode] Directory with whitespace is not processedKT-39809Kotlin Gradle plugin: ServiceConfigurationError: org.jetbrains.kotlin.gradle.plugin.KotlinGradleSubplugin: Provider org.jetbrains.kotlin.gradle.internal.AndroidSubplugin not a subtypeKT-39977Collect statistics of used -Xjvm-default optionsKT-40300Fail the build if in MPP plugin no targets configured
Tools. Gradle. JS
KT-38170Investigate how to improve migration experience from pre 1.4.0 DSL to the new oneKT-39654Default CSS settings in webpack has priority over user's settingsKT-39842Kotlin/JS Gradle DSL: peerNpm dependency failsKT-40048[Gradle, JS] Deprecate kotlin-frontend pluginKT-40067[Gradle, JS] Public package.json for mixed JS/TS projectKT-40210Fail the build when Kotlin/JS target is not (properly) configuredKT-40320Gradle JS: make migration to the new Gradle DSL smoother
Tools. Gradle. Multiplatform
KT-32239Custom configurations inside Kotlin JVM Gradle projects can't properly resolve multiplatform dependenciesKT-39897[Commonizer] Fast-pass for library fragments absent for some targets
Tools. J2K
KT-39739J2K: Access is allowed from event dispatch thread with IW lock only
Tools. kapt
KT-34604KAPT: Flaky NPE throughorg.jetbrains.kotlin.kapt3.base.ProcessorLoader.doLoadProcessorsKT-36302TypeTreeVisitor.visitMemberSelect IllegalStateException: node.sym must not be null on JDK 11KT-39876KAPT: Serialization of classpath structure is incorrect if there are dependencies between types in jar/dir
1.4-M3
Compiler
New Features
KT-23575Deprecate with replacement and SinceKotlinKT-38652Do not generate optional annotations to class files on JVMKT-38777Hide Throwable.addSuppressed member and prefer extension instead
Performance Improvements
KT-38489Compilation of kotlin html DSL increasingly slowKT-28650Type inference for argument type is very slow if several interfaces with a type parameter is used as an upper bound of a type parameter
Fixes
KT-15971Incorrect bytecode generated when inheriting default arguments not from the first supertypeKT-25290NI: "AssertionError: If original type is SAM type, then candidate should have same type constructor" on out projection of Java classKT-28672Contracts on calls with implicit receiversKT-30279Support non-reified type parameters in typeOfKT-31908NI: CCE on passing lambda to function which accepts vararg SAM interfaceKT-32156New inference issue with genericsKT-32229New inference algorithm not taking into account the upper bound classKT-33455Override equals/hashCode in functional interface wrappersKT-34902AnalyzerException: Argument 1: expected I, but found R for unsigned types in generic data classKT-35075AssertionError: "No resolved call for ..." with conditional function referencesKT-35468Overcome ambiguity between typealias kotlin.Throws and the aliased type kotlin.jvm.ThrowsKT-35494NI: Multiple duplicate error diagnostics (in IDE popup) with NULL_FOR_NONNULL_TYPEKT-35681Wrong common supertype between raw and integer literal type leads to unsound codeKT-35937Error "Declaration has several compatible actuals" on incremental buildKT-36013Functional interface conversion not happens on a value of functional type with smart cast to a relevant functional typeKT-36045Do not depend on the order of lambda arguments to coerce result toUnitKT-36448NI: fix tests after enabling NI in the compilerKT-36706Prohibit functional interface constructor referencesKT-36969Generate @NotNull on instance parameters of Interface$DefaultImpls methodsKT-37058Incorrect overload resolution ambiguity on callable reference in a conditional expression with new inferenceKT-37120[FIR] False UNRESOLVED_REFERENCE for public and protected member functions and properties which are declared in object inner classKT-37149Conversion when generic specified by type argument of SAM typeKT-37249false TYPE_MISMATCH when When-expression branches have try-catch blocksKT-37341NI: Type mismatch with combination of lambda and function referenceKT-37436AME: "Receiver class does not define or inherit an implementation of the resolved method" in runtime on usage of non-abstract method of fun interfaceKT-37510NI infersjava.lang.Voidfrom the expression in a lazy property delegate and throws ClassCastException at runtimeKT-37541SAM conversion with fun interface without a function fails on compiling and IDE analysis in SamAdapterFunctionsScope.getSamConstructor()KT-37574NI: Type mismatch with Kotlin object extending functional type passed as @FunctionalInterface to JavaKT-37630NI: ILT suitability in a call is broken if there are CST calculation and calling function's type parametersKT-37665NI: applicability error due to implicitly inferred Nothing for returning T with expected typeKT-37712No extension receiver in functional interface created with lambdaKT-37715NI: VerifyError: Bad type on operand stack with varargs generic value when type is inferredKT-37721NI: Function reference with vararg parameter treated as array and missing default parameter is rejectedKT-37887NI: Smart casting for Map doesn't work if the variable is already "smart casted"KT-37914NI: broken inference for a casting to subtype function within the common constraint system with this subtypeKT-37952NI: improve lambdas completion through separation the lambdas analysis into several stepsKT-38069Callable reference adaptation should have dependency on API version 1.4KT-38143New type inference fails when calling extension function defined on generic type with type arguments nested too deepKT-38156FIR Metadata generationKT-38197java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objectsKT-38259NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER for provideDelegateKT-38337Map delegation fails for inline classesKT-38401FIR: protected effective visibility is handled unpreciselyKT-38416FIR: infinite loop in BB coroutine test 'overrideDefaultArgument.kt'KT-38432FIR: incorrect effective visibility in anonymous objectKT-38434Implement resolution of suspend-conversion on FE only, but give error if suspend conversion is calledKT-38437[FIR] String(CharArray) is resolved to java.lang.String constructor instead of kotlin.text.String pseudo-constructorKT-38439NI: anonymous functions without receiver is allowed if there is an expected type with receiverKT-38473FIR: ConeIntegerLiteralType in signatureKT-38537IllegalArgumentException: "marginPrefix must be non-blank string" with raw strings and space as margin prefix in trimMargin() callKT-38604Implicit suspend conversion on call arguments doesn't work on vararg elementsKT-38680NSME when calling generic interface method with default parameters overriden with inline class type argumentKT-38681Wrong bytecode generated when calling generic interface method with default parameters overriden with primitive type argumentKT-38691NI: overload resolution ambiguity if takeRand() -> R, and pass literal lambda, which returnsRKT-38799False positive USELESS_CAST for lambda parameterKT-38802Generated code crashes by ClassCastException when delegating with inline classKT-38853Backend Internal error: Error type encountered: Unresolved type for nested class used in an annotation argument on an interface methodKT-38890NI: false negative Type mismatch for values with fun keywordKT-39010NI: Regression with false-positive smartcast on var of generic typeKT-39013202, ASM 8: "AnalyzerException: Execution can fall off the end of the code"KT-39260"AssertionError: Unsigned type expected: Int" in rangeKT-39305NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER: unable to infer deeply nested type bound when class implements generic interfaceKT-39408Using unsigned arrays as generics fails in 1.4-M2 with class cast exceptionKT-39533NI: Wrong overload resolution for methods with SAM converted function reference argumentsKT-39535NI: Inference fails for the parameters of SAM converted lambdas with type parametersKT-39603Require explicit override in JVM default compatibility mode on implicit generic specialization of inherited methods in classesKT-39671Couldn't inline method call 'expectBody'KT-39816NI:ClassCastException and no IDE error with provideDelegate when DELEGATE_SPECIAL_FUNCTION_MISSING in OIKT-32779Rewrite at slicein array access resolution in coroutine inferenceKT-39387Can't build Kotlin project due to overload resolution ambiguity on flatMap callsKT-39229NI: resolution to wrong candidate (SAM-type against similar functional type)
Docs & Examples
KT-36245Document that @kotlin.native.ThreadLocal annotation doesn't work anywhere except in Kotlin/NativeKT-37943Conflicting overloads in the factory functions sample code in Coding Conventions Page
IDE
New Features
KT-10974Add Code Style: Import Layout Configuration TableKT-39065"Join lines" should remove trailing comma on call site
Fixes
KT-9065Wrong result when move statement through if block with call with lambdaKT-14757Move statement up breaks code in function parameter listKT-14946Move statement up/down (with Ctrl+Shift+Up/Down) messes with empty linesKT-15143Kotlin: Colors&Fonts -> "Enum entry" should use Language Default -> Classes - Static fieldKT-17887Moving statement (Ctrl/Cmd+Shift+Down) messes with use blockKT-34187UAST cannot get type of array accessKT-34524"PSI and index do not match" and IDE freeze with library import fromsquare/workflowKT-35574UAST: UBreakExpression in when expression should be UYieldExpressionKT-36801IDE: Unsupported language version value is represented with "latest stable" in GUIKT-37378Remove IDE option "Enable new type inference algorithm..." in 1.4KT-38003"Analyze Data Flow from Here" should work on parameter of abstract methodKT-38173Reified types do no have extends informationKT-38217Make Kotlin plugin settings searchableKT-38247"IncorrectOperationException: Incorrect expression" through UltraLightUtils.kt: inlined string is not escaped before parsingKT-38293Throwable: "'codestyle.name.kotlin' is not found in java.util.PropertyResourceBundle" at KotlinLanguageCodeStyleSettingsProvider.getConfigurableDisplayName()KT-38407Drop components from plugin.xmlKT-38443No error on change in property initializerKT-38521ISE: Loop in parent structure when converting a DOT_QUALIFIED_EXPRESSION with parent ANNOTATED_EXPRESSIONKT-38571Rework deprecated EPsKT-38632Change the code style to official in tests
IDE. Code Style, Formatting
Fixes
KT-24750Formatter: Minimum blank lines after class header does nothingKT-31169IDEA settings search fails to find "Tabs and Indents" tab in Kotlin code style settingsKT-35359Incorrect indent for multiline expression in string templateKT-37420Add setting to disable inserting empty line between declaration and declaration with commentKT-37891Formatter inserts empty lines between annotated propertiesKT-38036Use trailing comma setting does not apply to code example in Settings dialogKT-38568False positive: weak warning "Missing line break" on -> in when expressionKT-39024Add option for blank lines before declaration with comment or annotation on separate lineKT-39079Trailing comma: add base support for call siteKT-39123OptionAlign 'when' branches in columnsdoes nothingKT-39180Move trailing comma settings in Other tab
IDE. Completion
KT-18538Completion of static members of grand-super java class inserts unnecessary qualifierKT-38445Fully qualified class name is used instead after insertion ofdelaymethod
IDE. Debugger
Fixes
KT-14057Debugger couldn't step into Reader.readKT-14828Bad step into/over behavior for functions with default parametersKT-36403Method breakpoints don't work for librariesKT-36404Evaluate: "AssertionError: Argument expression is not saved for a SAM constructor"KT-37486Kotlin plugin keeps reference to stream debugger support classes after stream debugger plugin is disabledKT-38484Coroutines Debugger: IAE “Requested element count -1 is less than zero.” is thrown by calling dumpCoroutinesKT-38606Coroutine Debugger: OCE from org.jetbrains.kotlin.idea.debugger.coroutine.proxy.mirror.BaseMirror.isCompatibleKT-39143NPE on setCurrentStackFrame to Kotlin inner compiled class contentKT-39412Failed to find Premain-Class manifest attribute when debugging main method with ktorKT-39634(CoroutineDebugger) Agent doesn't start if using kotlinx-coroutines-core only dependencyKT-39648Coroutines debugger doesn't see stacktraces in case of the project has kotlinx-coroutines-debug dependency
IDE. Gradle Integration
Performance Improvements
KT-39059Poor performance ofmodifyDependenciesOnMppModules
Fixes
KT-35921Gradle Import fails with "Unsupported major.minor version 52.0" on pure Java project in case "Gradle JDK" is lower 1.8 and Kotlin plugin is enabledKT-36673Gradle Project importing: move ModelBuilders and ModelProviders to kotlin-gradle-tooling jarKT-36792IDEA 2020.1: Some module->module dependencies in HMPP project are missed after import from GradleKT-37125Imported modules structure for MPP project is displayed messy in UI in IDEA 2020.1KT-37428NPE at KotlinFacetSettings.setLanguageLevel() on the first project importKT-38706IDE Gradle import creates 4 JavaScript modules for MPP source sets with BOTH compiler typeKT-38767Published hierarchical multiplatform library symbols are unresolved in IDE (master)KT-38842False positive [INVISIBLE_MEMBER] forinternaldeclaration of commonMain called from commonTestKT-39213IDE: references from MPP project to JavaScript library are unresolved, when project and library are compiled with "both" modeKT-39657Language settings for intermediate source-sets are lost during import
IDE. Gradle. Script
New Features
KT-34481*.gradle.kts: use Intellij IDEA Gradle project sync mechanics for updating script configuration
Performance Improvements
KT-34138Deadlock inScriptTemplatesFromDependenciesProviderKT-38875Deadlock in ScriptClassRootsUpdater.checkInvalidSdks
Fixes
KT-34265Bogus "build configuration failed, run 'gradle tasks' for more information" message and other issues related to "script dependencies"KT-34444*.gradle.kts: special storage of all scripts configuration on one fileKT-35153build.gradle.kts: scripts in removed subproject remain imported, but shouldn'tKT-35573Request for gradle build script configuration only after explicit click on notificationKT-36675move .gradle.kts ModelBuilders and ModelProviders to kotlin-gradle-tooling jarKT-37178build.gradle.kts: Rework the notification for scripts out of projectKT-37631Unnecessary loading dependencies after opening build.gradle.kts after project import with Gradle 6KT-37863Scanning dependencies for script definitions takes too long or indefinitely during Gradle importKT-38296MISSING_DEPENDENCY_SUPERCLASS in the build.gradle.kts editor while Gradle runs OkKT-38541"Invalid file" exception in ScriptChangeListener.getAnalyzableKtFileForScript()KT-39104“Gradle Kotlin DSL script configuration is missing” after importing project in IJ201, Gradle 6.3KT-39469Gradle version is not updated in script dependencies if the version of gradle was changed in gradle-wrapper.propertiesKT-39771Freeze 30s from org.jetbrains.kotlin.scripting.resolve.ApiChangeDependencyResolverWrapper.resolve on loading script configuration with Gradle 5.6.4
IDE. Inspections and Intentions
New Features
KT-14884Intention to add missing "class" keyword for enum and annotation top-level declarationsKT-17209Provide intention to fix platform declaration clash (CONFLICTING_JVM_DECLARATIONS)KT-24522Suggest to move typealias outside the classKT-30263Detect redundant conversions of unsigned typesKT-35893Support Inspection for unnecessary asSequence() callKT-38559"Change JVM name" (@JvmName) quickfix: improve name suggester for generic functionsKT-38597Expand Boolean intentionKT-38982Add "Logger initialized with foreign class" inspectionKT-39131TrailingCommaInspection: should suggest fixes for call-site without warnings
Fixes
KT-5271Missing QuickFix for Multiple supertypes availableKT-11865"Create secondary constructor" quick fix always inserts parameter-less call tothis()KT-14021Quickfix to add parameter to function gives strange name to parameterKT-17121"Implement members" quick fix is not suggestedKT-17368Don't highlight members annotated with @JsName as unusedKT-20795"replace explicit parameter with it" creates invalid code in case of overload ambiguitiesKT-22014Intention "convert lambda to reference" should be available for implicit 'this'KT-22015Intention "Convert lambda to reference" should be available in spite of the lambda in or out of parenthesesKT-22142Intentions: "Convert to primary constructor" changes semantics for property with custom setterKT-22878Empty argument list at the call site of custom function named "suspend" shouldn't be reported as unnecessaryKT-24281Importing of invoke() from the same file is reported as unused even if it isn'tKT-25050False-positive inspection "Call replaceable with binary operator" for 'equals'KT-26361@deprecated "ReplaceWith" quickfix inserts 'this' incorrectly when using function importsKT-27651'Condition is always true' inspection should not be triggered when the condition has references to a named constantKT-29934False negativeChange typequickfix on primary constructor override val parameter when it has wrong typeKT-31682'Convert lambda to reference' intention inside class with function which return object produces uncompilable codeKT-31760Implement Abstract Function/Property intentions position generated member improperlyKT-32511Create class quick fix is not suggested in super type list in case of missing primary constructorKT-32565False positive "Variable is the same as 'credentials' and should be inlined" with object declared and returned from lambdaKT-32801False positive "Call on collection type may be reduced" with mapNotNull, generic lambda block and new inferenceKT-33951ReplaceWith quickfix with unqualified object member call doesn't substitute argument for parameterKT-34378"Convert lambda to reference" refactoring does not work for suspend functionsKT-34677False positive "Collection count can be converted to size" withIterableKT-34696Wrong 'Redundant qualifier name' for 'MyEnum.values' usageKT-34713"Condition is always 'false'": quickfix "Delete expression" doesn't removeelsekeyword (may break control flow)KT-35015ReplaceWith doesn't substitute parameters with argument expressionsKT-35329Replace 'when' with 'if' intention: do not suggest if 'when' is used as expression and it has no 'else' branchKT-36194"Add braces to 'for' statement" inserts extra line break and moves the following single-line commentKT-36406"To ordinary string literal" intention adds unnecessary escapes to characters in template expressionKT-36461"Create enum constant" quick fix adds after semicolon, if the last entry has a commaKT-36462"Create enum constant" quick fix doesn't add trailing commaKT-36508False positive "Replace 'to' with infix form" when 'to' lambda generic type argument is specified explicitlyKT-36930Intention "Specify type explicitly" adds NotNull annotation when calling java method with the annotationKT-37148"Remove redundant.letcall doesn't remove extra callsKT-37156"Unused unary operator" inspection highlighting is hard to seeKT-37173"Replace with string templates" intention for String.format produces uncompilable string templateKT-37181Don't show "Remove redundant qualifier name" inspection on qualified Companion imported with star importKT-37214"Convert lambda to reference" with a labeled "this" receiver failsKT-37256False positivePlatformExtensionReceiverOfInlineinspection if a platform type value is passed to a nullable receiverKT-37744"Convert lambda to reference" inspection quick fix create incompilable code when type is inferred from lambda parameterKT-37746"Redundant suspend modifier" should not be reported for functions with actual keywordKT-37842"Convert to anonymous function" creates broken code with suspend functionsKT-37908"Convert to anonymous object" quickfix: false negative when interface has concrete functionsKT-37967Replace 'invoke' with direct call intention adds unnecessary parenthesisKT-37977"Replace 'invoke' with direct call" intention: false positive when function is not operatorKT-38062Reactor Quickfix throwsNotImplementedErrorfor KotlinKT-38240False positive redundant semicolon withascast andnotunary operator on next lineKT-38261Redundant 'let' call removal leaves ?. operator and makes code uncompilableKT-38310Remove explicit type annotation intention drops 'suspend'KT-38492False positive "Add import" intention for already imported classKT-38520SetterBackingFieldAssignmentInspection throws exceptionKT-38649False positive quickfix "Assignment should be lifted out of when" in presence of smartcastsKT-38677Invalid psi tree afterLift assigment out of...KT-38790"Convert sealed subclass to object" for data classes doesn't remove 'data' keywordKT-38829'Remove redundant backticks' can be broken with @ in nameKT-38831'Replace with assignment' can be broken with fast code changeKT-38832"Remove curly braces" intention may produce CCEKT-38948False positive quickfix "Make containing function suspend" for anonymous functionKT-38961"Useless call on collection type" for filterNotNull on non-null array where list return type is expectedKT-39069Improve TrailingCommaInspectionKT-39151False positive inspection to replace Java forEach with Kotlin forEach when using ConcurrentHashMap
IDE. JS
KT-39275Kotlin JS Browser template for kotlin dsl doesn't include index.html
IDE. KDoc
KT-32163Open Quick Documentation when cursor inside function / constructor brackets
IDE. Navigation
KT-32245Method in Kotlin class is not listed among implementing methodsKT-33510There is no gutter icon to navigate fromactualtoexpectifexpectand the correspondingactualdeclarations are in the same fileKT-38260Navigation bar doesn't show directories of files with a single top level Kotlin classKT-38466Top level functions/properties aren't shown in navigation panel
IDE. Project View
KT-36444Structure view: add ability to sort by visibilityKT-38276Structure view: support visibility filter for class properties
IDE. REPL
KT-38454Kotlin REPL in IntelliJ doesn't take module's JVM target setting into account
IDE. Refactorings
KT-12878"Change signature" forces line breaks after every parameter declarationKT-30128Change Signature should move lambda outside of parentheses if the arguments are reordered so that the lambda goes lastKT-35338Move/rename refactorings mess up code formatting by wrapping linesKT-38449Extract variable refactoring is broken by NPEKT-38543Copy can't work to package with escaped packageKT-38627Rename package refactorings mess up code formatting by wrapping lines
IDE. Run Configurations
KT-34516Don't suggest incompatible targets in a drop-down list for run test gutter icon in multiplatform projectsKT-38102DeprecatedMethodException ConfigurationFactory.getId
IDE. Scratch
KT-38455Kotlin scratch files don't take module's JVM target setting into account
IDE. Script
KT-39791Kotlin plugin loads VFS in the output directories
IDE. Structural Search
KT-39721Optimize Kotlin SSR by using the indexKT-39733Augmented assignment matchingKT-39769"When expressions" predefined template doesn't match all when expressions
IDE. Wizards
KT-38673New Project Wizard: multiplatform templates are generated having unsupported Gradle version in a wrapperKT-38810Incorrect order of build phases in Xcode project from new wizardKT-38952Remove old new_project_wizardsKT-39503New Project wizard 1.4+: release kotlinx.html version is added to dependencies with milestone IDE pluginKT-39700Wizard: group project templates on the first step by the project typeKT-39770CSS Support in Kotlin wizardsKT-39826Fix Android app in New Template WizardKT-39843Change imports in JS/browser wizard
JS. Tools
KT-32273Kotlin/JS console error on hot reloadKT-39498Update dukat version in toolchain near to release of 1.4-M3
JavaScript
KT-29916ImplementtypeOfon JSKT-35857Kotlin/JS CLI bundled to IDEA plugin can't compile using IR back-end out of the boxKT-36798KJS: prohibit using @JsExport on a non-top-level declarationKT-37771KJS: Generated TypeScript does not recursively export base classes (can fail with generics)KT-38113Review public API of JS stdlib for IR BEKT-38765[JS / IR] AssertionError: class EventEmitter: Super class should be any: with nested class extending parent classKT-38768KJS IR: generate ES2015 (aka ES6) classes
Libraries
New Features
KT-11253Function to sum long or other numeric property of items in a collectionKT-28933capitalize() with Locale argument in the JDK stdlibKT-34142Create SortedMap with Comparator and itemsKT-34506Add Sequence.flatMap overload that works on IterableKT-36894Support flatMapIndexed in the Collections APIKT-38480Introduce experimental annotation for enabling overload resolution by lambda resultKT-38708minOf/maxOf functions to return min/max value provided by selectorKT-39707Make some interfaces in stdlib functional
Performance Improvements
KT-23142toHashSet is suboptimal for inputs with a lot of duplicates
Fixes
KT-21266Add module-info for standard library artifactsKT-23322Document 'reduce' operation behavior on empty collectionsKT-28753Comparing floating point values in array/list operations 'contains', 'indexOf', 'lastIndexOf': IEEE 754 or total orderKT-30083Annotate KTypeProjection.STAR with JvmField in a compatible wayKT-30084Annotate functions in KTypeProjection.Companion with JvmStaticKT-31343Deprecate old String <-> CharArray, ByteArray conversion apiKT-34596Add some validation to KTypeProjection constructorKT-35978Review and remove experimental stdlib API status for 1.4KT-38388DocumentfromIndexandtoIndexparametersKT-38854Gradually change the return type of collection min/max functions to non-nullableKT-39023Document split(Pattern) extension differences from Pattern.splitKT-39064Introduce minOrNull and maxOrNull extension functions on collectionsKT-39235Lift experimental annotation from bit operationsKT-39237Lift experimental annotation from common StringBuilderKT-39238Appendable.appendRange - remove nullabilityKT-39239Lift experimental annotation from String <-> utf8 conversion apiKT-39244KJS: update polyfills, all or most of them must not be enumerableKT-39330Migrate declarations from kotlin.dom and kotlin.browser packages to kotlinx.*
Middle-end. IR
KT-31088need a way to compute fake overrides for pure IRKT-33207Kotlin/Native: KNPE during deserialization of an inner classKT-33267Kotlin/Native: Deserialization error for an "inner" extension property imported from a classKT-37255Make psi2ir aware of declarations provided by compiler plugins
Reflection
KT-22936Not all things can be changed tocreateTypeyet, and nowdefaultTypemethods are starting to failKT-32241Move KType.javaType into stdlib from reflectKT-34344KType.javaType implementation throws when invoked with a typeOf()KT-38491IllegalArgumentException when using callBy on function with inline class parameters and default argumentsKT-38881Add KClass.isFun modifier of functional interfaces to reflection
Tools. Android Extensions
KT-25807Kotlin extension annotation @parcelize in AIDL returns Object instead of original T
Tools. CLI
KT-30211Support a way to pass arguments to the underlying JVM in kotlinc batch scripts on WindowsKT-30778kotlin-compiler.jar contains shaded but not relocated kotlinx.coroutinesKT-38070Compiler option to bypass prerelease metadata incompatibility errorKT-38413Add JVM target bytecode version 14
Tools. Compiler Plugins
KT-39274[KJS / IR] Custom serializer for class without zero argument constructor doesn't compile
Tools. Gradle
KT-25428Kotlin Gradle Plugin: Use new Gradle API for Lazy tasksKT-34487Gradle build fails with "Cannot run program "java": error=7, Argument list too longKT-35957MPP IC fails with "X has several compatible actual declarations" errorKT-38250Drop support for Gradle versions older than 5.3 in the Kotlin Gradle plugin
Tools. Gradle. JS
New Features
KT-30619Support NPM transitive dependencies in multi-platform JS targetKT-38286[Gradle, JS] Error handling on Webpack problems
Fixes
KT-31669Gradle/JS: rise error when plugin loaded more than onceKT-32531[Gradle/JS] Add scoped NPM dependenciesKT-34832[Kotlin/JS] Failed build after webpack run (Karma not found)KT-35194Kotlin/JS: browserRun fails with "address already in use" when trying to connect to local serverKT-35611Kotlin Gradle plugin should reportkotlin2jsplugin ID as deprecatedKT-35641Kotlin Gradle plugin should reportkotlin-dce-jsplugin ID as deprecatedKT-36410JS: Collect stats about IR backend usageKT-36451KJS Adding npm dependency breaks Webpack devserver reloadingKT-37258Kotlin/JS + Gradle: in continuous mode kotlinNpmInstall time to time outputs "ENOENT: no such file or directory" errorKT-38109[Gradle, JS] Error handling on Karma launcher problemsKT-38331Add an ability to control generating externals for npm deps individuallyKT-38485[Gradle, JS] Unable to configure JS compiler with stringKT-38683Remove possibility to set NPM dependency without versionKT-38990Support multiple range versions for NPM dependenciesKT-38994Remove possibility to set NPM dependency with npm(org, name, version)KT-39109ArithmeticException: "/ by zero" caused by kotlinNodeJsSetup task with enabled gradle caching on WindowsKT-39210Kotlin/JS: with both JS and MPP modules in the same project Gradle configuration fails onnodejs {}andbrowser {}KT-39377Use standard source-map-loader instead of custom one
Tools. Gradle. Multiplatform
KT-39184Support publication of Kotlin-distributed libraries with Gradle MetadataKT-39304Gradle import errorjava.util.NoSuchElementException: Key source set foo is missing in the mapon unused source set
Tools. Gradle. Native
KT-37514CocoaPods Gradle plugin: Support building from terminal projects for several platformsKT-38440Make error message about missing Podfile path for cocoapods integration actionable for a userKT-38991Gradle MPP plugin: Enable parallel in-process execution for K/N compilerKT-39935Support overriding theKotlinNativeCompiletask sourcesKT-37512Cocoapods Gradle plugin: Improve error logging for external tools
Tools. J2K
KT-35169Do not show "Inline local variable" popup during "Cleaning up code" phase of J2KKT-38004J2K breaks java getter call in java codeKT-38450J2K should convert Java SAM interfaces to Kotlin fun interfaces
Tools. JPS
KT-27458The Kotlin standard library is not found in the module graph ... in a non-Kotlin project.KT-29552Project is completely rebuilt after each gradle sync.
Tools. Scripts
KT-37766Impossible to apply compiler plugins onto scripts with the new scripting API
Tools. kapt
KT-29355Provide access to default values for primary constructor properties
1.4-M2
Compiler
New Features
KT-37432Do not include annotations fields into 'visibility must be explicitly specified' check in api mode
Performance Improvements
KT-27362Anonymous classes representing function/property references contain rarely used methodsKT-35626NI: Performance problem with many type parametersKT-36047Compiler produces if-chain instead of switch when when subject captured as variableKT-36638Use 'java/lang/StringBuilder.append (C)Ljava/lang/StringBuilder;' when appending single character in JVM_IRKT-37389Avoid type approximation during generation constraints with EQUALITY kindKT-37392Avoid substitution and type approximation for simple callsKT-37546NI: high memory and CPU consumption due to creating useless captured types (storing in approximated types cache, unneeded computations)
Fixes
KT-11265Factory pattern and overload resolution ambiguityKT-27524Inline class is boxed when used with suspend modifierKT-27586ClassCastException occurs if the Result (or any other inline class) is returned from a lambdaKT-30419Use boxed version of an inline class in return type position for covariant and generic-specialized overridesKT-31163FIR: consider replacing comparisons with compareTo calls and some additional intrinsicsKT-31585ClassCastException with derived class delegated to generic class with inline class type argumentKT-31823NI: Type mismatch with a star projection andUnsafeVarianceKT-33119Pre-increment for inline class wrapping Int compiles to direct increment instead of inc-implKT-33715Kotlin/Native: metadata compilerKT-34048IllegalAccessError when initializing val property in EXACTLY_ONCE lambdaKT-34433NI: Type mismatch with a star projection andUnsafeVarianceKT-35133FIR Java: don't set 'isOperator' for methods with non-operator namesKT-35234ClassCastException with creating an inline class from a function reference of covariant or generic-specialized overrideKT-35406Generic type implicitly inferred as Nothing with no warningKT-35587Plain namespace strings in JvmNameResolver.PREDEFINED_STRINGS are prone to namespace changes during jar relocation.KT-36044NI: premature fixation a type variable if there were nested lambdas (constraint source was the deepest lambda)KT-36057[FIR] Incorrect smartcastKT-36069NI: TYPE_MISMATCH caused by incorrect inference to NothingKT-36125Callable reference resolution ambiguity error is not displayed properly in the IDEKT-36191IDE locks loading packages and editing file containingtrykeyword inside string templateKT-36222NI: Improve error message about nullability mismatch for a generic callKT-36249NI doesn't use upper bound for T of called function during infer return type and as a result infer it toAny?if the resulting type was intersection typeKT-36345FIR: record argument mapping for use in back-endKT-36446NI: "UnsupportedOperationException no descriptor for type constructor of IntegerLiteralType[Int,Long,Byte,Short]" with BuilderInference and delegateKT-36758[FIR] Unresolved callable reference to member of local classKT-36759[FIR] Unsupported callable reference resolution for methods with default parametersKT-36762[FIR] Unresolvedarray.clone()KT-36764[FIR] Bug in inference with DefinitelyNotNull typesKT-36816NI: definitely not-null (T!!) types in invariant positions don't approximate to T inside inference processKT-36819NI: premature completion of lambdas, which are passed somewhereKT-36850Incorrect private visibility of sealed class constructorsKT-36856Throwing exception when there is inheritance in Kotlin from Java class, which contains methods with the same JVM descriptorsKT-36879Introduce FIR_IDENTICAL in diagnostic testsKT-36881FIR: completion don't runs for return expressionsKT-36887[FIR] Unresolved member in nested lambda in initializerKT-36905[FIR] Unresolved in lambda in default argument positionKT-36953AssertionError: "Unsigned type expected: null" when there is a range with an unsigned typeKT-37009FIR: Bound smart-cast lostKT-37027FIR: Wrong projection on spread + varargs on non-final typesKT-37038NI: redundant lambda's arrow breaks CST calculation for extension lambdasKT-37043NI: inference T to Any? if there was elvis between Java out-type and reifiedmaterializefor this type without out projectionKT-37066[FIR] Wrong type inference for lambdasKT-37070[FIR] Unresolved parameters of outer lambda in scope of inner lambdaKT-37087"IllegalStateException: Can't find method 'invoke()'" for mutable property reference in default value of an inline function parameterKT-37091[FIR] Wrong inferred type of when-expression if when-argument is not-null-asserted and type is not specifies explicitlyKT-37176[FIR] Incorrect resolution mode for statements of blockKT-37302Unexpected conversion:Intconstant inferred toLongin when expressionKT-37327FIR: Smartcast problemKT-37343NI: definitely not null types pre-approximation is inconsistent with OIKT-37380NI: broken some code with def not null types due to skip needed constraintsKT-37419NI: UNRESOLVED_REFERENCE_WRONG_RECEIVER is reported in case lambda with receiver is returned fromwhenexpressionKT-37434Kotlin/JS, Kotlin/Native: fun interfaces: SAM conversion to Kotlin interface is not compiled with RESOLUTION_TO_CLASSIFIERKT-37447Expression from annotation entry in value parameter inside value parameter should be marked as USED_AS_EXPRESSIONKT-37453Type arguments not checked to be empty for candidates with no declared parametersKT-37488[FIR] Incorrect exhaustiveness checking for branches with equals to object that implements sealed classKT-37497NI: 'super' is not an expression, it can not be used as a receiver for extension functionsKT-37530NI: instantiation of abstract class via callable reference argument causes run time InstantiationErrorKT-37531NI: callable reference argument with left hand side type parameter causes frontend exceptionKT-37554NI: Nothing is inferred incorrectly with elvis returnKT-37579NI: inconsistent behaviour with OI around implicit invoke convention after safe call with additional implicit receiverKT-37604"VerifyError: Call to wrong method" in 'invoke' for adapted callable reference to constructor with coercion to UnitKT-37621NI: type variable is inferred to Nothing if the second branch was Nothing and there was upper bound for a type parameterKT-37626NI: builder inference with expected type breaks class references resolution for a class with parametersKT-37627NI: wrong order of the type variable fixation (Nothing? against a call with lambda)KT-37628NI: wrong approximation of type argument to star projection during common super type calculationKT-37644NI: appeared exception during incorporation of a captured type into a type variable for elvis resolveKT-37650NI: it's impossible to infer a type variable with the participation of a wrapped covariant typeKT-37718False positive unused parameter for @JvmStatic main function in objectKT-37779ClassCastException: Named argument without spread operator for vararg parameter causes code to crash on runtimeKT-37832In MPP, subtypes of types defined in legacy libraries, like stdlib, cannot properly resolve on the consumer side receviing bothKT-37861Capturing an outer class instance in a default parameter of inner class constructor causes VerifyErrorKT-37986Return value of function reference returning inline class mapped to 'java.lang.Object' is not boxed properlyKT-37998'!!' operator on safe call of function returning inline class value causes CCE at runtimeKT-38042Allow kotlin.Result as a return type only if one enabled inline classes explicitlyKT-38134NI: Type mismatch with a star projection andUnsafeVarianceKT-38298Inconsistent choice of candidate when both expect/actual are available (affects onlyenableGranularSourceSetMetadata)KT-38661NI: "Cannot infer type variable TypeVariable" with lambda with receiverKT-38668Project with module dependency in KN, build fails with Kotlin 1.3.71 and associated libs but passes with 1.3.61.KT-38857Class versions V1_5 or less must use F_NEW frames.KT-39113"AssertionError: Uninitialized value on stack" with EXACTLY_ONCE contract in non-inline function and lambda destructuring
Docs & Examples
KT-35231toMutableList documentation is vague
IDE
Performance Improvements
KT-30541EDT Freeze after new Kotlin Script creationKT-35050Significant freezes due to findSdkAcrossDependencies()KT-37301Freeze when "Optimize Imports" in KotlinImportOptimizerKT-37466Invalidate partialBodyResolveCache on OCBKT-37467PerFileAnalysisCache.fetchAnalysisResultsKT-37993Do not resolve references if paste code is located in the same originKT-38318Freezes in IDEA
Fixes
KT-27935Functional typealias with typealias in type parameters causes UnsupportedOperationException in TypeSignatureMappingKt (IDEA analysis)KT-31668Complete statement for class declaration: add '()' to supertypeKT-33473UAST: References to local variable are resolved to UastKotlinPsiVariableKT-34564Kotlin USimpleNameReferenceExpression for annotation parameter resolves to null for compiled Kotlin classesKT-34973Light class incorrectly claiming ambiguous method call from Java when one overload is syntheticKT-35801UAST: UnknownKotlinExpression for valid Kotlin annotated expressionKT-35804UAST: Annotations missing from catch clause parametersKT-35848UAST: ClassCastException when trying to invoke UElement for some wrapped PsiElementsKT-36156Kotlin annotation attributes have blue color whereas white in JavaKT-36275UAST: UCallExpression::resolve returns null for local function callsKT-36717Fix failing light class tests after switching plugin to language version 1.4KT-36877Message bundles for copy paste are missed in 201KT-36907IDE:-Xuse-irsetting on facet level does not affect highlightingKT-37133UAST: Annotating assignment expression sometimes leads to UnknownKotlinExpressionKT-37312"Implement members" intention put function in the primary constructor if there are unused brackets in classKT-37613Uast: no parameters in reified methodKT-37933Rare NPE in ProjectRootsUtilKt.isKotlinBinary [easy fix]KT-38081Configure kotlin in project produces IDE error "heavy operation and should not be call on AWT thread"KT-38354HMPP. IDE. Dependency leakage from leaf native to shared native moduleKT-38634IDE: Error on opening MPP project in 1.3.72 after opening it in 1.4-M2
IDE. Code Style, Formatting
KT-37870"Remove trailing comma" action stops working after applying and cancelling it
IDE. Completion
KT-36808Delete Flow.collect from autocompletion list or make it least prioritizedKT-36860Provide convenient completion of extension functions from objectsKT-37395Invalid callable reference completion of member extension
IDE. Debugger
KT-34906Implement Coroutine DebuggerKT-35392Debugger omits meaningful part of the stacktrace even with disabled filterKT-36215Coroutines debugger tab is empty in Android StudioKT-37238Coroutines Debugger: dump creation fails every timeKT-38047Coroutines Debugger: Assertion failed: “Should be invoked in manager thread, use DebuggerManagerThreadImpl” on moving to source code from suspended coroutine in project without debugger jar in classpathKT-38049Coroutines Debugger: NPE “null cannot be cast to non-null type com.sun.jdi.ObjectReference” is thrown by calling dumpCoroutinesKT-38487Any Field Watch interaction causes a MissingResourceException
IDE. Decompiler, Indexing, Stubs
KT-37896IAE: "Argument for @NotNull parameter 'file' of IndexTodoCacheManagerImpl.getTodoCount must not be null" through KotlinTodoSearcher.processQuery()
IDE. Gradle Integration
KT-33809Withkotlin.mpp.enableGranularSourceSetsMetadata=true, IDE misses dependsOn-relation between kotlin and android sourceSets, leading to issues with expect/actual matchingKT-36354IDE: Gradle import from non-JVM projects: dependency to output artifact is created instead of module dependencyKT-38037UnsupportedOperationException on sync gradle Kotlin project with at least two multiplatform modules
IDE. Gradle. Script
KT-36763Drop modification stamp for scripts after project importKT-37237Script configurations should be loaded during project import in case of errorsKT-38041Do not request for script configuration after VCS update
IDE. Inspections and Intentions
New Features
KT-3262Inspection "Inner class could be nested"KT-15723Add 'Convert to value' quickfix for property containing only getterKT-34026Add "Remove argument" quick fix for redundant argument in constructor callKT-34332Add "Remove argument" quick fix for redundant argument in function callKT-34450Convert function to propertyintention should be also displayed onfunkeywordKT-34593Invert 'if' condition: InvertString.isNotEmptyshould beString.isEmptyKT-34819Inspection: report useless elvis "?: return null"KT-37849SupportReplaceWithfor supertypes call
Performance Improvements
KT-37515Deadlock
Fixes
KT-12329"invert if" inserts unnecessary 'continue' for statement inside a loop with 'continue'KT-17615"Convert parameter to receiver" changesthistothis@ < no name provided >KT-20868IntelliJ says method from anonymous inner class with inferred interface type is not used even though it isKT-20907Secondary constructor is marked as unused by IDE when called by typealiasKT-22368"Convert to block body" intention incorrectly formats closing braceKT-23510"Remove parameter" quick fix keeps lambda argument when it's out of parenthesesKT-27601False positive "Unused import directive" for extension function used in KDocKT-28085"Convert receiver to parameter" introduces incorrect this@class in lambdaKT-30028"Convert parameter to receiver" introduces wrong 'this' qualifier for extension lambda receiverKT-31601"Remove redundant let call" changes semantics by introducing multiple safe callsKT-31800False positive "never used" with function in private val object expressionKT-31912QF “Convert to anonymous object” do nothing on SAM-interfacesKT-32561"Property can be declared in constructor" causes another warningKT-32809Convert parameter to receiver inserts wrong qualifiers for this (when nothing needs to be changed)KT-34371"Surround with lambda" quickfix is not available for suspend lambda parameters.KT-34640Replace 'if' with 'when' leads to copy comment line above when from another ifKT-36225KNPE: CodeInliner.processTypeParameterUsages withReplaceWithfor inline reified generic functionKT-36266NPE when invoking Lift return out of if/when after intention becomes inapplicable but still beeing shownKT-36296False negative "Redundant SAM-constructor" with multiple SAM argumentsKT-36367False negative "Redundant SAM-constructor" for kotlin functionsKT-36368False negative "Redundant SAM-constructor" for fun interfaces in kotlinKT-36395False positive "Redundant SAM-constructor" with two java interfaces extending one anotherKT-36411"Put parameters on separate lines" and "Put parameters on one line" actions do not respect trailing commaKT-36482"Add JvmOverloads annotation" intention is still suggested for annotation's parametersKT-36686Implement members quickfix puts the implementation before the data class if it already has a bodyKT-36685"Convert to a range check" transform hex range to int if it is compared with "Less" or "Greater"KT-36707False positive redundant companion object on calling companion object membersKT-36735Inspection 'Replace 'toString' with string template' miss curly braces and generates wrong code for constructor callsKT-36834Convert use-site targets and usages with convert property to fun intentionKT-37213"Move to top level" intention does not update imports for extension functionsKT-37496False positive "Remove redundant backticks" for multiple underscores variable nameKT-37502False positive "redundant lambda arrow" with inline generic function with reified type in object and anonymous parameter nameKT-37508"Convert receiver to parameter" breaks code in anonymous objects (this@ < no name provided >)KT-37576Kotlin InspectionSuppressor not being called for the kotlin's inspectionsKT-37749"Convert to anonymous object" intention is suggested for Java SAM conversion, but not for KotlinKT-37781"Add modifier" intention/quickfix works incorrectly with functional interfacesKT-37893i18n: Incorrect quickfix name "Lift return out of '"
IDE. KDoc
KT-37361Support for showing rendered doc comments in editor
IDE. Libraries
KT-36276IDE: references to declarations in JavaScript KLib dependency are unresolvedKT-37562IDE: references to JavaScript KLib dependency are unresolved, when project and library are compiled with "both" mode
IDE. Navigation
KT-18472UI lockup on find usagesKT-18619Find Usages of element used via import alias does not show actual usage locationKT-34088Navigate | Implementations action doesn't show implementations of Java methods in Kotlin files if method has parameters referring to generic typeKT-35006IDE: "Navigate to inline function call site" from stack trace for nested inline call navigates to outer inline callKT-36138628 second freeze when doing Find Usages on data class propertyKT-36218Show Kotlin file members in navigation barKT-37494AnnotatedElementsSearch unable to find annotated property accessor
IDE. Project View
KT-32886Project tool window: Show Visibility Icons does nothing for Kotlin classesKT-37632IDE error on project structure opening
IDE. Refactorings
Performance Improvements
KT-37801Renaming private property with common name is very slow
Fixes
KT-22733Refactor / Inline Function: fun with type parameter: KNPE at CodeInliner.processTypeParameterUsages()KT-27389MPP: Refactoring "Move Class" does not change the package declarationKT-29870Inline variable doesn't handle 'when' subject val correctlyKT-33045Cover Move Refactoring by statistics (FUS)KT-36071Refactoring: Move top declaration implementation refactoringKT-36072Empty files are removed on Refactor/Move action with turned off "Delete empty source files" optionKT-36114java.lang.NoClassDefFoundError exception on Refactor/Move of kotlin function if it is referenced in javaKT-36129java.lang.Throwable: Invalid file exception occurs on Refactor/Move of class from kotlin scriptKT-36382Move file refactoring breaks ktor application configKT-36504"Extract property" suggests potentially invalid name for new propertyKT-37637KotlinChangeSignatureUsageProcessor broke Change Signature in Python pluginKT-37797Useless "Value for new paramater" step in 'Update usages to reflect signature changes' for method with default parameter valueKT-37822Improve message "Inline all references and remove the kind"KT-38348UL methods return signature without generic type parametersKT-38527Move nested class to upper level fails silently: MissingResourceException
IDE. Script
KT-37765NCDFE KJvmCompiledModuleInMemory on running*.main.ktsscript
IDE. Tests Support
KT-36716Withkotlin.gradle.testing.enabled=true, gradle console output gets extra ijLog messagesKT-36910There are no Run/Debug actions in context menu for non-JVM platform-specific test resultsKT-37037[JS, Debug] Node.JS test debug doesn't stop on breakpoints
IDE. Wizards
New Features
KT-36150New Project Wizard: provide a way to connect with "dependsOn" relation the added project modulesKT-36179New Project Wizard: it's impossible to make a JVM target friendly to Java code in a multiplatform project
Fixes
KT-35583New Project wizard: don't suggest build systems which cannot be usedKT-35585New Project wizard: remember choices which have sense for many projectsKT-35691New Project wizard: artifact and group values are effectively ignoredKT-35693New Project wizard creates pom.xml / build.gradle referring to release Kotlin version onlyKT-36136New Project Wizard: generated projects are missing m2 Gradle repositoryKT-36137New Project Wizard: "multiplatform" shall be written as a single word, without the capital P in the middleKT-36155New Project Wizard: show warning "Multiplatform project cannot be generated" only for MPP projectsKT-36162New Project Wizard: make the error messages in modules editor actionableKT-36163New Project Wizard: remove trailing spaces in Android SDK Path automaticallyKT-36166New Project Wizard: addition of Android target into a multiplatform project doesn't add a necessary minimal Android configurationKT-36169New Project Wizard: Android-related projects failed to buildKT-36176New Project Wizard: module templates doesn't work for multiplatform projectsKT-36177New Project Wizard: it's impossible to add more than one target of JVM kind to a multiplatform projectKT-36180New Project Wizard: it's impossible to set target JVM version for a JVM moduleKT-36226New Project Wizard: add Mobile Android/iOS project templateKT-36267New Project Wizard: flatten JVM targets list for multiplatform projectsKT-36328New Project wizard fails for certain templates with AE: "Wrong line separators" at KotlinFormattingModelBuilder.createModel()KT-37599New Project Wizard: Open Kotlin Wizard via hyperlinkKT-37667New project wizard: implement new UI designKT-37674Kotlin version in build files includes the IDEA versionKT-38061New Project wizard 1.4: do not allow choosing build system if corresponding IJ plugin is disabledKT-38567New Project wizard 1.4+: Improve processing case when project with required path already existsKT-38579New Project wizard 1.4+: multiplatform mobile application: build fails on lint task: Configuration with name 'compileClasspath' not foundKT-38929New project wizard: update libraries in project template according to kotlin IDE plugin versionKT-38417Enable new project wizard by-default
JS. Tools
KT-36484KotlinJS, MPP: Compilation throws "TypeError: b is not a function" only in production mode
JavaScript
KT-31126Invalid JS constructor call (primary ordinary -> secondary external)KT-35966Make @JsExport annotation usable in common codeKT-37128KJS: StackOverflowException when using reified recursive bound for type parameterKT-37163KJS: NullPointerException on using intersection type as a reified oneKT-37418SupportAssociatedObjectKeyandfindAssociatedObjectin JS IR BE
Libraries
New Features
KT-8658Add property delegates which call get/set on the given KProperty instance, e.g. a property referenceKT-12448Make@Suppressapplicable for type parametersKT-22932String.format should support null localeKT-23514assertFailsWith should link unexpected exception as causeKT-23737JS & MPP: Support exception cause and addSuppressedKT-25651Add shuffle() to Array, ByteArray, IntArray, etc to match MutableListKT-26494Create an interface with provideDelegate()KT-27729InheritReadWritePropertyfromReadOnlyPropertyKT-28290Add the onEach extension function to the ArrayKT-29182SIZE_BYTES/BITS for Float and DoubleKT-30372Add associateWith to ArrayKT-33906Add vararg overloads for maxOf/minOf functionsKT-34161Array.contentEquals/contentHashCode/contentToString should allow null array receiver and argumentKT-35851Add setOfNotNull functionKT-36866reduceIndexedOrNullKT-36955stdlib: Reverse range and sortDescending rangeKT-37161Add #onEachIndexed similar to #forEachIndexedKT-37603Throwable.stackTraceToString: string with detailed information about exceptionKT-37751Implement shuffled() method SequencesKT-37804Add 'fail' in kotlin-test that allows to specify causeKT-37839StringBuilder.appendLine in stdlib-commonKT-37910Support Media Source Extension (MSE) and Encrypted Media Extensions (EME) in Kotlin/JsKT-38044Common Throwable.printStackTrace
Performance Improvements
KT-37416readLine() is very slow
Fixes
KT-13887Double/Float companion values such as NaN should be constantsKT-14119String.toBoolean()should beString?.toBoolean()KT-16529Names of KProperty's type parameters are inconsistent with ReadOnlyProperty/ReadWritePropertyKT-36356Specify which element Iterable.distinctBy(selector) retainsKT-38060runningFold and runningReduce instead of scanReduce
Reflection
KT-29969Support optional vararg parameter inKCallable.callByKT-37707"IllegalStateException: superInterface.classLoader must not be null" on class, which implements "AutoCloaseable" interface, "isAccessible" property changing
Tools. CLI
KT-37090file does not exist:C:\Users\NK\DOWNLO~1\kotlin-compiler-1.3.61\kotlinc\bin\..\lib\kotlin-compiler.jar" from standalone compiler on Windows
Tools. Gradle
KT-35447Warnings should be piped to stderr when using allWarningsAsErrors = trueKT-35942User test Gradle source set code cannot reach out internal members from the production codeKT-36019Implement Gradle DSL for explicit API mode
Tools. Gradle. JS
New Features
KT-32017Kotlin/JS in MPP: support changing the generated JS file name in Gradle DSLKT-32721[Gradle, JS] CSS Support for browserKT-36843[Gradle, JS, IR] Configure JS Compiler Type through DSLKT-37207Allow to use npm dependency from a local directoryKT-38056[Gradle, JS] Group tasks by browser and node
Fixes
KT-32466kotlinNpmResolve fails in the case of composite buildKT-34468Consider custom versions while parsing yarn.lockKT-36489[Gradle, JS, IR]: Correct naming for both compilersKT-36784Kotlin. JS. MPP – Cannot find project :js when using Gradle composite buildsKT-36864KJS. Composite build require JS plugin in root projectKT-37240KJS. Nondeterministic execution order for webpack scripts (from folder 'webpack.config.d')KT-37582Kotlin/JS: KotlinWebpack non-nullable properties are shown as nullable in Gradle configurationKT-37587KJS. Karma ignore dynamically created webpack patchesKT-37635[Gradle, JS] Webpack devtool provide enum for only 2 variantsKT-37636[Gradle, JS] Extract package.json from klibKT-37762[Gradle, JS] Actualize Node and Yarn versions in 1.4KT-37988[Gradle, JS] Bump NPM versions on 1.4-M2KT-38051[Gradle, JS] browserDistribution doesn't provide outputsKT-38519JS Compiler per project without additional import
Tools. Gradle. Multiplatform
KT-36674allMetadataJartask fails if there is an empty intermediate source set in a multiplatform project with native targetsKT-38746In HMPP, compilation of a shared-native source set could be mistakenly disabledKT-39094Provide a way to pass custom JVM args to commonizer from Gradle
Tools. Gradle. Native
KT-25887Kotlin Native gradle build fail withendorsed is not supported. Endorsed standards and standalone APIson jdk > 8 & CLionKT-36721Deduce a fully qualified unique_name in klib manifest from something like group nameKT-37730Native part of multiplatform build fails with "unresolved reference" errors if there is a local and external module with the same nameKT-38174Kotlin/Native: Disable platform libraries generation at the user side by default
Tools. J2K
Fixes
KT-34965Convert function reference copied from function callKT-35593New J2K: method's names don't change between functions declared in Number.java and Number.ktKT-35897J2K converts private enum constructors to internal constructors and produces NON_PRIVATE_CONSTRUCTOR_IN_ENUM errorKT-36088J2K: StackOverflowError when trying to convert Java class with recursive type boundKT-36149J2K: PsiInvalidElementAccessException: Element class com.intellij.psi.impl.source.tree.CompositeElement of type DOT_QUALIFIED_EXPRESSIONKT-36152J2K: RuntimeException: Couldn't get containingKtFile for ktElementKT-36159J2K: ClassCastException if constructor contains a super() call and class extends from Kotlin classKT-36190J2K: Wrong property name generation when getter for non-boolean value starts with 'is'KT-36891j2k: Fail with java.lang.NoClassDefFoundError when converting arrayKT-37052new J2K: Java private function is converted toprivate opentop-level functionKT-37620new J2K: IndexOutOfBoundsException (DefaultArgumentsConversion.applyToElement) with overloaded function with vararg parameterKT-37919new J2K: Redundant line feeds when converting function
Tools. JPS
KT-37159A Typo (forgotten space) in build output in Circular dependencies warning description
Tools. Scripts
KT-30086ThreadDeath when running kotlin scripts using jsr223KT-37558Scripts: implicit receivers don't work correctly when using CompiledScriptJarsCacheKT-37823Consecutive invocations of main.kts throw a KotlinReflectionNotSupportedError
1.4-M1
Compiler
New Features
KT-4240Type inference possible improvements: analyze lambda with expected type from the outer callKT-7304Smart-casts and generic calls with multiple bounds on type parametersKT-7745Support named arguments in their own position even if the result appears as mixedKT-7770SAM for Kotlin classesKT-8834Support function references with default values as other function typesKT-10930Expected type isn't taken into account for delegated propertiesKT-11723Support coercion to Unit in callable reference resolutionKT-14416Support of @PolymorphicSignature in Kotlin compilerKT-16873Support COERSION_TO_UNIT for suspend lambdasKT-17643Inferring type of Pair based on known Map typeKT-19869Support function references to functions with vararg if expected type ends with repeated vararg element typeKT-21178Prohibit access of protected members inside public inline membersKT-21368Improve type inferenceKT-25866Iterable.forEach does not accept functions that return non-Unit valuesKT-26165Support VarHandle in JVM codegenKT-27582Allow contracts on final non-override membersKT-28298Allow references to generic (reified) type parameters in contractsKT-31230Refine rules for allowed Array-based class literals on different platforms: allowArray::classeverywhere, disallowArray<...>::classon non-JVMKT-31244Choose Java field during overload resolution with a pure Kotlin propertyKT-31734Empty parameter list required on Annotations of function typesKT-33990Type argument isn't checked during resolution partKT-33413Allow 'break' and 'continue' in 'when' statement to point to innermost surrounding loopKT-34743Support trailing comma in the compilerKT-34847Lift restrictions fromkotlin.Result
Fixes
KT-2869Incorrect resolve with 'unsafe call error' and genericsKT-3630Extension property (generic function type) does not workKT-3668Infer type parameters for extension 'get' in delegated propertyKT-3850Receiver check fails when type parameter has another parameter as a boundKT-3884Generic candidate with contradiction is preferred over matching global functionKT-4625Poor error highlighting when assigning not matched type to index operatorKT-5449Wrong resolve when functions differ only in the nullability of generic typeKT-5606"Type mismatch" in Java constructor call with SAM lambda andvarargparameterKT-6005Type inference problem in sam constructorsKT-6591Overloaded generic extension function call with null argument resolved incorrectlyKT-6812Type inference fails when passing a null instead of a generic typeKT-7298Bogus type inference error in generic method call translated from JavaKT-7301Type inference error in Kotlin code translated from JavaKT-7333Type inference fails with star-projections in code translated from JavaKT-7363Kotlin code with star-projections translated from Java does not typecheckKT-73783-dimension array type inference failKT-7410Call resolution error appears only after adding non-applicable overloadKT-7420Type inference sometimes infers less specific type than in JavaKT-7758Type of lambda can't be inferedKT-8218Wrong 'equals' for generic types with platform type and error typeKT-8265Non-typesafe program is compiled without errorsKT-8637Useless diagnostics for type parameters with unsafe nullabilityKT-8966Smart casts don't work with implicit receiver and extension on type parameter with boundsKT-10265Type inference problem when using sealed class and interfacesKT-10364Call completeCall on variable before invoke resolutionKT-10612java.util.Comparator.comparing type inferenceKT-10628Wrong type mismatch with star projection of inner class inside use-site projected typeKT-10662Smartcast with not-null assertionKT-10681Explicit type arguments not taken into account when determining applicable overloads of a generic functionKT-10755Not "least" common super-type is selected for nested 'if' result in presence of multiple inheritanceKT-10929Type inference based on receiver type doesn't work for delegated properties in some casesKT-10962Wrong resolution when argument has unstable DataFlowValueKT-11108RxJava failed platform type inferenceKT-11137Java synthetic property does not function for a type with projectionKT-11144UninferredParameterTypeConstructor exception during buildKT-11184Type inference failed for combination of safe-call, elvis, HashSet and emptySetKT-11218Type inference incorrectly infers nullable type for t...