Releases: JetBrains/kotlin
Releases · JetBrains/kotlin
Kotlin 1.0.0 Beta 3
What's new
- Library
incrementdeprecated in Progressions in favor ofstepproperty to Progressions,for-loops updated to refer tostepcontains()and other similar extensions now accept supertypes of the element of the collectionDelegates.mapValandmapVar,MapVal,MapVar,FixedMapVal,FixedMapVarare deprecatedString.toCharArray()introduced instead ofString.getChars();String.toCharList()deprecatedMutableCollection.removeAll(predicate: (T) -> Boolean)and similar forretainAlladdedsequence(initialValueFunction, nextValueFunction)doesn't evaluate first value until it's requested by sequence iteratorsequenceOf(Progression)deprecatedflattenoperation forSequence<Iterable<...>>added
- Language
- No references to
PropertyMetadataare generated in the byte code - Suffixes to numeric literals, such as
1bazare prohibited - Comma-separated conditions in
whenwithout 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)
protectedmembers are allowed in companion objects- Calls to non-
@JvmStaticprotectedmembers 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.valuesis deprecated in favor ofEnum.values()privatesetters are now deprecated foropenproperties- Local
sealedclasses 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
- No references to
build-1.0.0-beta-3594
Kotlin 1.0.0 Beta 2
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
DoubleandFloatprogressions are droppedByteandShortprogressions are deprecated, the..operator for bytes and shorts now returnsIntRangeRange<T>renamed toClosedRange<T>and itsendproperty renamed toendInclusiveProgression<T>is deprecated in favor of concrete progression implementations instead:IntProgression,LongProrgession,CharProgressionstartandendproperties in progressions are renamed tofirstandlast
kotlin.domandkotlin.browsermoved out as a separate library: kotlinx.dom- Strings/CharSequences
- String utility extensions were generalized to take
CharSequencewhere possible
- String utility extensions were generalized to take
- Added
- in-place reversing and sorting for
MutableLists andArrays naturalOrderandreverseOrdercomparatorsmapNotNull,mapIndexedNotNull,filterIndexedString.toByte()
- in-place reversing and sorting for
- Сhanged
- Explicit type parameter specification for
filterIsInstancenow is required
- Explicit type parameter specification for
- Deprecated
Function.toGeneratortoLinkedList
- Dropped
join,mergeDelegates.lazyFileTreeWalk.filter,File.recurse,BufferedReader.linesandlineIteratorassert,checkandrequirewith non-lazy message argument
- Ranges
- 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
- Completion of java static members and members from objects on second
Kotlin 1.0. Beta
Bug fixes
- Semantics of companion object initialization fixed,
INSTANCEfield deprecated for companion objects - Use-site targets fixed for
@JvmName - Exposing Java package-private types through
internaldeclarations is allowed - Access to
Enum.valuesfrom within enums fixed - Issues with Android 4 and
DefaultImplsclasses 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
Language
- Imports from objects
@DeprecatedsupportsERRORandHIDDENlevels (@HiddenDeclarationis deprecated)- Smart casts for captured local
var's that are not modified in lambdas - Single-file classes can have many
main()'s internalvisibility checked in the compiler- No defensive copying needed for varargs
- All Java methods with matching signatures are operators
- Rename:
unaryMinus/unaryPlusfor unary operators - Rename:
getValue/setValuefor delegated properties - Checks for operator signatures at declarations sites
infixmodifier for infix functions- Rename
sparamannotation target tosetparam @UnsafeVarianceannotationfun foo<T>()deprecated in favor offun <T> foo()- Constraints on type parameters should occur either in
whereor in<…> x is Array<Foo>forbidden in favor ofx is Array<*> && x.isArrayOf<Foo>()- Callable references restricted to support bound references later
PropertyMetadatadeprecated in favor ofKProperty<*>ifwith noelsein expression position is an error- Letters and digits right before/after string and char literals are prohibited
invokeconvention for extension functions is removed- Visibility requirements for members
- Protected members in objects are prohibited
finalin 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.() -> Fooare prohibited Foo<Int>.Baris 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
inlineproperties are prohibited;;is reserved for future use
Libraries
- Formerly deprecated declarations have been dropped
size(),length()etc are made propertiesList.remove(int)is renamed toremoveAtCollection<E>.contains(Any?),Map<K, V>.get(Any?)and other similar function are now type-safe:contains(E),get(K)containsRaw,getRawextensions and alike are defined for the Java-like utyped behaviorRegexAPI changes:matchEntireadded,match/matchAllrenamed tofind/findAll, alsoregex in stringcan be used isntead ofregex.hasMatch(string)listOf()doesn't make a defensive copyStringBuilder {}function deprecated in favor ofbuildString {}- Rename:
merge->zip,joinremoved (usejoinToString),mapNotNulldeprecated 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
internalfunctions and properties are mangled - Kotlin classes see inherited statics and members of inherited companion objects
@Synchronizedand@Volatileare inapplicable to unimplemented functionsisFoo()instead ofgetIsFoo()for properties namedisFoo- Old package facades are dropped
- Inheritance rules comply with Java 8
isdistinguishesMutableListfromListand supports functions of different aritiesInt,Stringand other basic types areSerializable@JvmFieldis required to make something a fieldINSTANCEfor objects (instead ofINSTANCE$)- Constant pool stings are resued to reduce metadata sizes
@KotlinSignatureis deprecated- Java sees defaul implementations of methods in the interface
Fooas statics inFoo.DefaultImplsclass - Constants from Java libraries are inlined into Kotlin byte code
@publicFieldis 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
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
privateon the top level is now private to fileinternalis checked in the compiler (not only IDE)privatein interfaces is truly private nowequalsin data classes compares arrays by calling their.equals()method (which works by identity)lateinitval‘s are prohibited- many cases of inheritance and other degrees of freedom are prohibited for data classed (see this blog post)
protectedandinternalmembers 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
lateinitpropertiessealedclasses- 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 publicby defaultprivateon the top level means private to current source fileinternalvisibility checked between modules- overload resolution on callable references
- unambiguous
super-calls do not require angle brackets
- Java interop
- Java
get/setpairs are now seen as properties - New layout of class files: each source file is compiled to
FileNameKt.classby default @file:JvmName("ClassName")to customize the name of the class@file:JvmMultifileClassto share the same class name across many files in the same package@NotNulland@Nullabletypes 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
forloops
M12 bugfix update
build-0.12.613
M12 bugfix update
build-0.12.412