The production version of Kotlin 1.3 is now available and introduces contracts to the type system.
Where to download Kotlin
You can access the Kotlin source code on the project’s GitHub repo.
Current version: What’s new in Kotlin 1.3
Kotlin 1.3’s contracts are an experimental addition meant to enrich the type information available through the function system with additional meanings useful at the call site. A contract lets a function tell the compiler things such as “I affect smart casts this way” or “I execute this lambda exactly once.” The Kotlin standard library already has contracts added to several functions, which work regardless of experimental flags.
Other new features in Kotlin 1.3 include:
- The coroutines capability is in stable status, meaning there have been changes in the APIs and ABIs based on feedback. There is migration support to bridge old, experimental coroutines with new ones. Also, introspection is supported for
- In the standard library, support has been improved for unsigned integer types. Unsigned types and arrays should feel more like first-class citizens.
- With an API improvement in the standard library, the
Randomclass introduced in the previous beta has gained extensions to generate unsigned numbers and arrays and unsigned bytes. Also, an extension called