Kotlin v1.4.20-M1 has been released.
Info about particular features
New project templates in Kotlin/JS:
KT-41417 - Add react template to new project wizard
KT-40527 - Node.JS application template in New Project Wizard
KT-35549 - Support kotlin-android-extensions in JVM IR backend (for use with Jetpack Compose projects)
Kotlin/JS Gradle plugin upgrades:
Performance boosts:
Changelog
Backend. Native
KT-27534 Bridges to Nothing-returning methods have incorrect signature
KT-30284 Native: Nothing? type for expression override and crash
KT-36430 Optimize when with in range cases
KT-38787 Missing optimization for “in range” check
KT-39100 Make Native behaviour of property initialization consistent with JVM
KT-39798 Override equals/hashCode in functional interface wrappers on Native
KT-39800 equals/hashCode on adapted function references on Native
KT-41394 Compilation failed: Backend Internal error: Exception during IR lowering
KT-41907 Framework test segfaults on GC on watchos_x86 compiled with -opt
Compiler
New Features
KT-35549 Support kotlin-android-extensions in JVM IR backend (for use with Jetpack Compose projects)
Performance Improvements
KT-20571 Coroutines: Reduce number of local variables stored at suspension point
KT-28016 Coroutine state-machines spill/unspill shall be optimized using data-flow analysis
KT-33394 UI freezes triggered by QualifiedExpressionResolver.resolveToPackageOrClassPrefix
KT-36814 Support optimized delegated properties in JVM_IR
KT-36829 Optimize ‘in’ expressions (operator fun contains) in JVM_IR
Fixes
KT-16222 Coroutine should be clearing any internal state as soon as possible to avoid memory leaks
KT-25519 Extra inline marks inside suspending function callable reference bytecode
KT-33226 Object INSTANCE field not annotated with NotNull in generated bytecode
KT-35495 FIR: forbid non-Java synthetic properties
KT-35651 Kotlin stdlib has greater resolution priority than jars added via @file :DependsOn annotation
KT-35730 FIR: consider creating fake overrides for objects
KT-36951 IllegalStateException: Expected some types: Throwing exception when there is a type parameter upper bound for itself
KT-37321 [FIR] Support java array in type argument
KT-37431 [FIR] Support Builder Inference
KT-38272 FIR2IR: use lazy IR symbols for externals & fake overrides
KT-38333 FIR: CCE on red code with assignment used as expression
KT-38334 FIR: CCE when resolving try-as-expression
KT-38336 FIR: NPE with corrupted numeric constant literal
KT-38397 FIR: Exception while resolving contract definition
KT-38444 [FIR] Invoke extension lambda with safe call
KT-38470 FIR: ConeDefinitelyNotNullType in signature
KT-38471 FIR: ConeIntersectionType in signature
KT-38925 Internal error: wrong bytecode generated. (AssertionError: int type expected, but null was found in basic frames)
KT-38989 FIR: Refine sealed classes exhaustiveness in case of sealed subclass
KT-38992 FIR: Refine type resolution for inner classes
KT-39000 FIR: Support smartcast after reference equality check
KT-39005 FIR: Resolve plusAssign in a dependent context
KT-39008 FIR: Investigate strange effect of type alias and not-nullable bound on inference
KT-39012 FIR: Inference doesn’t get through elvis to lambda parameter
KT-39028 FIR: Strange resolution to synthetic property with implicit extension receiver while there’s an explicit receiver
KT-39032 FIR: Ambiguity in member scope of a type parameter with multiple bounds
KT-39033 FIR: Ambiguity when calling generic overridden property
KT-39034 FIR: Support nested extension function types
KT-39040 FIR: Deserialize annotations from compiled Kotlin binaries
KT-39043 FIR: Bare types incorrectly work with type aliases
KT-39044 FIR: Add fillInStackTrace to member scope of kotlin.Throwable
KT-39046 FIR: Implicit types in lambdas left when call argument is a type cast
KT-39048 FIR: Inference fails with integer literal used as Comparable
KT-39050 FIR: Type resolver doesn’t see nested classes from super class of a local class
KT-39070 FIR: Ambiguity on super calls to hashCode/equals when having super interface and class
KT-39072 FIR: Subtyping check doesn’t affect nullability of safe-call receiver
KT-39076 FIR: Synthetic property is not a var because of @Nullable annotation on parameter
KT-39080 FIR: Smart casts remain incorrect if lambda is present in when branch
KT-39374 Wrong bytecode generated for suspend function call with EXACTLY_ONCE lambda capturing a variable initialized in when-subject
KT-39621 [FIR] Support when exhaustiveness checker for java enums
KT-40135 JVM IR does not generate restricted suspend lambdas
KT-40382 Missing proper jvmSignature for synthesized equals/hashCode/toString in inline classes
KT-40605 JVM IR: IndexOutOfBoundsException caused by inner class passed to generic outer class method with Nothing type argument
KT-40664 JVM: No bounds check in optimization of ULong in UInt..UInt
KT-40665 JVM: No resolved function check when optimizing in/contains with mismatched bound types
KT-41014 FIR2IR: when/where/how to determine the presence of a backing field for a property
KT-41018 FIR2IR: sort members during de/serialization
KT-41144 False positive “Redundant spread operator” in when statement and generic vararg argument
KT-41374 JVM / IR: NoSuchMethodError in Android project compiler caused by combination of inline classes and coroutines
KT-41388 NI: Backend Internal error: Exception during IR lowering
KT-41429 Inline class returned from suspend function should be boxed on resume path
KT-41465 JVM / IR: “AssertionError: inconsistent parent function for CLASS LAMBDA_IMPL CLASS name” caused by inline method call into multiple constructors
KT-41668 JVM IR: incorrect enclosing constructor for lambdas in initializers of inner classes
KT-41669 JVM IR: incorrect hashCode intrinsic is used in JVM target 1.8 for generic type substituted with primitive
KT-41693 NI: Type inference in nested expression incorrectly assumes non-nullable return type of Java function, causing NullPointerException
KT-41729 NI: UnsupportedOperationException with invalid callable reference
KT-41761 JVM IR: CCE from backend on generating typeOf for non-reified type parameter with star projection in upper bound
KT-41789 Missing DebugMetadata in inlined suspend lambda
KT-41913 NI: Kotlin 1.4 type inference breaks valid code
KT-41934 NI: a type variable for lambda parameter has been inferred to nullable type instead of not null one
IDE
New Features
KT-20775 More kotlin kinds in new kotlin file/class menu
KT-31331 Improve: Optimize Import should remove unused unresolved imports
KT-31500 Smart enter: support get() clause
KT-39231 Injection: Add receiver of kotlin.text.toPattern to standard Kotlin injections
KT-39844 Add specific highlight for Enum class
Performance Improvements
KT-39353 Implement EnterBetweenBracesNoCommitDelegate
KT-39720 A lot of freezes in Kotlin project
KT-41634 Deadlock in org.jetbrains.kotlin.idea.framework.LibraryEffectiveKindProviderImpl.getEffectiveKind
KT-41936 Impossible to work with Kotlin 1.4 in 202 idea, idea eats all cpu
Fixes
KT-10790 “Move statement up” for @file-targeted annotation moves package declaration to bottom of file
KT-15262 “Generate toString()” is ignoring property if it has a getter
KT-24352 Method separators: displayed between properties, not displayed between companion object and function
KT-29364 “Extend selection” can’t select lambda body with parameters
KT-32403 Clickable links in annotation parameters (like in TODOs)
KT-32409 Organizing imports should not remove imports while there are unresolved symbols
KT-33131 No indent before get/set method while editing extension var declaration
KT-34566 Too small indent after line break for multi line strings
KT-34587 “Move statement down” doesn’t work for statement in constructor with end-of-line comment
KT-34705 “Move statement down” for penultimate statement with end-of-line comment in constructor leads to moving comma to the end of comment
KT-34707 “Move statement up” for last statement with end-of-line comment in constructor leads to moving comma to the end of comment
KT-35424 FIR IDE: Kotlin project does not see stdlib
KT-35732 URLs in String literals are not clickable
KT-35859 Language injection doesn’t work with named arguments in different position
KT-37210 UAST: KtLightClassForSourceDeclaration.isInheritor sometimes returns the wrong result
KT-37219 File level OptIn annotation is not recognized by the IDE
KT-39398 Wrong import of unrelated object member is suggested for receiver
KT-39457 Separate decompiled declarations Light implementation from LightClasses infrastructure
KT-39899 KotlinOptimizeImportsRefactoringHelper: ISE: Attempt to modify PSI for non-committed Document
KT-40578 UAST: write accesses to Kotlin properties should resolve to setter
KT-41290 KotlinClassViaConstructorUSimpleReferenceExpression resolves to PsiMethod instead of PsiClass
KT-42029 HMPP, IDE: NPE from FacetSerializationKt.getFacetPlatformByConfigurationElement on project opening
IDE. Completion
KT-26235 Kotlin methods/fields don’t have icons in Java completion
IDE. Debugger
KT-39309 Debugger: Prolonged “Collecting data” for variables when breakpoint is inside respondHtml
KT-39435 “Collecting data…” in debugger variables view never finishes
KT-39717 Debugger shows “Collecting data…” forever for instances of some class
KT-40386 Memory leak detected: ‘org.jetbrains.kotlin.idea.debugger.coroutine.view.XCoroutineView’
KT-41505 Coroutines Debugger: “Access is allowed from event dispatch thread with IW lock only.”
IDE. Gradle Integration
KT-34271 Support pureKotlinSourceFolders for MPP projects
KT-37106 Gradle + IDE integration: on creating source roots from Project tree IDEA creates incorrect settings
IDE. Gradle. Script
KT-35092 “Unable to get Gradle home directory” popup and no build.gradle.kts highlighting right after creating a new project
KT-37590 Wrong notification for precompiled build script
KT-39523 Go to Declaration navigates to decompiled classfile instead of sources in case of jumping to Gradle plugin sources in buildSrc
KT-39790 List of standalone script should be saved between IDE restarts
KT-39910 build.gradle.kts isn’t highlighted after import
KT-39916 init.gradle.kts isn’t highlighted
KT-40243 gradle.kts: standalone script under build root isn’t highlighted as standalone
KT-41281 Multiple Script Definitions warning shown in git project having multiple Gradle projects
IDE. Hints
KT-32368 Rework Inline hints settings so that they look appropriate with the new UI in 2019.3
KT-38027 Support Code Vision feature in Kotlin
IDE. Hints. Parameter Info
KT-24172 Parameter info marks signature as inapplicable when using argument labels
KT-41617 Parameter Info shows nothing inside already present type arguments of supertype
KT-41645 Add support for mixed named arguments to parameter info popup
IDE. Inspections and Intentions
New Features
KT-14578 Suggest “Convert lambda to reference” intention for generic extension function
KT-19321 Warn if method with nullable return type always returns non-null
KT-20718 Add a quick fix for “this class has no constructor” error on ‘expect’ annotation classes
KT-21223 Add inspection for incomplete destructuring
KT-22420 Intention to replace a = b with b.also { a = it }
KT-39930 Add inspection for nullable Boolean in if condition
KT-40016 Replace ‘a.toLowerCase() == b.toLowerCase()’ with ‘a.equals(b, ignoreCase = true)’ inspection
KT-40283 Inspection which replaces also/apply with nested forEach to onEach
KT-40769 Add intention to replace isBlank/isNotBlank method negation
Fixes
KT-12222 Intention ‘Convert to block body’ should take nullability of overriden method into account when expression is of platform type
KT-14395 Lambda to Reference doesn’t work for generic types
KT-15846 ‘Change lambda expression return type’ quick fix does nothing
KT-15944 IDEA doesn’t suggest to replace deprecated get set operator functions when it used as operator
KT-17222 “Convert reference to lambda” creates red code for method with default argument values
KT-18125 “Wrap with let {…}” intention not available in all cases
KT-20438 Naming convention inspections: factory functions that are named like classes are flagged
KT-24138 Incorrect behavior in “convert reference to lambda” with new inference enabled, on function reference with default arguments
KT-29844 “Create class from usage” should mark constructor of created class as internal if its parameters have internal visibility
KT-30928 “Show hints for suspend calls” is too easy to enable and hard to disable
KT-31749 “Surround with null check” produces incorrect check for ‘in’ expression
KT-32963 Don’t suggest java directory of a JVM source set in multiplatform project as a target for Create actual quick fix
KT-33211 Quickfix “add parameter” for method references should infer functional type instead of KFunction
KT-33258 “Merge 'if’s” intention drops comment before nested if
KT-34572 Convert to block body action improperly works with suppress annotations
KT-35128 Intention Convert member to extension hides property delegate text with single line comment
KT-35214 Intention Put parameters on one line: don’t suggest if parameters has end-of-line comments
KT-35320 False positive “Replace explicit parameter ‘x’ with ‘it’” in ‘when’ expression which returns lambda
KT-35525 False positive intention for ‘run’: “Convert to ‘let’” when invoked without receiver
KT-35526 Intention “Eliminate argument of ‘when’” is broken for ‘when’ expression without ‘else’ branch
KT-35805 FoldInitializerAndIfToElvis: should not add new line for multiline initializer
KT-36051 IfThenToSafeAccessInspection: do not report if condition is SENSELESS_COMPARISON
KT-37748 “Convert anonymous function to lambda expression” intention does not add necessary lambda type parameter
KT-37841 IllegalStateException after “add non-null asserted call” on nullable function reference
KT-38139 False negative “Add suspend modifier” quickfix when suspend function is called in inline lambda
KT-38267 False positive “Call on collection type may be reduced” with Java platform types: suggested to reduce ‘mapNotNull’ call to ‘map’
KT-38282 False positive “Remove redundant spread operator” inspection with array as class property or fun argument
KT-39200 False positive “Redundant qualifier name” with same-named member object and companion property
KT-39263 False positive “Variable should be inlined” for override value in initialized object
KT-39311 Batch quick fix name for “Change file’s package” is truncated
KT-39393 “Convert anonymous function to lambda expression” intention does not add necessary lambda type parameter for outer function
KT-39454 False positive “Unused symbol” with private anonymous object property
KT-39467 False negative “Move variable declaration into when” if a variable declaration is placed on a new line
KT-39490 ‘Wrap with ?.let’ quickfix put the receiver in let lambda
KT-39552 Merge 'if’s intention drops comment after nested if
KT-39604 “Package directive doesn’t match file location” quick fix does not insert a space between keyword package and the package name
KT-39772 “Redundant ‘Unit’” should support lambdas
KT-40215 “Create abstract function” quick fix suggested even though surrounding class is non-abstract
KT-40448 “Convert call chain into sequence”: support functions added in Kotlin 1.4
KT-40558 False positive “Move to class body” intention on data class constructor property
KT-41338 False positive “Redundant ‘asSequence’ call” when Map.Entry properties are used.
KT-41615 “Unused equals expression” inspection: highlight whole expression with yellow background
IDE. JS
KT-39319 KJS: Support debugging through new Intellij 202 API
KT-41328 KJS / Gradle: explicitApi mode doesn’t work
IDE. KDoc
KT-17926 IDE should show documentation for a class if the constructor has no docs.
KT-19069 KDoc: show default argument values
KT-37132 Redundant @NotNull annotation in a Quick Documentation pop-up
IDE. Misc
KT-39327 Get rid of usages of internal classes ModuleOrderEntryImpl and LibraryImpl
KT-40455 Improve support for EditorConfig
IDE. Navigation
KT-24616 Find usages fails to find setter usage
KT-38762 “Cannot access ‘java.io.Serializable’ which is a supertype of ‘kotlin.Int’” brokes navigation to constructor parameter declaration
KT-39558 Call Hierarchy shows references from KDoc
KT-40788 “Find usages” on Java getter overridden in Kotlin doesn’t find synthetic property usage when it is called without base declaration
KT-40960 Unable to find usages in java of Kotlin constructor in library when sources is attached.
IDE. Project View
KT-37528 ‘Add Kotlin File/Class’ suggests file before class
IDE. Refactorings
KT-19744 “Change Signature” is not available on constructor keyword in primary constructor
KT-22170 “Change Signature” ignores Java usages of methods marked with @JvmStatic
KT-37517 Invalid qualified name on copy-paste in build.gradle.kts
IDE. Run Configurations
KT-24463 MPP, Intellij runner: Run does not add resource directory to classpath
KT-36370 Hide run gutter icons for not yet implemented targets in multiplatform projects
KT-39788 MPP, Gradle runner: Run does not add resource directory to classpath on project reopen without Gradle sync
IDE. Scratch
KT-40557 IDE / Scratch: .kt files are treated as Kotlin scratches, opening fails
IDE. Script
KT-35825 Custom kotlin scripts have no project import suggestions in sub modules.
KT-39796 Performance of KotlinScriptDependenciesClassFinder
IDE. Tests Support
KT-28854 Run/Debug configurations: “Redirect input from” option is not available for Kotlin apps
KT-36909 IDE attempts to run non-JVM tests launched from context menu as JVM ones
IDE. Wizards
KT-37965 New Project wizard 1.4+: adding JUnit5 test library add dependency to runner
KT-40527 Node.JS application template in New Project Wizard
KT-40874 Open new project wizard help page in browser when clicking help button in new project wizard
KT-41417 Add react template to new project wizard
KT-41418 Wizard: Support KJS compiler c…
Link: Release Kotlin 1.4.20-M1 · JetBrains/kotlin · GitHub