Releases: JetBrains/kotlin
Releases · JetBrains/kotlin
Kotlin M11
- Language
- Secondary constructors
- [deprecation]
init
prefix for anonymous initializers - [deprecation] Companion Objects
- Function Expressions
- [deprecation] Lambda Syntax Restricted (to be extended later with multi-declarations)
- Labeled returns without return type specification
- Order-agnostic imports
- Reflection
- Class Literals
- API for retrieving properties of a class
- API for converting
java.lang.Class
<->KClass
etc
- Java Interop
- Warnings for annotated Java types
Int.MAX_VALUE
etc
- IDE
- Unused Declarations
- Change Signature: receiver <-> parameter
- Function <-> Property
- Create From Usage: Java interop
- Create constructor parameter from usage
- Introduce Property
- KDoc support
- Optimize/sort imports
- Debugger: Evaluate Expression
- Lambdas
- Anonymous objects
- Gradle
- Java and Kotlin in the same source root
- Libraries
Stream
renamed toSequence
- New API Docs
- JS
- Binary Libraries
- Inlining from linaries
- Android
kotlin-android-extensions
eliminate the need infindViewById()
M10.1
Kotlin M10
What's new:
- Language
- Dynamic types (supported only when compiled to JavaScript)
- Type inference supports capture for use-site variance
- [breaking change] Reified type parameters for inline-functions
- [breaking change] varargs are translated to
Array<out T>
instead ofArray<T>
- Java Interop
- Static backing fields for properties in objects
[platformStatic]
supported for properties[native]
annotation and JNI supported- HotSwap fixed in debugger (used to break because of lambdas)
- Support for safe calls in assignments:
a?.b = c
- JavaScript Interop
- Dynamic types (mentioned above)
js("string")
function to write inline JS code[nativeInvoke]
,[nativeGetter]
and[nativeSetter]
annotations- Escaping JS-keywords in generated code
- No "unused" warnings in
native
declarations -no-stdlib
CLI option
- Standard Library
- [potentially breaking change]
Array.size()
andCharSeqence.length()
are functions now - [potentially breaking change]
CharSequence
:charAt()
andsubsequence()
introduced,get()
is now an extension mapIndexed
,withIndex
,forEachIndexed
- [deprecation]
size
/length
/first
/head
/tail
/last
properties - empty list/set/map singletons
- comparator functions (
compareBy
,thenBy
) - reified API (
filterIsInstance
, …) componentN
functions on collections:val (x, y) = “a=b”.split(“=”)
- [potentially breaking change]
- IDE/Compiler
- Incremental compilation in mixed Kotlin/Java projects
- Completion inserts casts to run-time types in Evaluate Expression
- Copy Reference supported for Kotlin classes
- Create From Usage supports type arguments, classes and packages
- Change Signature interoperates with Java and supports type parameters
- Applications runner supports
main()
function in objects - Automatic stdlib updates for JS, support for using library from plugin
- Maven projects configuration for JS
- Code Coverage information in editor (in IntelliJ IDEA 14)
- Completion improvements: inheritors, sorting and highlighting members
- Performance optimizations: memory in the IDE, parsing time
- Build Tools
- Support for new versions of Gradle and Android Studio
Kotlin M9
What's new:
- Language
- Platform Types
- [breaking change] Local objects prohibited
- Non-local returns from inline functions
type
is no longer a keyword
- JVM
- [platformStatic] annotations
- Byte code size improvements
- Useless boxing/unboxing elimination
- JavaScript
- Language features supported: delegation, callable references,
Long
andChar
, inline functions, multiplecatch
-blocks - [breaking change] Native traits exist only at compile time
- [breaking change] New name mangling strategy
- [breaking change] Packages renamed:
js.*
andjs.debug.*
->kotlin.js.*
,kotlin.query.*
->jquery.*
- [breaking change] Changes in println() behavior
- Language features supported: delegation, callable references,
- Incremental compilation in IntelliJ IDEA (experimental)
- IDE plugin changes
- Code Duplication detection in Extract Function
- Create From Usage
- Completion takes IDE modules into account
- Find Usage and Rename respect conventions for operator overloading
- Delegated properties in debugger
- Completion improvements
- CLI
- [breaking change] Command Line options reworked
Kotlin M8
What's new:
- JVM
- Reflection for properties introduced
- Inline functions
- Inlines into objects are supported
- Default parameter values supported for inline functions
- Generated code speedups
- delegated properties work faster now
- when's with constants are faster due to dedicated bytecode instructions used
- breaking change Reporting platform signature clashes
[platformName]
annotation to resolve signature conflicts
transient
,synchronized
andstrictfp
supported on the JVM
- JS
- data classes supported
LinkedHashSet
/LinkedHashMap
supported
- Language
- breaking change
private
in a package now means "in this package and subpackages in the same module" - breaking change extension properties can't have backing fields
- breaking change Bare
@
and@@
are no longer available
- breaking change
- Standard library
slice()
- collection-like operations on strings
Map.contains
join()
for rendering separated listsString.substringBefore/After[Last]
String.replaceBefore/After[Last]
Appendable.appendln()
StringBuilder {}
Iterable.merge(other) { (v1,v2)→v }
- set operations (
union
,intersect
,subtract
)
- IDE
- IntelliJ IDEA 14 EAP supported
- Debugger
- Evaluate expression
- Smart step into
- Refactorings
- Move toplevel declarations to separate file
- Extract function (not finished, but some cases working)
- Extract local function
- Intentions
- DeMorgan law
- Flip binary expression (== etc)
- Split if
- Replace with operator sign
- Replace with traditional assignment
- Replace with infix call
- Simplify boolean expressions
- Add/Remove explicit type arguments
- assert <-> if with throw
- if <-> ?:
- !! <-> if
- make types explicit/implicit in lambda
- forEach { } <-> for loop
- string concatenation <-> interpolation
- Smart completion
- smarter on overloads
- callable references (::functionName)
- lambdas
- !! and ?: for nullable members
- anonymous classes (object expressions)
- constants in when()
- Formatter improved
- Structure view shows members of supertypes
- J2K converter improved
- Speedups in highlighting and completion
- Support for new versions of Gradle/Android (0.10, 0.11, 0.12)
Dot Operator
Release date: April 1, 2014
What's new
Limitations:
The following things are NOT implemented:
- The higher-order dots. I find this feature quite specific and less useful in practice so I guess it can be put off for a while
- Dot flavours. For me this feature looks rather confusing, so I suggest reconsidering whether it's worth implementing at all
Kotlin M7
What's new:
- Language
- Inline functions
- [breaking change]
jet
package renamed tokotlin
- [breaking change] toString(), equals() and hashCode() are now members of Any
- References to local functions
- Interop
- [throws] annotation for JVM target
- Overloading supported for JS target
- Standard Library
- [breaking change] Streams introduced
- IDE enhancements
- Rename/move refactorings improved
- Safe delete
- New intention actions
- Performance improvements
Kotlin M6.2
What's new:
- Language features
- Tail-call optimization with
[tailRecursive]
- Constant expression evaluation
- Suffixes for Longs and Floats:
1L
and1.0F
- Tail-call optimization with
- Compilation to JavaScript
- Default arguments
- Super-constructor calls
- Class-objects in traits
- Java Inteoperability
@ReadOnly
and@Mutable
for collections
- Android
- Better annotations for Android SDK
- IDE
- Support for IntelliJ IDEA 13
- Find Usages
- Compiler preferences
- Smart completion (
Ctrl+Shift+Space
) - Rename from Java
- IDE warns on misusing Kotlin APIs from Java
- Ant
- Integration with
<javac>
- Support for compilation to JavaScript
- Integration with
Kotlin M6.1
What's new:
- Language features
else
is not required inwhen
-statements- Type argument inference uses smart casts
- Ability to suppress warnings with
[suppress("...")]
annotation - Local returns in lambda expressions
- Compilation to JavaScript
- Enums
- Class Objects
- Delegated properties
- Multi-Declarations
- SourceMaps
- IntelliJ Plugin Improvements
- Automatic configuration of Maven and Gradle projects
- Convert member function to extension function
- Navigation to getters and setters of a delegated property
- Navigation to iterator/next/hasNext in a for loop
- Navigation to invoke() from a call site
- Improvements on Find Usages including support for constructors and overrides
Read more in this blog post
Kotlin M6
What's new:
- Language features
- SAM Conversions
- Annotation improvements
- Static fields visible from Java
- Android
- Integration with Gradle for Android
- Integration with Android Studio
- IDE features
- Inline variable, Safe delete and other refactorings
- TestNG support
- Faster code completion
See a detailed description in this blog post.