跳至主要内容

Kotlin 語言特性與提案

JetBrains 根據 Kotlin 語言演進原則 演進 Kotlin 語言, 並以務實的設計為指導。

備註

語言特性提案列於 Kotlin 1.7.0 及更高版本。

請參閱 Kotlin 演進原則文檔中關於語言特性狀態的說明。

探索與設計 (Exploration and design)

Kotlin 靜態和靜態擴展 (Kotlin statics and static extensions)

探索與設計 (Exploration and design)

集合字面量 (Collection literals)

  • KEEP 提案:未定義 (Not defined)
  • YouTrack issue: KT-43871

探索與設計 (Exploration and design)

錯誤和異常的聯合類型 (Union types for errors and exceptions)

  • KEEP 提案:未定義 (Not defined)
  • YouTrack issue: KT-68296

探索與設計 (Exploration and design)

基於名稱的解構 (Name-based destructuring)

  • KEEP 提案:未定義 (Not defined)
  • YouTrack issue: KT-19627

探索與設計 (Exploration and design)

支持不可變性 (Support immutability)

KEEP 討論 (KEEP discussion)

KMP Kotlin-to-Java 直接實現 (KMP Kotlin-to-Java direct actualization)

KEEP 討論 (KEEP discussion)

kotlin.time.Instant

KEEP 討論 (KEEP discussion)

Common Atomics and Atomic Arrays

KEEP 討論 (KEEP discussion)

改進屬性上的註解使用位置目標 (Improvements to annotation use-site targets on properties)

KEEP 討論 (KEEP discussion)

嵌套(非捕獲)類型別名 (Nested (non-capturing) type aliases)

KEEP 討論 (KEEP discussion)

簡化 KDoc 歧義連結 (Streamline KDoc ambiguity links)

KEEP 討論 (KEEP discussion)

解析 KDoc 中擴展的連結 (Resolution of links to extensions in KDoc)

KEEP 討論 (KEEP discussion)

Uuid

KEEP 討論 (KEEP discussion)

使用預期類型改進解析 (Improve resolution using expected type)

KEEP 討論 (KEEP discussion)

在 JVM 中公開 boxed inline value classes

KEEP 討論 (KEEP discussion)

顯式後端欄位:同一屬性的 publicprivate 類型 (Explicit backing fields: both public and private type for the same property)

KEEP 討論 (KEEP discussion)

Context parameters: support for context-dependent declarations

KEEP 討論 (KEEP discussion)

Java synthetic property references

預覽中 (In preview)

when-with-subject 中的 Guard 條件 (Guard conditions in when-with-subject)

穩定 (Stable)

穩定 @SubclassOptInRequired

預覽中 (In preview)

Multidollar interpolation: improved handling of ${} in string literals

預覽中 (In preview)

Non-local break and continue

穩定 (Stable)

Enum.entries: Enum.values() 的高效替代方案

穩定 (Stable)

Data objects

穩定 (Stable)

RangeUntil operator ..<

穩定 (Stable)

Definitely non-nullable types

已撤銷 (Revoked)

Context receivers