当前位置:主页 > 资料 >

Kotlin 1.2.60 is out!
栏目分类:资料   发布日期:2018-08-02   浏览次数:

导读:本文为去找网小编(www.7zhao.net)为您推荐的Kotlin 1.2.60 is out!,希望对您有所帮助,谢谢! Adds optional expected annotations to multiplatform projects Allows building multiplatform projects with IntelliJ IDEA Introd

本文为去找网小编(www.7zhao.net)为您推荐的Kotlin 1.2.60 is out!,希望对您有所帮助,谢谢!

欢迎访问www.7zhao.net



  • Adds optional expected annotations to multiplatform projects
  • Allows building multiplatform projects with IntelliJ IDEA
  • Introduces experimental kapt mode aimed to speed up Gradle builds
  • Adds new refactorings, inspections, and intentions to the IntelliJ IDEA plugin
  • Fixes a lot of known issues in the compiler and the IDE plugin and provides performance improvements

The update is compatible with all versions of IntelliJ IDEA from 2017.2 to 2018.2, as well as with Android Studio 3.1, 3.2 Beta, and 3.3 Canary. 本文来自去找www.7zhao.net

We’d like to thank our external contributors whose pull requests were included in this release: , , , , , , , , , , , , , , and www.7zhao.net

The complete list of changes in this release can be found in the . Read on for the highlights.

欢迎访问www.7zhao.net

Multiplatform projects update

Optional expectation for annotations

This update introduces the @OptionalExpectation annotation that is suitable for marking expect annotation class declarations in common code whose actual counterparts may be omitted in the platform implementations. Doing so will then make the compiler ignore the annotations on the common declarations during compilation of the platform modules that have no corresponding actual annotation class. 本文来自去找www.7zhao.net

This change, in particular, will allow for using annotations such as @JvmName and @JsName in common code of a multiplatform project. We’replanning to provide these annotations in kotlin-stdlib-common starting with 1.2.70. 去找(www.7zhao.net欢迎您

Building a multiplatform project with IntelliJ IDEA

A multiplatform project may now be built with the integrated build system of IntelliJ IDEA without delegating the task to Gradle, which improves build times for IDE run configurations. These builds already benefit from incremental compilation of Kotlin code.

内容来自www.7zhao.net

Kapt improvements

In addition to performance improvements, we added an experimental option to run kapt, the Kotlin annotation processing tool, directly using Gradle workers. In some cases, this may significantly improve the overall build speed. To switch to the Gradle worker implementation, add the kapt.use.worker.api=true key to the gradle.properties file. Note that it is only available with Gradle 4.3 and above. We plan to enable it by default in Kotlin 1.2.70, so we kindly ask for your feedback. Please let us know if you have any problems with the Worker API option enabled.

www.7zhao.net

Besides, information messages produced by the annotation processors used with kapt, which were shown as warnings in Gradle builds, are now printed with the INFO logging level for cleaner build outputs. To revert to the old behavior and print them as warnings, set the Gradle project property kapt.info.as.warnings to true in the gradle.properties file.

内容来自www.7zhao.net

IntelliJ IDEA support improvements

Quick fixes for wrapping a value into a collection

There’s a new quick fix for wrapping a value into a singleton list, set, array, or sequence on type mismatch and corresponding postfix templates for the functions listOf , setOf , arrayOf , sequenceOf :

内容来自www.7zhao.net

内容来自www.7zhao.net

Other improvements in the IntelliJ IDEA plugin

  • A quick fix for removing the lateinit modifier when it conflicts with a custom property accessor
  • A quick fix to either move a const val property into the companion object or remove an illegal const modifier
  • An intention for replacing String.format(...) with a string template
  • Other useful inspections and intentions
  • Lots of bug fixes and performance improvements

Changes in the compiler

The Kotlin 1.2.60 update fixes a lot of known issues in the compiler and delivers performance and stability improvements. copyright www.7zhao.net

New deprecations

New checks were added for the following erroneous constructs:

www.7zhao.net

  • Smart casts of local delegated properties that led to type safety guarantees violation and runtime failures (KT-22517)
  • Annotation arguments erroneously accepted even though they are not compile time constants (KT-23153)
  • Java static member usages that were inconsistent with Kotlin companion object members visibility (KT-25333)
  • Annotations with EXPRESSION target and non- SOURCE retention (KT-13762)

All of these are reported as warnings in Kotlin 1.2.60+ and will become errors in Kotlin 1.3. The corresponding checks already report errors in the progressive compiler mode (with the -Xprogressive flag).

copyright www.7zhao.net

How to update

To update your IntelliJ IDEA or Android Studio plugin, use Tools | Kotlin | Configure Kotlin Plugin Updates and click the “Check for updates now” button. 去找(www.7zhao.net欢迎您

Also, don’t forget to update the compiler and standard library version in your Maven and Gradle build scripts. 内容来自www.7zhao.net

As usual, if you run into any problems with the new release, you’re welcome to ask for help on the , on Slack (get an invite ), or to report issues in theissue tracker.

www.7zhao.net

Let’s Kotlin! www.7zhao.net

欢迎访问www.7zhao.net


本文原文地址:https://blog.jetbrains.com/kotlin/2018/08/kotlin-1-2-60-is-out/

以上为Kotlin 1.2.60 is out!文章的全部内容,若您也有好的文章,欢迎与我们分享!

copyright www.7zhao.net

Copyright ©2008-2017去找网版权所有   皖ICP备12002049号-2 皖公网安备 34088102000435号   关于我们|联系我们| 免责声明|友情链接|网站地图|手机版