1. 程式人生 > >Kotlin 1.2.60 is out!

Kotlin 1.2.60 is out!

We’re happy to announce the release of Kotlin 1.2.60, a new bugfix and tooling update for Kotlin 1.2. This release:

  • 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.

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

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.

This change, in particular, will allow for using annotations such as @JvmName and @JsName in common code of a multiplatform project. We’re planning to provide these annotations in kotlin-stdlib-common starting 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.

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.

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.

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:

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.

New deprecations

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)
  • 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).

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 forums, on Slack (get an invite here), or to report issues in the issue tracker.

Let’s Kotlin!

相關推薦

Kotlin 1.2.60 is out!

We’re happy to announce the release of Kotlin 1.2.60, a new bugfix and tooling update for Kotlin 1.2. This release: Adds optional expected an

Kotlin 1.2.30 is out

We’re happy to announce the release of Kotlin 1.2.30, a new bugfix and tooling update for Kotlin 1.2. This update: Adds a new declaration in

Kotlin 1.2.40 is out!

We’re happy to announce the release of Kotlin 1.2.40, a new bugfix and tooling update for Kotlin 1.2! This update: Allows platform modules in

Kotlin 1.2.50 is out!

We’re happy to announce the release of Kotlin 1.2.50, a new bugfix and tooling update for Kotlin 1.2. This release: Updates Kotlin support in

Kotlin 1.2.70 is Out!

We’re happy to announce the release of Kotlin 1.2.70, a new bugfix and tooling update for Kotlin 1.2. This release: Significantly improves in

springboot 1.5.10 +kotlin 1.2.20 解決 java.lang.ClassNotFoundException: kotlin.reflect.KotlinReflectionInternalError

exceptio pri pla nbsp http art fas cep start.s 使用http://start.spring.io/ 下載的 項目 跑單元測試 報 java.lang.ClassNotFoundException: kotlin.reflect.

Kotlin 1.2 新特性

Kotlin JavaScript JVM 點擊關註異步圖書,置頂公眾號每天與你分享IT好書 技術幹貨 職場知識在Kotlin 1.1中,團隊正式發布了JavaScript目標,允許開發者將Kotlin代碼編譯為JS並在瀏覽器中運行。在Kotlin 1.2中,團隊增加了在JVM和JavaScrip

用正則表達式實現 運算 express = '1 -2* ((60-30 +(-40/5) *(9-2*5/3 +7 /3*99 /4*2998 +10 *568 /14))-(-4*3)/(16-3*2))'

repl bsp val 實現 strip expr 運算 lac spl #!/usr/bin/env python # coding:utf-8 import re def dealwith(express): express.replace(‘+-‘,‘

Kotlin 1.3 RC is Here: Migrate Your Coroutines!

We’re proud to introduce Kotlin 1.3-RC, the latest preview and release candidate for 1.3.0. This release mostly contains critical bug-fixes re

index 2 is out of bounds for axis 1 with size 2

在使用類似  keras.np_utils.to_categorical 的函式,對標籤轉換成one-hot編碼的時候,要使標籤從0開始。即如果是兩類,設標籤裡面的內容為0和1,不能設定為1和2或其他數字。 比如: from keras.utils import np_util

Python實現groupBy函數。grpby = groupBy(lambda x: x%2 is 1),grpby([1, 2, 3])的結果為{True: [1, 3], False: [2]}

結果 false n) pen als 不存在 def lam nbsp def groupBy(fn): def go(lst): m = {} for v in lst: m[fn(v)].append(v) if m.get(fn(v

Error:Minimum supported Gradle version is 2.14.1. Current version is 2.10.原因分析和解決。

圖片 幫助 url err ... tle IT .net fcm 最近和主管一起開發項目一直出現這個問題: Error:Minimum supported Gradle version is 2.14.1. Current version is 12.10. If usi

解決 You are using pip version 7.1.2, however version 18.0 is available.報錯

完美 bsp -- 安裝目錄 方法 exe win .exe 嘗試 Windows下安裝 Pyhton的mysql庫時 命令行一直報 You are using pip version 7.1.2, however version 18.0 is available

[python問題] You are using pip version 7.1.2, however version 18.1 is available

 在windows環境下在安裝paramiko的時候 ,使用命令python -m pip install paramiko 一直報錯  You are using pip version 7.1.2, however version 18.1 is available  解決辦法,pip版本升級。在Py

ubuntu18.04安裝pip3 Depends: python-pip-whl (= 8.1.1-2) but 8.1.1-2ubuntu0.4 is to be installed

下了個ubuntu18.04,更新源後安裝pip3 apt install python3-pip 結果居然報錯了 Reading package lists... Done Building dependency tree Reading state inf

解決MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.(win10)

一、問題情境 本想用django搭建個小部落格,但是在Windows10的DOS下安裝mysql驅動時, 總是報錯:MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.

python報錯 ValueError: dictionary update sequence element #0 has length 1; 2 is require

原文連結地址: https://blog.csdn.net/weixin_40894428/article/details/80683137 字串轉字典要用eval(),這個方法很多書上都沒有介紹, 有關eval()的用法,傳送門: http://www.runoob.com/python/

安裝MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform.

安裝了python,想用python來連線資料庫,需要安裝mysql-python包。 在https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python

Spring Boot - An incompatible version [1.2.12] of the APR based Apache Tomcat Native library is...

Spring Boot在目前的專案開發中已經逐步火熱起來,既然是一種技術在使用的過程中出現問題在所難免,在一次初始化Spring Boot專案啟動時,我遇到了一個啟動失敗的問題,日誌給出的資訊An incompatible version [1.1.14] of the APR ba

Spring Security(二):2.1 Introduction What is Spring Security?

Spring Security provides comprehensive security services for Java EE-based enterprise software applications. There is a particular emphasis on supporting p