Kotlin 1.2.60 is out!资料
本文为去找网小编(www.7zhao.net)为您推荐的Kotlin 1.2.60 is out!，希望对您有所帮助，谢谢！
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.
We’d like to thank our external contributors whose pull requests were included in this release: , , , , , , , , , , , , , , and
The complete list of changes in this release can be found in the . Read on for the highlights.
Multiplatform projects update
Optional expectation for annotations
This update introduces the
@OptionalExpectationannotation that is suitable for marking
expect annotation classdeclarations in common code whose
actualcounterparts 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
This change, in particular, will allow for using annotations such as
@JsNamein common code of a multiplatform project. We’replanning to provide these annotations in
kotlin-stdlib-commonstarting with 1.2.70.
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.
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=truekey to the
gradle.propertiesfile. 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.
Besides, information messages produced by the annotation processors used with kapt, which were shown as warnings in Gradle builds, are now printed with the
INFOlogging level for cleaner build outputs. To revert to the old behavior and print them as warnings, set the Gradle project property
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
Other improvements in the IntelliJ IDEA plugin
A quick fix for removing the
lateinitmodifier when it conflicts with a custom property accessor A quick fix to either move a
const valproperty into the companion object or remove an illegal
constmodifier 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.
New checks were added for the following erroneous constructs:
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)
staticmember usages that were inconsistent with Kotlin companion object members visibility (KT-25333) Annotations with
EXPRESSIONtarget and non-
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
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.
Also, don’t forget to update the compiler and standard library version in your Maven and Gradle build scripts.
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.
以上为Kotlin 1.2.60 is out!文章的全部内容，若您也有好的文章，欢迎与我们分享！