Kotlin 1.0.0 Beta Candidate
Pre-release
Pre-release
abreslav
released this
22 Oct 12:12
·
91715 commits
to master
since this release
Language
- Imports from objects
@Deprecated
supportsERROR
andHIDDEN
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 tosetparam
@UnsafeVariance
annotationfun foo<T>()
deprecated in favor offun <T> foo()
- Constraints on type parameters should occur either in
where
or in<…>
x is Array<Foo>
forbidden in favor ofx is Array<*> && x.isArrayOf<Foo>()
- Callable references restricted to support bound references later
PropertyMetadata
deprecated in favor ofKProperty<*>
if
with noelse
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 propertiesList.remove(int)
is renamed toremoveAt
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 behaviorRegex
API changes:matchEntire
added,match
/matchAll
renamed tofind
/findAll
, alsoregex in string
can be used isntead ofregex.hasMatch(string)
listOf()
doesn't make a defensive copyStringBuilder {}
function deprecated in favor ofbuildString {}
- Rename:
merge
->zip
,join
removed (usejoinToString
),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 functionsisFoo()
instead ofgetIsFoo()
for properties namedisFoo
- Old package facades are dropped
- Inheritance rules comply with Java 8
is
distinguishesMutableList
fromList
and supports functions of different aritiesInt
,String
and other basic types areSerializable
@JvmField
is required to make something a fieldINSTANCE
for objects (instead ofINSTANCE$
)- Constant pool stings are resued to reduce metadata sizes
@KotlinSignature
is deprecated- Java sees defaul implementations of methods in the interface
Foo
as statics inFoo.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