Jet Brains works hard to make Kotlin coders happy. Recently, Kotlin 1.2 M2 was released.
Kotlin 1.2 M2 is out:https://t.co/Gbdnj2q8SM
— Kotlin (@kotlin) 9 августа 2017 г.
This released is focused on stability and bugfixes to Kotlin compiler and tooling. Also, there are some improvements of Kotlin standart library. It also includes many of the tooling features available in the upcoming release of Kotlin 1.1.4.
Let's see what's inside!
Revised windowed/pairwise operations
windowedfunction now has its step parameter defaulting to 1.
It also gets an additional optional parameter
partialWindows, which controls what to do with incomplete windows in the end. By default it is false, which means incomplete windows are dropped.
pairwisefunction name was too confusing, it was unclear how it paired the elements together. Now it is called
zipWithNext, so it is more clear that each element is zipped with the next element in a collection.
Common math operations in the standard library
kotlin.math package now released:
tanand inverse of them:
pow(an extension function),
round(half to even) functions;
roundToLong(half to integer) extension functions;
- sign and absolute value:
minof two values;
- binary representation:
Double.fromBits(these are in the
The same set of functions (but without constants) is also available for
Most of these functions (except the binary representation group) are also available in JS, thus solving the problem of writing the same calculations for both platforms.
Full release notes:
- Android Extensions fails to compile when importing synthetic properties for layouts in other modules
- Switch warning to error for java-default method calls within 1.6 target
- Do not use non-existing class for suspend markers
- Exception on building gradle project with collection literals
- Fix collection literals resolve in gradle-based projects
IDE. Inspections and Intentions
- Circular autofix actions between redundant modality and non-final variable with allopen plugin
- "Protected in final" inspection works incorrectly with all-open
- "Redundant modality" is not reported with all-open
- Redundant "make open" for abstract class member with all-open
windowedfunction: make default step equals to 1, add
- Support math operations in stdlib
- Provide Double and Float bit conversion functions as extensions
- Kapt3, IC: Kapt does not generate annotation value for constant values in documented types