Skip to content

Releases: JetBrains/kotlin

1.0.1

17 Mar 13:15
Compare
Choose a tag to compare

Compiler

Analysis & diagnostics issues fixed:

  • KT-2277 Local function declarations are now checked for overload conflicts
  • KT-3602 Special diagnostic is reported now on nullable ‘for’ range
  • KT-10775 No compilation exception for empty when
  • KT-10952 False deprecation warnings removed
  • KT-10934 Type inference improved for whens
  • KT-10902 Redeclaration is reported for top-level property vs classifier conflict
  • KT-9985 Correct handling of safe call arguments in generic functions
  • KT-10856 Diagnostic about projected out member is reported correctly on calls with smart cast receiver
  • KT-5190 Calls of Java 8 Stream.collect
  • KT-11109 Warning is reported on Strictfp annotation on a class because it's not supported yet
  • KT-10686 Support generic constructors defined in Java
  • KT-6958 Fixed resolution for overloaded functions with extension lambdas
  • KT-10765 Correct handling of overload conflict between constructor and function in JPS
  • KT-10752 If inferred type for an expression refers to a non-accessible Java class, it's a compiler error to prevent IAE in runtime
  • KT-10913, KT-10186, KT-5198 False “unreachable code” fixed for various situations
  • Minor: KT-3680, KT-9702, KT-8776, KT-6745, KT-10919, KT-9548

JVM code generation issues fixed:

  • KT-11153 NoClassDefFoundError is fixed on primitive iterators during boxing optimization
  • KT-7319 Correct parameter names for @JvmOverloads-generated methods
  • KT-10425 Non-const values of member properties are not inlined now
  • KT-11163 Correct calls of custom compareTo on primitives
  • KT-11081 Reified type parameters are correctly stored in anonymous objects
  • KT-11121 Generic properties generation is fixed for interfaces
  • KT-11285, KT-10958 Special bridge generation refined
  • KT-10313, KT-11190, KT-11192, KT-11130 Diagnostics and bytecode fixed for various operations with Long
  • KT-11203, KT-11191, KT-11206, KT-8505, KT-11203 Handling of increment / decrement for collection elements with user-defined get / set fixed
  • KT-9739 Backticked names with spaces are generated correctly

JS translator issues fixed:

Standard library

  • KT-10579 Improved performance of sum() and average() for arrays
  • KT-10821 Improved performance of drop() / take() for sequences

IDE

New features:

  • Compatibility with IDEA 2016
  • Kotlin Education Plugin (for IDEA 2016)
  • KT-9752 More usable file chooser for "Move declaration to another file"
  • KT-9697 Move method to companion object and back

General issues fixed:

  • KT-11277 Correct moving of Java classes from project view
  • KT-11256 Navigate Declaration fixed for Java classes with @NotNull parameter in constructor
  • KT-10553 A warning provided when Refactor / Move result is not compilable due to visibility problems
  • KT-11039 Parameter names are now not missing in parameter info and completion for compiled java code used from kotlin
  • KT-10204 Highlight usages in file is working now for function parameter
  • KT-10954 Introduce Parameter (Ctrl+Alt+P) fixed when default value is a simple name reference
  • KT-10776 Intentions: "Convert to lambda expression" works now for empty function body
  • KT-10815 Generate equals() and hashCode() is no more suggested for interfaces
  • KT-10818 "Initialize with constructor parameter" fixed
  • KT-8876 "Convert member to extension" now removes modality modifiers (open / final)
  • KT-10800 Create enum entry now adds comma after a new entry
  • KT-10552 Pull Members Up now takes visibility conflicts into account
  • KT-10978 Partially fixed, completion for JOOQ became ~ 10 times faster
  • KT-10940 Reference search optimized for convention functions
  • KT-9026 Editor no more locks up during scala file viewing
  • KT-11142, KT-11276 Darkula scheme appearance corrected for Kotlin
  • Minor: KT-10778, KT-10763, KT-10908, KT-10345, KT-10696, KT-11041, KT-9434

Configuration issues fixed:

  • KT-11213 Kotlin plugin version corrected in build.gradle
  • KT-10918 "Update Kotlin runtime" action does not try to update the runtime coming in from Gradle
  • KT-11072 Libraries in maven, gradle and ide systems are never more detected as runtime libraries
  • KT-10489 Configuration messages are aggregated into one notification
  • KT-10831 Configure Kotlin in Project: "All modules containing Kotlin files" does not list modules not containing Kotlin files
  • KT-10366 Gradle import: no fake "Configure Kotlin" notification on project creating

Debugger issues fixed:

  • KT-10827 Fixed debugger stepping for inline calls
  • KT-10780 Breakpoints in a lazy property work correctly
  • KT-10634 Watches can now use private overloaded functions
  • KT-10611 Line breakpoints now can be created inside lambda in init block
  • KT-10673 Breakpoints inside lambda are no more ignored in presence of crossinline function parameter
  • KT-11318 Stepping inside for each is optimized
  • KT-3873 Editing code while standing on breakpoint is optimized
  • KT-7261, KT-7266, KT-10672 Evaluate expression applicability corrected

Tools

Kotlin 1.0.0

15 Feb 12:01
Compare
Choose a tag to compare

Welcome Kotlin 1.0.0 — the first official release of the Kotlin programming language!

Find installation instructions and documentation here.

This release is a result of over five years of hard work. Below, find the changes made since the RC build.

Library

  • KT-5587 Make Throwable#message and Throwable#cause open
  • kotlin.Metadata annotation is used instead of KotlinClass
  • Old metadata annotations deleted from the kotlin.jvm.internal package
  • KT-10462: Use HALF_EVEN rounding mode by default for BigDecimal division operator.
  • Default buffer size for IO operations changed to 8K (same default as in Java's BufferedReader).
  • Last deprecations dropped

Compiler

  • KT-10858 Proguard issue with inline-only functions in multi-file classes
  • KT-10939 CANNOT_COMPLETE_RESOLVE for inherited generic interface method
  • KT-10595 Internal visibility fixed for Gradle projects in IntelliJ IDEA 16
  • KT-10934 UninferredParameterTypeConstructor exception fixed for exhaustive when
  • KT-10896 Wrong inference of if / else result type fixed
  • RoboVM incompatibility fixed

Kotlin 1.0.0 Release Candidate

04 Feb 13:36
Compare
Choose a tag to compare
Pre-release

Important notes

To get rid of all the old code, this version requires recompilation of all dependencies.

EAP users must recompile their code as well, although the compiler won't demand this (IllegalAccessError is likely to be thrown at runtime)

What's new

  • Language
    • new @delegate: use-site target for annotation (e.g. @delegate:Transient)
    • private top-level Kotlin classes should be compiled to package private java classes
    • unfinished multiline comment is an error
    • previously deprecated language constructs are now errors
    • type ckecking for use-site variance fixed
    • generic functions are compared for specificity through solving a constraint system
    • having multiple vararg parameters for one function is prohibited
    • super-calls to functions with default parameters are prohibited (pass all arguments explicitly)
    • implicit receiver behavior fixed
    • as-import removes original names if they were imported before
    • user code is not allowed in kotlin.** packages
    • type parameters of extension properties allowed to be indirectly used by the receiver type
    • members of private classes can-not be accessed from non-private inline functions
  • Java interop
    • forEach from Kotlin's library is preferred to forEach from java.lang.Iterable
    • synthesized declarations (like JavaBeans properties and SAM-converted methods) are now resolved on par with members
    • support added for Java setters that return values
    • previously depreacted Java declarations removed from generated code
    • private setters allowed for lateinit properties
    • wildcards are not generated for redundant type projections (use List<@JvmWildcard Foo> instead of List<out Foo>)
    • @Nullable/@NotNull annotations from different standard Java packages recognized (javax.annotations, Guava, Android, etc)
  • Standard Library
    • diagnostics for multiple conflicting Kotlin runtime versions in classpath
    • some functions have been made inline
    • many inline functions (most of them one-liners) can no longer be called from Java code. This will help us reduce the size of the runtime library in the future.
    • library code rearranged into more granular packages (no source changes should be required)
    • associate and associateBy are added to aid construction of maps
      associate and associateBy (instead of toMap/toMapBy)
    • groupBy with key- and value-selector functions
    • Map.getOrElse() and Map.getOrPut() now treat keys associated with null values as missing.
    • Map.getOrImplicitDefault() has been made internal
    • mutableListOf, mutableSetOf, mutableMapOf added to construct mutable collections. linkedListOf is deprecated
    • toMutableList added instead of toArrayList. The latter is deprecated
    • kotlin.system.exitProcess instead of System.exit
    • File.deleteRecursively only returns false in case of incomplete deletion
    • File.copyRecursively allows overwriting by specifying argument overwrite=true
    • changed File.copyTo behavior to be like Files.copy from JDK8.
    • more specific return type for File.inputStream, File.outputStream, String.byteInputStream.
    • IO utility functions taking charset name as a string are deprecated, use ones with Charset parameter.
    • File.useLines and Reader.readLines are introduced
    • File.(buffered)reader/writer now return less specific InputStreamReader/OutputStreamWriter and use UTF-8 encoding by default
    • Sequence and Iterable SAM constructor-like functions
    • Comparator- and comparison-related functions are moved to kotlin.comparisons package (not imported by default)
    • new properties in MatchResult: groupValues and destructured — provided for easier handling of regular expression match results
    • Lazy is now an interface open for implementation
    • kotlin.system.measureTimeNano renamed to measureNanoTime.
    • plusElement and minusElement functions as a synonyms for list + element and list - element.
    • kotlin.test.assertFailsWith with Class<T> parameter is deprecated, use an overload with KClass<T>.
    • toLinkedMap is deprecated.
    • UTF_32 charset properties added to Chatsets
  • Tools
    • To enable Android Extensions, use: apply plugin: 'kotlin-android-extensions'
  • IDE
    • Intention to replace iteration over map entries with a loop using a destructuring declaration
    • Inspection and quickfix to cleanup redundant visibility modifiers
    • Inspection to replace 'assert' calls checking that a variable is not null with !! or ?: error(...)
    • Show "Kotlin not configured" notification when opening a .kt file in the IDE if the Kotlin runtime is not configured for the corresponding module
    • Action to generate the toString() method
    • Support for implementing members by primary constructor parameters
    • Parameter info popup works for showing type parameters
    • Completion offers name variants based on unresolved identifiers in current file
    • Quickfix for adding missing branches to a when expression
    • Support for moving nested classes to the upper level or into another top-level class
    • @Suppress now works for IDE inspections

Kotlin 1.0.0 Beta 4 Update 2

20 Jan 11:47
Compare
Choose a tag to compare
Pre-release

Bugfix update:

  • Gradle Plugin for Android
  • Instant Run support for Android Studio
  • Compatibility with IntelliJ IDEA 16

Kotlin 1.0.0 Beta 4

24 Dec 16:35
Compare
Choose a tag to compare
Kotlin 1.0.0 Beta 4 Pre-release
Pre-release

Hot-fix update: Wrong JDK in class path for Android

See What's new here

Kotlin 1.0.0 Beta 4

22 Dec 18:24
Compare
Choose a tag to compare
Kotlin 1.0.0 Beta 4 Pre-release
Pre-release

Language

  • Primary constructor is resolved in the same scope as secondary constructors
  • yield is reserved as a keyword
  • async is reserved in some contexts
  • typeof is reserved as a keyword. In JS, use jsTypeOf()
  • sealed when reserved
  • Multiple fixes in the overload resolution algorithm.
    • The curious case of File.listFiles
  • KPropertyN now extend FunctionN, i.e. list.map(String::length) works now
  • Duplicate bounds for type parameters forbidden
  • Multiple class bounds for type parameters forbidden
  • Array<Nothing> and Array<Nothing?> are prohibited
  • if with no else is not an expression
  • values() and valueOf() in enums are preferred to member of companion objects
  • Better scheme of translation of variant types to Java
  • @JvmSuppressWildards and @JvmWildcard added
  • Statics inherited by companion object are visible without qualification in the outer class and its subclasses
  • Absolute package references dropped. Use alias imports instead
  • Overloads are compared according to actual arguments only
  • Deprecations lifted to errors: Enum.values, local sealed classes, private setter for open property

Library

  • kotlin-test.jar extracted
  • Extensions are moved to specific packages (no source changes required for Kotlin code)
  • javaPrimitiveType and javaObjectType added for KClass
  • IntArray(5) { it * 3 } and other initializers supported for primitive arrays
  • Semantics of null in maps is going to change
  • minWith(comparator)/maxWith(comparator) supported
  • toMap((T) -> Pair<K,V>)` supported
  • FileTreeWalk:
    • constructor is deprecated, preferred construction with fluent builder methods
    • treeFilter is deprecated, recursive filtering now happens in onStart
  • File utilities behavior changes and deprecations

IDE

  • New precise incremental compilation (experimental)
  • Rename for unresolved references
  • Create From Usage for callable references
  • Go to Test and Create Test for top-level functions
  • Intention to convert anonymous function to a lambda
  • Go to Class and Search Everywhere show Kotlin built-in types
  • Debugger: Skip simple getters supported

Kotlin 1.0.0 Beta 3

07 Dec 11:49
Compare
Choose a tag to compare
Kotlin 1.0.0 Beta 3 Pre-release
Pre-release

What's new

  • Library
    • increment deprecated in Progressions in favor of step property to Progressions, for-loops updated to refer to step
    • contains() and other similar extensions now accept supertypes of the element of the collection
    • Delegates.mapVal and mapVar, MapVal, MapVar, FixedMapVal, FixedMapVar are deprecated
    • String.toCharArray() introduced instead of String.getChars(); String.toCharList() deprecated
    • MutableCollection.removeAll(predicate: (T) -> Boolean) and similar for retainAll added
    • sequence(initialValueFunction, nextValueFunction) doesn't evaluate first value until it's requested by sequence iterator
    • sequenceOf(Progression) deprecated
    • flatten operation for Sequence<Iterable<...>> added
  • Language
    • No references to PropertyMetadata are generated in the byte code
    • Suffixes to numeric literals, such as 1baz are prohibited
    • Comma-separated conditions in when without an argument are prohibited (KT-5143)
    • Annotation classes can't be instantiated (KT-4391)
    • Arrays of annotations supported as annotation arguments (KT-10136)
    • Generic types in catch clauses (including reified T) are prohibited (KT-9816)
    • protected members are allowed in companion objects
    • Calls to non-@JvmStatic protected members of companion objects from subclasses are marked as errors (unsupported)
    • "" is reserved as a token (KT-9708)
    • Enum entry can not be used as a type (KT-5401)
    • Enum.values is deprecated in favor of Enum.values()
    • private setters are now deprecated for open properties
    • Local sealed classes are deprecated
    • Use of uninitialized variables in lambdas / object literals / local functions is forbidden
    • Overriding setter cannot weaken visibility
    • Inner classes are no longer allowed inside enum entries
    • Implicit receiver smart casts are supported
    • Older deprecations have become errors

build-1.0.0-beta-3594

04 Dec 09:36
Compare
Choose a tag to compare
build-1.0.0-beta-3594 Pre-release
Pre-release

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