Kotlin 1.3.60 updates Java-to-Kotlin converter
Java and Kotlin go hand in hand, especially when it comes to Android development. Kotlin version 1.3.60 just released and it contains a number of new updates and a few enhancements, including tooling improvements for debugging and Gradle scripts, a new worksheet mode for IntelliJ IDEA, improved error messages, and a preview of some Kotlin 1.4 features.
Kotlin’s newest version is here; 1.3.60 released on November 18, 2019.
Ever since Android expressed that Kotlin is a first-class language, it has seen a healthy amount of growth and adoption rates. Not only Android devs use it. According to the State of Kotlin 2019 survey, while 62% of devs develop mobile apps with Kotlin, 41% work on web back-end projects.
Let’s see what the update includes.
Improved scratch files and worksheets
Scratch files for Intellij IDEA get a new design.
Experiment with your code and see the results in a small scratch file. The scratch file exists as temporary code outside of the project. Yet, the snippet exists as a fully functional code that you can run and debug.
Or, for cases where you want to experiment inside the project, use worksheets. Worksheets are brand new and function similarly to scratch sheets. The main difference is that it is part of the project, so you can play with code and see how it works inside of your project.
Afterward, select run and execute your code. Read more about scratch files and worksheets in the documentation.
Java developers especially have turned to Kotlin for both work and personal/side projects, either as a replacement, or an additional language. JetBrains reported: “Almost all Kotlin developers (92%) were using Java before they started using Kotlin.”
Now, the new default converter makes converting to Kotlin even easier. 1.3.60 fixes some previous conversion issues, including corner-case issues.
Now, when you convert several files at once, they are analyzed together and the usages from the other files affect the final result. For example, if you pass
Stringargument to a
foofunction in Java, after converting a function and its usage together, the converted Kotlin function will take a nullable
String?as an argument:
Users can set function breakpoints into their code when using the debugger. When setting a function breakpoint, the debugger stops execution on either entering or exiting.
New changes arrive for Kotlin/JS, including quality of life updates and a new
org.jetbrains.kotlin.js plugin. This plugin offers simplifications.
Source maps are now generated automatically for the code. This change will make debugging easier and includes support for breakpoints and code annotations, and more helpful info.
Now, when running tests on the JS platform, test outputs will be included in the generated Gradle report. The report allows for easy referencing, with line numbers and file names that directly point back to your code.
View the full changelog for 1.3.60 on GitHub for additional information and the complete list of bug fixes.
Since 1.3.60 is only a minor release, it does not include major changes to the language. However, Kotlin version 1.4 will arrive in 2020, as per the plan set by JetBrains.
Users can test out some of the upcoming features. You will have to specify the corresponding language version and set it to 1.4. Note that these features are currently experimental.
Kotlin 1.4 will include:
- NPE assertions
- Fixes and changes for tail-recursive functions
- Upcoming breaking change: Combining
tailrecmodifiers will display an error. Users will also not be able to use
tailrecat the same time.