

In this article, we will learn the Kotlin IntRange, LongRange & CharRange along with few examples. One of the most notable features is smartcasts - with the ability to perform a cast automatically based on the performed type checks:įun trueEnterpriseComesToKotlin(block: (Any, Any. The Kotlin compiler does extensive static analysis to provide warnings and reduce boilerplate.

Publishing multiplatform libraries is now supported.įor more information, please refer to the multiplatform programming documentation. Source sets can now be shared between an arbitrary subset of platforms (for example, in a module that targets JS, Android and iOS, you can have a source set that is shared only between Android and iOS). The dependencies configuration has been changed dependencies are now specified separately for each source root. There is now a large number of preset platform configurations for different supported platforms. Now, common and platform-specific code is placed in different source roots of the same module, making projects easier to configure. In the old model, common and platform-specific code needed to be placed in separate modules, linked by expectedBy dependencies. The key differences to the old model are: Also, Kotlin/Native is now supported as one of the targets!

In 1.3, we've completely reworked the model of multiplatform projects in order to improve expressiveness and flexibility, and to make sharing common code easier. See the Kotlin/Native overview for details. Kotlin 1.3 continues to improve and polish the Native target. Kotlin 1.3 introduces callable references on suspend-functions and support of coroutines in the reflection API. Check out the new coroutines overview page.

Release date: 29 October 2018 Coroutines releaseĪfter some long and extensive battle testing, coroutines are now released! It means that from Kotlin 1.3 the language support and the API are fully stable.
