Kotlin 1.1-M02 发布,基于 JVM 的编程语言

来源:开源中国社区 作者:局长
  

Kotlin 1.1-M02 (Early Access Preview)发布了,这是 Kotlin 1.1 的第二个里程碑版本,也带来了大量更新。这个版本带来了让人期待已久的新语言特性,在 lambdas 表达式中的解构,同时还有许多基于 1.1-M1 的新特性改进。部分更新如下:

语言特性

  • 用于 lambdas 表达式的解构 (proposal)

    Current limitations:

    • Nested destructuring is not supported

    • Destructuring in named functions/constructors is not supported

    • Is not supported for JS target

编译器

Smart cast enhancements

  • KT-2127 Smart cast receiver to not null after a not null safe call

  • KT-6840 Make data flow information the same for assigned and assignee

  • KT-13426 Fix exception when smartcast on both dispatch & extension receiver

Bound references related issues

  • KT-12995 Do not skip generation of the left-hand side for intrinsic bound references and class literals

  • KT-13075 Fix codegen for bound class reference

  • KT-13110 Fix type mismatch error on class literal with integer receiver expression

  • KT-13172 Report error on "this::class" in super constructor call

  • KT-13271 Fix incorrect unsupported error on synthetic extension call on LHS of ::

  • KT-13367 Inline bound callable reference if it's used only as a lambda

Coroutines related issues

  • KT-13156 Do not execute last Unit-typed coroutine statement twice

  • KT-13246 Fix VerifyError with coroutines on Dalvik

  • KT-13289 Fix VerifyError with coroutines: Bad type on operand stack

  • KT-13409 Fix generic variable spilling with coroutines

  • KT-13531 Fix ClassCastException when coercion to Unit interacts with generic await() and coroutines

  • Prohibit Continuation<*> as a last parameter of suspend functions

  • KT-13560 Prohibit non-Unit suspend functions

Typealises related issues

  • KT-13200 Fix incorrect number of required type arguments reported on typealias

  • KT-13181 Fix unresolved reference for a type alias from a different module

  • KT-13161 Support java static methods calls with typealiases

  • KT-13835 Do not lose nullability information while expanding type alias in projection position

  • KT-13422 Prohibit usage of type alias to exception class as an object in 'throw' expression

  • KT-13735 Fix NoSuchMethodError for generic typealias access

  • KT-13513 Support SAM constructors for aliased java functional types

  • KT-13822 Fix exception for start-projection of a type alias

  • KT-14071 Prohibit using type alias as a qualifier for super

  • KT-14282 Report error on unused type alias with -language-version 1.0

  • KT-14274 Fix type alias resolution when it's used for supertype constructor call

JDK dependent built-in classes related issues

  • KT-13209 Change first parameter's type of Map.getOrDefault to K instead of Any

  • KT-13069 Do not emit invalid DefaultImpls delegation when interface extends MutableMap with JDK8

data classes and inheritance

  • KT-11306 Allow data classes to implement equals/hashCode/toString from base classes

Various JVM code generation issues

  • KT-13182 Fix compiler internal error at inline

  • KT-13757 Prohibit referencing nested classes by name with $

  • KT-12985 Do not create range instances for 'for' loop in CharSequence.indices

  • KT-13931 Optimize generated code for IntRange#contains

Various analysis & diagnostic issues

  • KT-435 Use parameter names in error messages when calling a function-valued expression

  • KT-10001 Fix false unnecessary non-null assertion on a pair element

  • KT-12811 Treat function declaration as final if it is a member of a final class

  • KT-13961 Report REDECLARATION on private-in-file 'foo' vs public 'foo' in different file

点此查看完整更新内容发行说明

下载地址


时间:2016-10-21 08:25 来源:开源中国社区 作者:局长 原文链接

好文,顶一下
(0)
0%
文章真差,踩一下
(0)
0%
------分隔线----------------------------


把开源带在你的身边-精美linux小纪念品
无觅相关文章插件,快速提升流量