You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/whatsnew/whatsnew22.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,10 @@ We would appreciate your feedback on our issue tracker, [YouTrack](https://youtr
130
130
131
131
Kotlin 2.2.0 introduces an implementation of context-sensitive resolution in preview.
132
132
133
+
You can find an overview of this feature in this video:
134
+
135
+
<videosrc="https://www.youtube.com/v/aF8RYQrJI8Q"title="Context-sensitive resolution in Kotlin 2.2.0"/>
136
+
133
137
Previously, you had to write the full name of enum entries or sealed class members, even when the type could be inferred from the context.
134
138
For example:
135
139
@@ -334,6 +338,12 @@ For more information about the new defaulting rules for annotation use-site targ
334
338
### Supportfor nested type aliases
335
339
<primary-label ref="beta"/>
336
340
341
+
Kotlin2.2.0 adds support for defining type aliases inside other declarations.
342
+
343
+
You can find an overview of this feature inthis video:
344
+
345
+
<video src="https://www.youtube.com/v/1W6d45IOwWk" title="Nested type aliases in Kotlin 2.2.0"/>
346
+
337
347
Previously, you could only declare [type aliases](type-aliases.md) at the top level of a Kotlin file. This meant
338
348
that even internalor domain-specific type
339
349
aliases had to live outside the classwhere they were used.
@@ -572,6 +582,10 @@ fun main() {
572
582
573
583
Kotlin 2.2.0 introduces a new experimental annotation: [`@JvmExposeBoxed`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.jvm/-jvm-expose-boxed/). This annotation makes it easier to consume [inline value classes](inline-classes.md) from Java.
574
584
585
+
You can find an overview of this feature in this video:
586
+
587
+
<video src="https://www.youtube.com/v/KSvq7jHr1lo" title="Exposed inline value classes for Java in Kotlin 2.2.0"/>
588
+
575
589
By default, Kotlin compiles inline value classes to use **unboxed representations**, which are more performant but often
576
590
hard or even impossible to use from Java. For example:
0 commit comments