kotlin 发布版本: Kotlin 1.2.50

1.2.50

Compiler

  • KT-23360 Do not serialize annotations with retention SOURCE to metadata
  • KT-24278 Hard-code to kotlin compiler annotation for android library migration
  • KT-24472 Support argfiles in kotlinc with -Xargfile
  • KT-24593 Support -XXLanguage:{+|-}LanguageFeature compiler arguments to enable/disable specific features
  • KT-24637 Introduce "progressive" mode of compiler

Backend. JS

  • KT-23094 JS compiler: Delegation fails to pass the continuation parameter to child suspend function
  • KT-23582 JS: Fails to inline, produces bad code
  • KT-24335 JS: Invalid implement of external interface

Backend. JVM

  • KT-12330 Slightly improve generated bytecode for data class equals/hashCode methods
  • KT-18576 Debugger fails to show decomposed suspend lambda parameters
  • KT-22063 Add intrinsics for javaObjectType and javaPrimitiveType
  • KT-23402 Internal error: Couldn't inline method call because the compiler couldn't obtain compiled body for inline function with reified type parameter
  • KT-23704 Unstable checkExpressionValueIsNotNull() generation in bytecode
  • KT-23707 Unstable bridge generation order
  • KT-23857 Annotation with target TYPE is not applicable to TYPE_USE in Java sources
  • KT-23910 @JvmOverloads doesn't work with default arguments in common code
  • KT-24427 Protected function having toArray-like signature from collection becomes public in bytecode
  • KT-24661 Support binary compatibility mode for @JvmDefault

Frontend

  • KT-21129 Unused parameter in property setter is not reported
  • KT-21157 Kotlin script: engine can take forever to eval certain code after several times
  • KT-22740 REPL slows down during extensions compiling
  • KT-23124 Kotlin multiplatform project causes IntelliJ build errors
  • KT-23209 Compiler throwing frontend exception
  • KT-23589 Report a warning on local annotation classes
  • KT-23760 Unable to implement common interface with fun member function with typealiased parameter

Android

  • KT-23244 Option to Disable View Binding generation in Kotlin Android Extensions Plugin

IDE

  • KT-8407 TestNG: running tests from context creates new run configuration every time
  • KT-9218 Searching for compilable files takes too long
  • KT-15019 Editor: args reference in .kts file is red
  • KT-18769 Expand Selection on opening curly brace should select the entire block right away
  • KT-19055 Idea hangs on copy-paste big Kotlin files
  • KT-20605 Unresolved reference on instance from common module function
  • KT-20824 Type mismatch for common function taking a non-mapped Kotlin's expected class from stdlib-common, with actual typealias on JVM
  • KT-20897 Can't navigate to declaration after PsiInvalidElementAccessException exception
  • KT-22527 Kotlin UAST does not evaluate values inside delegation expressions
  • KT-22868 Implementing an expected class declaration using actual typealias produces "good code that is red"
  • KT-22922 Override Members should add experimental annotation when required
  • KT-23384 Hotspot in org.jetbrains.kotlin.idea.caches.resolve.IDELightClassGenerationSupport.getKotlinInternalClasses(FqName, GlobalSearchScope) IDELightClassGenerationSupport.kt ?
  • KT-23408 Don't render @NonNull and @Nullable annotations in parameter info for Java methods
  • KT-23557 Expression Bodies should have implicit return in Uast
  • KT-23745 Unable to implement common interface
  • KT-23746 Logger$EmptyThrowable "[kts] cannot find a valid script definition annotation on the class class ScriptTemplateWithArgs" with LivePlugin enabled
  • KT-23975 Move Kotlin internal actions under Idea Internal actions menu
  • KT-24268 Other main menu item
  • KT-24438 ISE “The provided plugin org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar is not compatible with this version of compiler” after rebuilding simple Gradle-based project via JPS.

IDE. Configuration

  • KT-10935 Add menu entry to create new kotlin .kts scripts
  • KT-20511 Library added from maven (using IDEA UI) is not detected as Kotlin/JS library (since type="repository")
  • KT-20665 Kotlin Gradle script created by New Project/Module wizard fails with Gradle 4.1+
  • KT-21844 Create Kotlin class dialog: make class abstract automatically
  • KT-22305 Language and API versions of Kotlin compiler are “Latest” by default in some ways of creating new project
  • KT-23261 New MPP design: please show popup with error message if module name is not set
  • KT-23638 Kotlin plugin breaks project opening for PhpStorm/WebStorm
  • KT-23658 Unclear options “Gradle” and “Gradle (Javascript)” on configuring Kotlin in Gradle- and Maven-based projects
  • KT-23845 IntelliJ Maven Plugin does not pass javaParameters option to Kotlin facet
  • KT-23980 Move "Update Channel" from "Configure Kotlin Plugin Updates" to settings
  • KT-24504 Existent JPS-based Kotlin/JS module is converted to new format, while New Project wizard and facet manipulations still create old format

IDE. Debugger

  • KT-23886 Both java and kotlin breakpoints in kotlin files
  • KT-24136 Debugger: update drop-down menu for the line with lambdas

IDE. Editing

  • KT-2582 When user inputs triple quote, add matching triple quote automatically
  • KT-5206 Long lists of arguments are not foldable
  • KT-23457 Auto-import and Import quick fix do not suggest classes from common module [Common test can't find class with word Abstract in name.]
  • KT-23235 Super slow editing with auto imports enabled

IDE. Gradle

  • KT-23234 Test names for tests containing inner classes are sporadically reported to teamcity runs.
  • KT-23383 Optional plugin dependency for kotlin gradle plugin 'java' subsystem dependent features
  • KT-22588 Resolver for 'project source roots and libraries for platform JVM' does not know how to resolve on Gradle Kotlin DSL project without Java and Kotlin
  • KT-23616 Synchronize script dependencies not at Gradle Sync
  • KT-24444 Do not store proxy objects from Gradle importer in the project model
  • KT-24586 MVNFE “Cannot resolve external dependency org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.41 because no repositories are defined.” on creating Gradle project with Kotlin only (probably due to lack of repositories block)
  • KT-24671 dependencies missed in buildscript block after creating new Gradle-based project in 173 IDEA

IDE. Inspections and Intentions

New Features
  • KT-7822 Convert foreach to for loop should place caret on the variable declaration
  • KT-9943 Quick fix/Intention to indent a raw string
  • KT-15063 Inspection for coroutine: unused Deferred result
  • KT-16085 Inspection "main should return Unit"
  • KT-20305 Inspection: Refactor sealed sub-class to object
  • KT-21413 Missing inspection: parentheses can be deleted when the only constructor parameter is a function not existing
  • KT-23137 Intention for converting to block comment and vise versa
  • KT-23266 Add intention(s) to put arguments / parameters on one line
  • KT-23419 Intention to replace vararg with array and vice versa
  • KT-23617 Add inspection: redundant internal in local anonymous object / class
  • KT-23775 IntelliJ plugin: improve "accessor call that can be replaced with property"
  • KT-24235 Inspection to replace async.await with withContext
  • KT-24263 Add Make variable immutable quickfix for const
  • KT-24433 Inspection for coroutines: unused async result
Performance Improvements
  • KT-23566 "Can be private" works on ResolutionResultsCache.kt (from Kotlin project) enormously slow
Fixes
  • KT-6364 Incorrect quick-fixes are suggested for nullable extension function call
  • KT-11156 Incorrect highlighting for nested class in "Redundant SAM-constructor" inspection
  • KT-11427 "Replace if with when" does not take break / continue into account
  • KT-11740 Invert if condition intention should not remove line breaks
  • KT-12042 "Merge with next when" is not applicable when the statements delimited by semicolon or comment
  • KT-12168 "Remove explicit type specification" intention produce incompilable code in case of function type
  • KT-14391 RemoveUnnecessaryParenthesesIntention lost comment on closing parenthesis
  • KT-14556 Quickfix to suggest use of spread operator does not work with mapOf
  • KT-15195 Redundant parentheses shouldn't be reported if lambda is not on the same line
  • KT-16770 Change type of function quickfix does not propose most idiomatic solutions
  • KT-19629 "Convert to primary constructor" quick fix should not move init{...} section down
  • KT-20123 Kotlin Gradle script: “Refactoring cannot be performed. Cannot modify build.gradle.kts” for some refactorings and intentions
  • KT-20332 Unused property declaration suppression by annotation doesn't work if annotation is targeted to getter
  • KT-21878 "arrayOf() call can be replaced by array litteral [...]" quick fix inserts extra parentheses
  • KT-22092 Intention "Specify return type explicitly": Propose types from overriden declarations
  • KT-22615 "Replace with" intention does not work for equal names
  • KT-22632 Gutter icon "go to actual declaration" is absent for enum values on actual side
  • KT-22741 Wrong suggestion for Replace 'if' expression with elvis expression
  • KT-22831 Inspection for converting to elvis operator does not work for local vars
  • KT-22860 "Add annotation target" quick fix does not take into account existent annotations in Java source
  • KT-22918 Create interface quickfix is missing 'current class' container
  • KT-23133 "Remove redundant calls of the conversion method" wrongly shown for Boolan to Int conversion
  • KT-23167 Report "use expression body" also on left brace
  • KT-23194 Inspection "map.put() should be converted to assignment" leads to red code in case of labled return
  • KT-23303 "Might be const" inspection does not check explicit type specification
  • KT-23320 Quick fix to add constructor invocation doesn't work for sealed classes
  • KT-23321 Intention to move type to separate file shouldn't be available for sealed classes
  • KT-23346 Lift Assignment quick fix incorrectly processes block assignments
  • KT-23377 Simplify boolean expression produces incorrect results when mixing nullable and non-nullable variables
  • KT-23465 False positive suspicious callable reference on lambda invoke with parameters
  • KT-23511 "Remove parameter" quick fix makes generic function call incompilable when type could be inferred from removed parameter only
  • KT-23513 "Remove parameter" quick fix makes caret jump to the top of the editor
  • KT-23559 Wrong hint text for "assignment can be replaced with operator assignment"
  • KT-23608 AE “Failed to create expression from text” after applying quick fix “Convert too long character literal to string”
  • KT-23620 False positive Redundant Companion reference on calling object from companion
  • KT-23634 'Add use-site target' intention drops annotation arguments
  • KT-23753 "Remove variable" quick fix should not remove comment
  • KT-23756 Bogus "Might be const" warning in object expression
  • KT-23778 "Convert function to property" intention shows broken warning
  • KT-23796 "Create extension function/property" quick fix suggests one for nullable type while creates for not-null
  • KT-23801 "Convert to constructor" (IntelliJ) quick fix uses wrong use-site target for annotating properties
  • KT-23977 wrong hint Unit redundant
  • KT-24066 'Remove redundant Unit' false positive when Unit is returned as Any
  • KT-24165 @Deprecated ReplaceWith Constant gets replaced with nothing
  • KT-24207 Add parameter intent/red bulb should use auto casted type.
  • KT-24215 ReplaceWith produces broken code for lambda following default parameter

IDE. Multiplatform

  • KT-20406 Overload resolution ambiguity in IDE on expect class / actual typealias from kotlin-stdlib-common / kotlin-stdlib
  • KT-24316 Missing dependencies in Kotlin MPP when using gradle composite builds

IDE. Navigation

  • KT-7622 Searching usages of a field/constructor parameter in a private class seems to scan through the whole project
  • KT-23182 Find Usages checks whether there are unused variables in functions which contain search result candidates
  • KT-23223 Navigate to actual declaration from actual usage

IDE. Refactorings

  • KT-12078 Introduce Variable adds explicit type when invoked on anonymous object
  • KT-15517 Change signature refactoring shows confusing warning dialog
  • KT-22387 Change signature reports "Type cannot be resolved" for class from different package
  • KT-22669 Refactor / Copy Kotlin source to plain text causes CCE: "PsiPlainTextFileImpl cannot be cast to KtFile" at CopyKotlinDeclarationsHandler$doCopy$2$1$1.invoke()
  • KT-22888 Rename completion cuts off all characters except letters from existent name
  • KT-23298 AE: "2 declarations in null..." on rename of a field to object or class
  • KT-23563 null by org.jetbrains.kotlin.idea.refactoring.rename.KotlinMemberInplaceRenameHandler$RenamerImpl exception on trying in-place Rename of non-scratch functions
  • KT-23613 Kotlin safe delete processor handles java code when it should not
  • KT-23644 Named parameters in generated Kotlin Annotations
  • KT-23714 Add Parameter quickfix not working when the called method is in java.
  • KT-23838 Do not search for usages in other files when renaming local variable
  • KT-24069 'Create from usage' doesn't use type info with smart casts

IDE. Scratch

  • KT-6928 Support Kotlin scratch files
  • KT-23441 Scratch options reset on IDE restart
  • KT-23480 java.util.NoSuchElementException: "Collection contains no element matching the predicate" on run of a scratch file with unresolved function parameter
  • KT-23587 Scratch: references from scratch file aren't taken into account
  • KT-24016 Make long scratch output lines readable
  • KT-24315 Checkbox labels aren't aligned in scratch panel
  • KT-24636 Run Scratch when there are compilation errors in module

Tools. J2K

  • KT-22989 Exception "Assertion failed: Refactorings should be invoked inside transaction" on creating UI Component/Notification

Libraries

  • KT-10456 Common Int.toString(radix: Int) method
  • KT-22298 Improve docs for Array.copyOf(newSize: Int)
  • KT-22400 coroutineContext shall be in kotlin.coroutines.experimental package
  • KT-23356 Cross-platform function to convert CharArray slice to String
  • KT-23920 CharSequence.trimEnd calls substring instead of subSequence
  • KT-24353 Add support for junit 5 in kotlin.test
  • KT-24371 Invalid @returns tag does not display in Android Studio popup properly

Gradle plugin

  • KT-20214 NoClassDefFound from Gradle (should report missing tools.jar)
  • KT-20608 Cannot reference operator overloads across submodules (.kotlin_module not loaded when a module name has a slash)
  • KT-22431 Inter-project incremental compilation does not work with Android plugin 2.3+
  • KT-22510 Common sources aren't added when compiling custom source set with Gradle multiplatform plugin
  • KT-22623 Kotlin JVM tasks in independent projects are not executed in parallel with Gradle 4.2+ and Kotlin 1.2.20+
  • KT-23092 Gradle plugin for MPP common modules should not remove the 'compileJava' task from project.tasks
  • KT-23574 'archivesBaseName' does not affect module name in common modules
  • KT-23719 Incorrect Gradle Warning for expectedBy in kotlin-platform-android module
  • KT-23878 Kapt: Annotation processors are run when formatting is changed
  • KT-24420 Kapt plugin: Kapt task has overlapping outputs (and inputs) with Gradle's JavaCompile task
  • KT-24440 Gradle daemon OOM due to function descriptors stuck forever

Tools. kapt

  • KT-23286 kapt + nonascii = weird pathes
  • KT-23427 kapt: for element with multiple annotations, annotation values erroneously use default when first annotation uses default
  • KT-23721 Warning informing user that 'tools.jar' is absent in the plugin classpath is not show when there is also an error
  • KT-23898 Kapt: Do now show a warning for APs from 'annotationProcessor' configuration also declared in 'kapt' configuration
  • KT-23964 Kotlin Gradle plugin does not define inputs and outputs of annotation processors