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 the standard library, which imitates the
suspend
modifier for lambda expressions - Adds support for TestNG in
kotlin.test
- Brings support for Android modules in multiplatform projects
- Introduces a new feature in kapt for reporting annotation processing errors along with proper links to the original Kotlin declarations
- Adds a lot of new inspections and intentions in the IntelliJ plugin and improves its performance
- Fixes bugs in the compiler and IntelliJ plugin
The update is compatible with all versions of IntelliJ IDEA from 2017.1 until 2017.3 and 2018.1 EAP, as well as with Android Studio 3.0 and Android Studio 3.1 (Beta)
The complete list of changes in this release can be found in the changelog.
Changes in the libraries
This release adds a new function to the Kotlin standard library with the following signature:
The purpose of this function is to wrap a function literal into a value of a suspending function type and enable its usage as a suspending function. Example:
It’s important to note that adding this function is a preliminary step in gradually introducing a suspend
modifier for lambda expressions in the future Kotlin versions. Usages of the function that would not be valid if it was a modifier, such as taking a function reference to it or using a labeled [email protected]
, are prohibited, and the calls to third-party suspend
-named functions that would clash with the modifier are now deprecated.
Another notable change is the support for the TestNG framework in kotlin.test
– thanks to our contributor Valeriy Zhirnov! The new artifact kotlin-test-testng
provides an implementation of Asserter
on top of TestNG and maps the test annotations from kotlin-test-annotations-common
to the TestNG test annotations.
Platform modules targeting Android
The update of the experimental multiplatform projects feature introduces support for Android platform modules. These modules should apply the corresponding plugin in the Gradle build script and can use the shared code from a common module:
123456789 | apply plugin:'com.android.application'apply plugin:'kotlin-platform-android'// ...dependencies{expectedBy project(":multiplatform-app")// ...} |
A simple project layout example can be found in the Kotlin repository: multiplatformAndroidProject
Kapt diagnostic locations
With Kotlin 1.2.30, kapt, the Kotlin annotation processing tool, can provide links to locations in the original Kotlin code rather than generated Java stubs as it reports errors encountered during annotation processing. This feature can be enabled by adding these lines to the Gradle build script (build.gradle
):
1234 | kapt{mapDiagnosticLocations=true} |
This will include the original locations in the Kotlin files into error reports from the annotation processors, for example:
12 | e:src/main/kotlin/Foo.kt:47:error:@Provides methods must notbe private |
Deprecation of old kapt
Original kapt was deprecated a year ago, and in 1.2.30 we changed the deprecation warning to an error. The migration process to the new kapt (aka kapt3) is very easy, just apply a kotlin-kapt
plugin in your build.gradle
file:
12 | apply plugin:"kotlin-kapt" |
If you experience any troubles with the new kapt, please let us know.
IntelliJ IDEA plugin improvements
This release brings various improvements in the IntelliJ IDEA Kotlin plugin, such as performance improvements, bug fixes, and new inspections and intentions.
Intentions for converting the scoping function calls
Kotlin 1.2.30 adds new intentions that convert calls to the scoping functions let
and run
and into each other, as well as also
into apply
and vice versa:
Pasting Kotlin code into a package
The IntelliJ plugin now allows pasting Kotlin code into a package item in the Project View, creating a new Kotlin file for the code:
Other changes in the IDE plugin
- Data flow analysis (‘Analyze Data Flow …’) support for mixed Kotlin and Java codebases
- An option to create a run configuration for a Node CLI application from a
main
function in Kotlin/JS projects - Improvements in the Rename/Move refactoring, such as warnings on possible conflicts introduced by renaming
Changes in the compiler
The Kotlin 1.2.30 update fixes several known issues in the Kotlin compiler and includes performance improvements.
The compiler is now able to optimize a tail call made in a suspending function to another Unit
-returning suspending function, resulting into more efficient compiled code.
How to update
To update the plugin, use Tools | Kotlin | Configure Kotlin Plugin Updates and press 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.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.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.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
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
錯誤:libatk1.0-0 : Depends: libatk1.0-data (>= 2.30.0-1) but 2.28.1-1 is to be installed
在Ubuntu下安裝檔案時遇到以下錯誤: The following packages have unmet dependencies: libatk1.0-0 : Depends: libatk1.0-data (>= 2.30.0-1) but 2.28.1-1 is t
錯誤:libatk1.0-0 : Depends: libatk1.0-data (>= 2.30.0-1) but 2.28.1-1 is to be installed
在Ubuntu下安裝檔案時遇到以下錯誤: The following packages have unmet dependencies: libatk1.0-0 : Depends: libatk1.
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
用正則表達式實現 運算 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(‘+-‘,‘
[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