It will help developers be more productive by supporting more smart-casts and cases where types can be inferred automatically. One of the benefits all developers can take advantage of right now is the new, more powerful type inference algorithm, which is now enabled by default. The language features mentioned above are some of the most developer-facing changes in Kotlin 1.4, however the bulk of work went into improving the overall quality and performance of the Kotlin compiler. Refer to the linked documentation for instructions how to enable Explicit API mode and start using these additional checks. It enforces certain language properties of Kotlin that are normally optional, such as specifying visibility modifiers, as well as explicit typing for any public declarations, in order to prevent mistakes when designing the public API of your library. One additional feature is the new Explicit API mode for authors of libraries written in Kotlin. You can read more about new language features such as: mixing named and positional arguments, trailing comma, callable reference improvements, and using break and continue inside when included in loops on the Kotlin 1.4 release notes page. In Kotlin 1.4 you can now mark your Kotlin interfaces as functional and get them to work in a similar manner by adding the fun keyword: having just a Single Abstract Method - SAM) defined in the Java programming language benefited from the shorthand syntax in Kotlin:Įxecutor.execute Previously, only functional interfaces (i.e. New language features introduced in Kotlin 1.4 improve the ergonomics of writing Kotlin code. You can read more about Kotlin 1.4 in the official announcement. Below you'll find a brief rundown of some exciting new features in this release. Today we are excited to share the news about the Kotlin 1.4 release, the next milestone in the evolution of Kotlin, which contains new language features, improved compilers and tools. As Kotlin has grown, we’ve seen continued investment in the language from JetBrains (Kotlin's creators), the open source community, and increasingly our own teams at Google. When we adopted Kotlin as a supported language on Android, and then shifted to a Kotlin-first approach, one of the main drivers was the excitement and adoption from the developer community. Posted by Wojtek Kaliciński, Developer Advocate, Android
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |