Skip to content

Commit bde13dc

Browse files
committed
update: native review and bta
1 parent 85a869a commit bde13dc

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

docs/topics/eap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ In this channel, you can also get notifications about new EAP builds.
5757
<p><a href="https://github.com/JetBrains/kotlin/releases/tag/v2.3.0-Beta1" target="_blank">Release on GitHub</a></p>
5858
</td>
5959
<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>
6161
<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>
6262
</td>
6363
</tr>

docs/topics/whatsnew/whatsnew-eap.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ _[Released: %kotlinEapReleaseDate%](eap.md#build-details)_
1212
The Kotlin %kotlinEapVersion% release is out! Here are some details of this EAP release:
1313

1414
* [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)
1717

1818
## IDE support
1919

@@ -25,7 +25,7 @@ See [Update to a new release](releases.md#update-to-a-new-kotlin-version) for de
2525

2626
## Stable features
2727

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.
2929
We're happy to announce that in this release, the following features become [Stable](components-stability.md#stability-levels-explained):
3030

3131
* [Support for nested type aliases](whatsnew22.md#support-for-nested-type-aliases)
@@ -42,7 +42,7 @@ context-sensitive resolution.
4242
### Unused return value checker
4343
<primary-label ref="experimental-general"/>
4444

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.
4646
This feature warns you when an expression returns a value other than `Unit` or `Nothing` and isn't passed to a function,
4747
checked in a condition, or used otherwise.
4848

@@ -59,7 +59,7 @@ Consider the following example:
5959
fun formatGreeting(name: String): String {
6060
if (name.isBlank()) return "Hello, anonymous user!"
6161
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
6363
"Hello, " + name.replaceFirstChar(Char::titlecase) + "!"
6464
}
6565
val (first, last) = name.split(' ')
@@ -121,7 +121,7 @@ kotlin {
121121
```
122122

123123
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.
125125

126126
You can suppress warnings on specific functions by marking them with the `@IgnorableReturnValue` annotation.
127127
Annotate functions where ignoring the result is common and expected, such as `MutableList.add`:
@@ -141,7 +141,7 @@ fun computeValue(): Int = 42
141141

142142
fun main() {
143143

144-
// Raises a warning: result is ignored
144+
// Reports a warning: result is ignored
145145
computeValue()
146146

147147
// Suppresses the warning only at this call site with a special unused variable
@@ -150,7 +150,7 @@ fun main() {
150150
```
151151

152152
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).
154154

155155
### Changes to context-sensitive resolution
156156
<primary-label ref="experimental-general"/>
@@ -160,36 +160,45 @@ see the feature's [KEEP]( https://github.com/Kotlin/KEEP/blob/main/proposals/KEE
160160
>
161161
{style = "note"}
162162

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:
164165

165166
* The sealed and enclosing supertypes of the current type are now considered as part of the contextual scope of the search.
166167
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
168169
makes the resolution ambiguous. This can happen, for example, when a clashing declaration of a class is imported.
169170

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).
171172

172-
## Kotlin/Native: Type checks and casts optimization pass in debug mode
173+
## Kotlin/Native: type checks on generic type boundaries in debug mode
173174

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,
175176
helping you find errors related to unchecked casts earlier. This change improves safety and makes debugging of invalid
176177
generic casts more predictable across platforms.
177178

178179
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:
180181

181182
```kotlin
182-
class Box<T>(var value: T)
183-
184183
fun main() {
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 as List<Int>)[0]
186+
println(x) // Now throws a ClassCastException error
190187
}
191188
```
192189

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.
194191

195192
For more information, see [Type checks and casts](typecasts.md).
193+
194+
## Gradle: Kotlin/JVM compilation uses Build tools API by default
195+
<primary-label ref="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
204+
starting with Kotlin 2.3.20.

0 commit comments

Comments
 (0)