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/eap.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ In this channel, you can also get notifications about new EAP builds.
57
57
<p><a href="https://github.com/JetBrains/kotlin/releases/tag/v2.3.0-Beta1" target="_blank">Release on GitHub</a></p>
58
58
</td>
59
59
<td>
60
-
<p>A tooling release containing improvements and bug fixes.</p>
60
+
<p>A language release with previews of new features and tooling updates.</p>
61
61
<p>For more details, please refer to the <a href="https://github.com/JetBrains/kotlin/releases/tag/v2.3.0-Beta1">changelog</a> or <a href="whatsnew-eap.md">What's new in Kotlin 2.3.0-Beta1</a>.</p>
The Kotlin %kotlinEapVersion% release is out! Here are some details of this EAP release:
13
13
14
14
*[Feature stabilization: nested type aliases, exhaustive `when`, new time tracking functionality](#stable-features)
15
-
*[Language: changes to context-sensitive resolution and a preview of the unused return value checker](#language)
16
-
*[Type checks and the cast optimization pass enabled by default for Kotlin/Native](#kotlin-native-type-checks-and-casts-optimization-pass-in-debug-mode)
15
+
*[Language: a new checker for unused return values and changes to context-sensitive resolution](#language)
16
+
*[Kotlin/Native: Type checks on generic type boundaries enabled by default](#kotlin-native-type-checks-on-generic-type-boundaries-in-debug-mode)
17
17
18
18
## IDE support
19
19
@@ -25,7 +25,7 @@ See [Update to a new release](releases.md#update-to-a-new-kotlin-version) for de
25
25
26
26
## Stable features
27
27
28
-
In previous Kotlin releases, several new language and standard library features were introduced in preview.
28
+
In previous Kotlin releases, several new language and standard library features were introduced as Experimental and Beta.
29
29
We're happy to announce that in this release, the following features become [Stable](components-stability.md#stability-levels-explained):
30
30
31
31
*[Support for nested type aliases](whatsnew22.md#support-for-nested-type-aliases)
@@ -42,7 +42,7 @@ context-sensitive resolution.
42
42
### Unused return value checker
43
43
<primary-labelref="experimental-general"/>
44
44
45
-
Kotlin %kotlinEapVersion% introduces a preview of a new feature, the unused return value checker.
45
+
Kotlin %kotlinEapVersion% introduces a new feature, the unused return value checker.
46
46
This feature warns you when an expression returns a value other than `Unit` or `Nothing` and isn't passed to a function,
47
47
checked in a condition, or used otherwise.
48
48
@@ -59,7 +59,7 @@ Consider the following example:
59
59
funformatGreeting(name:String): String {
60
60
if (name.isBlank()) return"Hello, anonymous user!"
61
61
if (!name.contains('')) {
62
-
// The checker raises a warning that this result is ignored
62
+
// The checker reports a warning that this result is ignored
In this mode, Kotlin automatically treats your compiled files as if they are annotated with `@MustUseReturnValues`,
124
-
so the checker applies to all return values from your project's functions
124
+
so the checker applies to all return values from your project's functions.
125
125
126
126
You can suppress warnings on specific functions by marking them with the `@IgnorableReturnValue` annotation.
127
127
Annotate functions where ignoring the result is common and expected, such as `MutableList.add`:
@@ -141,7 +141,7 @@ fun computeValue(): Int = 42
141
141
142
142
funmain() {
143
143
144
-
//Raises a warning: result is ignored
144
+
//Reports a warning: result is ignored
145
145
computeValue()
146
146
147
147
// Suppresses the warning only at this call site with a special unused variable
@@ -150,7 +150,7 @@ fun main() {
150
150
```
151
151
152
152
We would appreciate your feedback in [YouTrack](https://youtrack.jetbrains.com/issue/KT-12719). For more information,
153
-
see the feature's [KEEP](https://github.com/Kotlin/KEEP/blob/main/proposals/KEEP-0412-unused-return-value-checker.md)
153
+
see the feature's [KEEP](https://github.com/Kotlin/KEEP/blob/main/proposals/KEEP-0412-unused-return-value-checker.md).
154
154
155
155
### Changes to context-sensitive resolution
156
156
<primary-labelref="experimental-general"/>
@@ -160,36 +160,45 @@ see the feature's [KEEP]( https://github.com/Kotlin/KEEP/blob/main/proposals/KEE
160
160
>
161
161
{style = "note"}
162
162
163
-
Context-sensitive resolution is still in preview, but we continue improving the feature based on user feedback:
163
+
Context-sensitive resolution is still [Experimental](components-stability.md#stability-levels-explained),
164
+
but we continue improving the feature based on user feedback:
164
165
165
166
* The sealed and enclosing supertypes of the current type are now considered as part of the contextual scope of the search.
166
167
No other supertype scopes are considered.
167
-
* In cases with type operators and equalities, the compiler now raises a warning if using context-sensitive resolution
168
+
* In cases with type operators and equalities, the compiler now reports a warning if using context-sensitive resolution
168
169
makes the resolution ambiguous. This can happen, for example, when a clashing declaration of a class is imported.
169
170
170
-
For details, see the [full text of the current proposal](https://github.com/Kotlin/KEEP/blob/main/proposals/KEEP-0379-context-sensitive-resolution.md).
171
+
For details, see the full text of the current proposal in [KEEP](https://github.com/Kotlin/KEEP/blob/main/proposals/KEEP-0379-context-sensitive-resolution.md).
171
172
172
-
## Kotlin/Native: Type checks and casts optimization pass in debug mode
173
+
## Kotlin/Native: type checks on generic type boundaries in debug mode
173
174
174
-
Starting with Kotlin %kotlinEapVersion%, type checks and the cast optimization pass are enabled by default in debug mode,
175
+
Starting with Kotlin %kotlinEapVersion%, type checks on generic type boundaries are enabled by default in debug mode,
175
176
helping you find errors related to unchecked casts earlier. This change improves safety and makes debugging of invalid
176
177
generic casts more predictable across platforms.
177
178
178
179
Previously, unchecked casts that led to heap pollution and violation of memory safety could go unnoticed in Kotlin/Native.
179
-
Now such cases consistently fail with a runtime cast error, similar to Kotlin/JVM or Kotlin/JS. For example:
180
+
Now, such cases consistently fail with a runtime cast error, similar to Kotlin/JVM or Kotlin/JS. For example:
180
181
181
182
```kotlin
182
-
classBox<T>(varvalue:T)
183
-
184
183
funmain() {
185
-
val d =Box(1)
186
-
if (d as?Box<String> !=null) {
187
-
d.value ="0123456789"
188
-
}
189
-
println(d.value +2) // now throws ClassCastException error
184
+
val list =listOf("hello")
185
+
val x = (list asList<Int>)[0]
186
+
println(x) // Now throws a ClassCastException error
190
187
}
191
188
```
192
189
193
-
This code used to print `12`; now it throws a `ClassCastException` error in debug mode, as expected.
190
+
This code used to print `6`; now it throws a `ClassCastException` error in debug mode, as expected.
194
191
195
192
For more information, see [Type checks and casts](typecasts.md).
193
+
194
+
## Gradle: Kotlin/JVM compilation uses Build tools API by default
195
+
<primary-labelref="experimental-general"/>
196
+
197
+
In Kotlin 2.3.0-Beta1, Kotlin/JVM compilation in the Kotlin Gradle plugin uses the [Build tools API](build-tools-api.md)
198
+
(BTA) by default in preview mode. This is a significant change in the internal compilation infrastructure.
199
+
200
+
We've made BTA the default in this release to allow time for testing. We expect everything to continue working as it did
201
+
before. If you notice any issues, share your feedback in our [issue tracker](https://youtrack.jetbrains.com/newIssue?project=KT&summary=Kotlin+Gradle+plugin+BTA+migration+issue&description=Describe+the+problem+you+encountered+here.&c=tag+kgp-bta-migration).
202
+
203
+
The BTA will be disabled again for Kotlin/JVM compilation in Kotlin 2.3.0-Beta2. We plan to fully enable it for all users
0 commit comments