Kotlin 1.1-M03 is here!

We are pleased to announce the third milestone of the upcoming Kotlin 1.1. This release brings new language features as well as improvements and fixes in the JavaScript backend, compiler and IDEA plugin. The new release also includes all tooling features introduced in Kotlin 1.0.5, and is compatible with IntelliJ IDEA 2016.3 EAP and Android Studio 2.2 and 2.3.

As with other milestone releases, we give no backwards compatibility guarantees for new language and library features. Anything introduced in milestone releases of 1.1 is subject to change before the final 1.1 release.

Please do share your feedback regarding the new features or any problems that you may run into with this release, via YouTrack, forums and Slack.

The full changelog for 1.1-M03 is available here.

Underscore for unused symbols

You can now use an underscore instead of the name of an unused parameter of a lambda:

And an unused variable name in destructuring declarations can now be replaced with an underscore as well.

Both cases are described in detail in the appropriate KEEP.

Underscore in numeric literals

In accordance with Java 8 specification, Kotlin supports now numeric literals with single underscore symbols between digits. For example:

See the KEEP for more details and examples.

Generic Enum values access

The support of the proposal is landed to the standard library in a form of two intrinsic functions:

They allow to enumerate the values of a generic enum type. E.g.

Scope control for builder-like DSLs

As described in details in the KEEP, DSL authors had problems in expressing scope restrictions for builder-like constructs. E.g., for some html-builder DSL:

To solve the problem we added the @DslMarker annotation that allows to control visibility scope in these cases more precisely. For usage example see  preview version of kotlinx.html library using this feature (see HtmlTagMarker and HTMLTag implementations and DSL-markers.md for the preview library usage info).

Standard library unification

The standard library unification process for different platforms is moving forward. We have started unifying exception types in 1.1-M2 and now some more common types, which are supported on all platforms, are available in kotlin.* packages, and are imported by default. These include:

  • ArrayList, HashSet, LinkedHashSet, HashMap, LinkedHashMap in kotlin.collections
  • Appendable and StringBuilder in kotlin.text
  • Comparator in kotlin.comparisons

On JVM these are just typealiases of the good old types from java.util and java.lang

New language features support in the JavaScript backend

JavaScript backend now supports the following Kotlin language features on par with JVM backend:

  • Coroutines
  • Destructuring in lambda parameters
  • Unused variable name in destructuring declaration

JS code generation improvements

JavaScript backend now generates more statically checkable code, which is friendlier to JS code processing tools, like minifiers, optimisers, linters, etc.

How to Try It

In Maven/Gradle: Add http://dl.bintray.com/kotlin/kotlin-eap-1.1 as a repository for the build script and your projects; use 1.1-M03 as the version number for the compiler and the standard library.

In IntelliJ IDEA: Go to Tools → Kotlin → Configure Kotlin Plugin Updates, then select “Early Access Preview 1.1” in the Update channel drop-down list, then press Check for updates.

Drive to Kotlin!

This entry was posted in Releases and tagged , . Bookmark the permalink.

11 Responses to Kotlin 1.1-M03 is here!

  1. Tim van der Leeuw says:

    The generic value access works when I know at compile time what the Enum will be, but will it also work when at compile time I do not yet know which Enum I wish to access? If the enum class itself will be a runtime parameter of type Enum or something similar?

    How should I pass it to these enumValueXXX() functions in such a case?

    That’s a case which I’ve had to handle a couple of times.

  2. Sergey says:

    JavaScript backend now generates more statically checkable code

    Good news! Are there any plans of integration with google closure compiler? For example, type info in js doc for DisambiguateProperties-like optimizations? If so, it will be really good alternative for dart/typescript (their IDE support is still missing of many refactorings, and coding is still painfull)

  3. Max says:

    Scope control for builder-like DSLs

    Hallelujah. I’ve been wanting this since last January: http://stackoverflow.com/q/34834739/341772

  4. sandeep says:

    guys – could you also publish zip files of this ? everything seems to mandate download of intellij first.

    i just want to try out kotlin scripting.

  5. Kotlin>Java says:

    Hi,
    I’m having trouble upgrading my Kotlin version to 1.1 in Android Studio. It tells me I have the latest version – 1.1-M03-release-Studio2.2-2 installed, but I can’t seem to get it working by upgrading my gradle ext.kotlin_version – I don’t know what to put in there – right now I have “1.0.5” and I tried “1.1-M03” and “1.1” and “1.1-M03-release-Studio2.2-2” and nothing will compile.
    What should I put in there?

    Also, since I’m posting here, I would just like to point out that after a few instant-runs, they stop working with changed Kotlin files (I get some dex errors) and the app has to be restarted the old-fashioned way. Are you aware of this?

    Best regards

  6. Pingback: Java Annotated Monthly – December 2016 – WewUnik | Tips For Your Life

Comments are closed.