Releases: JetBrains/kotlin
Releases · JetBrains/kotlin
Kotlin M14
What's new
- Language
- New syntax for backing field access
- Operators require a modifier (
operator
) - Compile-time constants are prefixed with
const
- Annotations on file classes supported
private
on the top level is now private to fileinternal
is checked in the compiler (not only IDE)private
in interfaces is truly private nowequals
in data classes compares arrays by calling their.equals()
method (which works by identity)lateinit
val
‘s are prohibited- many cases of inheritance and other degrees of freedom are prohibited for data classed (see this blog post)
protected
andinternal
members are prohibited in interfaces_
,__
,___
are forbidden as in identifiersidentityEquals()
function is deprecated in favor of===
- Standard Library API subdivided into part classes such as
CollectionsKt
- IDE
- Introduce backing property refactoring
- Move property initializer to declaration refactoring
- Add unambiguous imports on-the-fly
- Completion for overridden members
Kotlin M13 bugfix update
Bugfix update to 0.13.1513
- ProGuard issues fixed
Kotlin M13
What's New
- Language
lateinit
propertiessealed
classes- all annotations require
@
- annotation classes named starting with capital letter
- some former annotations turned into modifiers (
data
,inline
,noinline
,tailrec
,external
, etc.) - annotation options:
@Target
,@Retention
,@Repeatable
,@MustBeDocumented
- no requirement to specify return type explicitly for
public
public
by defaultprivate
on the top level means private to current source fileinternal
visibility checked between modules- overload resolution on callable references
- unambiguous
super
-calls do not require angle brackets
- Java interop
- Java
get
/set
pairs are now seen as properties - New layout of class files: each source file is compiled to
FileNameKt.class
by default @file:JvmName("ClassName")
to customize the name of the class@file:JvmMultifileClass
to share the same class name across many files in the same package@NotNull
and@Nullable
types loaded from Java
- Java
- Library
- fully functional reflection
+
and-
for sets and other collections- improved delegates for properties
- Tools
- compiler daemon keeps the compiler in memory between builds
- incremental compilation is smarter with inline functions and privates
- Java2Kotlin converter supports method references
- IntelliJ IDEA plugin
- Pull Members Up/Down refactoring
- Debugger support for lambdas and inline functions
- Completion for parameter names and types
- Highlighting for unused imports
- Imports are optimized on-the-fly
- New intentions for
for
loops
M12 bugfix update
build-0.12.613
M12 bugfix update
build-0.12.412
Kotlin M12
What's New
- Language
- @-based annotation syntax
- New label syntax (
name@
) KClass
instead ofjava.lang.Class
used in annotationsconstructor
keyword in primary constructorstrait
replaced withinterface
- New syntax for
enums
: delimiters and constructor calls - Unified Function types
- Smart casts for local
var
's - Smart casts for public/protected
val
's within the same module - Inlining and non-local returns for function expressions
- Deprecations/Removals:
break
andcontinue
inwhen
- interfaces that extend classes
- covariant supertype specialization
- static type assertions
- Java Interop
- Source maps (JSR-45) for better debugging of inline functions
- Initial support for Annotation Processing (JSR-269)
- [deprecation] Only
value
can be passed as positional to Java annotations
- JavaScript
- Inlining works between modules
- Reified parameters
- Function expressions
- Secondary constructors
- JUnit support in Gradle plugin for Android
- Standard Library
kotlin.io
- new text utilities
- regular expressions API unified across JVM and JS
- new collections utilities
- full list available here
- IntelliJ IDEA Plugin
- Introduce Parameter
- Introduce Lambda Parameter
- Rename for related declarations (variables, subclasses)
@ReplaceWith
annotation for deprecated declarations- Debugger
- Evaluate expression for local functions
- Field Watch Points (only for properties with backing field)
- Change Package Intention
- Highlighting exit points of functions
- Gutter Marks for recursive calls
- Unused receiver parameter
- Code style settings for imports (e.g. we can now always import specified packages with '*')
- Java2Kotlin Converter now offers to update usages in other files
- Typing '!' when completion list is open inserts negated call (e.g.
!foo.isEmpty()
) - Intention actions to change visibility modifiers
- Intention actions have much better scope of availability now
- Quick-fix to add parameters from the base class when the superclass' constructor has parameters
Kotlin M11.1
Bugfix update
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