Skip to content

Releases: JetBrains/kotlin

Kotlin 1.0.0 Beta 2

16 Nov 16:52
Compare
Choose a tag to compare
Kotlin 1.0.0 Beta 2 Pre-release
Pre-release

What's New

  • Language
    • Single-instantiation inheritance for type parameters
    • More precise "smart cast impossible" (the reason is given now)
    • "Always null" warningadded
  • Library
    • Ranges
      • Double and Float progressions are dropped
      • Byte and Short progressions are deprecated, the .. operator for bytes and shorts now returns IntRange
      • Range<T> renamed to ClosedRange<T> and its end property renamed to endInclusive
      • Progression<T> is deprecated in favor of concrete progression implementations instead: IntProgression, LongProrgession, CharProgression
      • start and end properties in progressions are renamed to first and last
    • kotlin.dom and kotlin.browser moved out as a separate library: kotlinx.dom
    • Strings/CharSequences
      • String utility extensions were generalized to take CharSequence where possible
    • Added
      • in-place reversing and sorting for MutableLists and Arrays
      • naturalOrder and reverseOrder comparators
      • mapNotNull, mapIndexedNotNull, filterIndexed
      • String.toByte()
    • Сhanged
      • Explicit type parameter specification for filterIsInstance now is required
    • Deprecated
      • Function.toGenerator
      • toLinkedList
    • Dropped
      • join, merge
      • Delegates.lazy
      • FileTreeWalk.filter, File.recurse, BufferedReader.lines and lineIterator
      • assert, check and require with non-lazy message argument
  • IDE
    • Completion of java static members and members from objects on second Ctrl-Space
    • Intention action to import Java statics, object members or enum entries
    • Intention action to import all Java static members from the given class or enum entries from the given enum class
    • Completion in string templates works after "$name."
    • Debugger supports choosing where to put a breakpoint: inside or outside a single-lined lambda

Kotlin 1.0. Beta

02 Nov 10:38
Compare
Choose a tag to compare
Kotlin 1.0. Beta Pre-release
Pre-release

Bug fixes

  • Semantics of companion object initialization fixed, INSTANCE field deprecated for companion objects
  • Use-site targets fixed for @JvmName
  • Exposing Java package-private types through internal declarations is allowed
  • Access to Enum.values from within enums fixed
  • Issues with Android 4 and DefaultImpls classes fixed
  • Method count optimized for delegated properties on Android
  • Two main() functions can't appear in the same file

Kotlin 1.0.0 Beta Candidate

22 Oct 12:12
Compare
Choose a tag to compare
Pre-release

Language

  • Imports from objects
  • @Deprecated supports ERROR and HIDDEN levels (@HiddenDeclaration is deprecated)
  • Smart casts for captured local var's that are not modified in lambdas
  • Single-file classes can have many main()'s
  • internal visibility checked in the compiler
  • No defensive copying needed for varargs
  • All Java methods with matching signatures are operators
  • Rename: unaryMinus/unaryPlus for unary operators
  • Rename: getValue/setValue for delegated properties
  • Checks for operator signatures at declarations sites
  • infix modifier for infix functions
  • Rename sparam annotation target to setparam
  • @UnsafeVariance annotation
  • fun foo<T>() deprecated in favor of fun <T> foo()
  • Constraints on type parameters should occur either in where or in <…>
  • x is Array<Foo> forbidden in favor of x is Array<*> && x.isArrayOf<Foo>()
  • Callable references restricted to support bound references later
  • PropertyMetadata deprecated in favor of KProperty<*>
  • if with no else in expression position is an error
  • Letters and digits right before/after string and char literals are prohibited
  • invoke convention for extension functions is removed
  • Visibility requirements for members
  • Protected members in objects are prohibited
  • final in interfaces is prohibited
  • Visibility for local classes is prohibited
  • Local interfaces are prohibited
  • Private setters for non-private lateinit vars are prohibited
  • Nothing-returning functions must declare return type explicitly
  • Annotations on multi-declarations are prohibited
  • Checks for escaped identifiers (backticks) to conform to JVM requirements
  • Supertypes of the form T.() -> Foo are prohibited
  • Foo<Int>.Bar is prohibited
  • Type parameters for properties are prohibited unless they are used in the receiver type
  • Parameter annotations and default values in function types are prohibited
  • inline properties are prohibited
  • ;; is reserved for future use

Libraries

  • Formerly deprecated declarations have been dropped
  • size(), length() etc are made properties
  • List.remove(int) is renamed to removeAt
  • Collection<E>.contains(Any?), Map<K, V>.get(Any?) and other similar function are now type-safe: contains(E), get(K)
  • containsRaw, getRaw extensions and alike are defined for the Java-like utyped behavior
  • Regex API changes: matchEntire added, match/matchAll renamed to find/findAll, also regex in string can be used isntead of regex.hasMatch(string)
  • listOf() doesn't make a defensive copy
  • StringBuilder {} function deprecated in favor of buildString {}
  • Rename: merge -> zip, join removed (use joinToString), mapNotNull deprecated to be changed later

Java interop

  • Java classes inherit static from supertypes
  • List<Nothing> is compiled to raw List to facilitate subtyping in Java
  • Support "static overrides" for Java fields
  • Top-level privates are private to file
  • Names of internal functions and properties are mangled
  • Kotlin classes see inherited statics and members of inherited companion objects
  • @Synchronized and @Volatile are inapplicable to unimplemented functions
  • isFoo() instead of getIsFoo() for properties named isFoo
  • Old package facades are dropped
  • Inheritance rules comply with Java 8
  • is distinguishes MutableList from List and supports functions of different arities
  • Int, String and other basic types are Serializable
  • @JvmField is required to make something a field
  • INSTANCE for objects (instead of INSTANCE$)
  • Constant pool stings are resued to reduce metadata sizes
  • @KotlinSignature is deprecated
  • Java sees defaul implementations of methods in the interface Foo as statics in Foo.DefaultImpls class
  • Constants from Java libraries are inlined into Kotlin byte code
  • @publicField is deprecated

Tools

  • Compiler daemon enabled by default in the IDE
  • Parallel Compilation of Independent Modules in the daemon mode
  • External annotations support removed

IDE

  • Parameter Info everywhere
  • Completion for callable references after ::
  • Actions to generated equals()/hashCode()
  • Actions to generate secondary constructors
  • '*'-imports configuration
  • Unit-testing support

Kotlin M14

01 Oct 12:16
Compare
Choose a tag to compare
Kotlin M14 Pre-release
Pre-release

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 file
    • internal is checked in the compiler (not only IDE)
    • private in interfaces is truly private now
    • equals 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 and internal members are prohibited in interfaces
    • _, __, ___ are forbidden as in identifiers
    • identityEquals() 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

23 Sep 22:40
Compare
Choose a tag to compare
Pre-release

Bugfix update to 0.13.1513

  • ProGuard issues fixed

Kotlin M13

16 Sep 14:03
Compare
Choose a tag to compare
Kotlin M13 Pre-release
Pre-release

What's New

  • Language
    • lateinit properties
    • sealed 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 default
    • private on the top level means private to current source file
    • internal 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
  • 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

29 Jun 14:49
Compare
Choose a tag to compare
M12 bugfix update Pre-release
Pre-release
build-0.12.613

M12 bugfix update

10 Jun 11:49
Compare
Choose a tag to compare
M12 bugfix update Pre-release
Pre-release
build-0.12.412

Kotlin M12

29 May 12:27
Compare
Choose a tag to compare
Kotlin M12 Pre-release
Pre-release

What's New

  • Language
    • @-based annotation syntax
    • New label syntax (name@)
    • KClass instead of java.lang.Class used in annotations
    • constructor keyword in primary constructors
    • trait replaced with interface
    • 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 and continue in when
      • 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

27 Mar 18:16
Compare
Choose a tag to compare
Kotlin M11.1 Pre-release
Pre-release

Bugfix update