Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
aSemy authored Sep 18, 2023
2 parents 46770cb + 67e9458 commit 2259427
Show file tree
Hide file tree
Showing 65 changed files with 994 additions and 408 deletions.
2 changes: 1 addition & 1 deletion .teamcity/BuildParams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ object BuildParams {
const val DOKKA_TEMPLATES_VERSION = "1.9.0-dev-218"

const val KOTLINX_COROUTINES_RELEASE_TAG = "1.7.1"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.6.0-RC"
const val KOTLINX_SERIALIZATION_RELEASE_TAG = "v1.6.0"
const val KOTLINX_DATETIME_RELEASE_TAG = "v0.4.0"
const val KOTLINX_METADATA_JVM_RELEASE_TAG = "v0.7.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object BuildReferenceDocs : BuildType({
""".trimIndent()

params {
param("WEBHELP_FRONTEND_VERSION", "5.13.0")
param("WEBHELP_FRONTEND_VERSION", "5.15.0")
param("WH_DOCS_PATH_REGEX", "docs")
param("WH_PROJECT_NAME", "kotlin-reference")
}
Expand Down
10 changes: 5 additions & 5 deletions data/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
subject : 'KKON'
url: https://rheinwerk-kkon.de/
- lang: en
startDate: '2023-11-16'
endDate: '2023-11-16'
startDate: '2023-09-21'
endDate: '2023-09-22'
location: Amsterdam, Netherlands
speaker : 'Sebastian Aigner'
speaker : 'Garth Gilmour'
title : ''
subject : 'Kotlin Dev Day'
url: https://kotlindevday.com/
subject : 'Kotlin Training Day'
url: https://pages.xebia.com/kotlin-training-day
- lang: en
startDate: '2023-09-14'
endDate: '2023-09-15'
Expand Down
4 changes: 2 additions & 2 deletions data/releases.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url: https://github.com/JetBrains/kotlin/releases

latest:
version: 1.9.0
url: https://github.com/JetBrains/kotlin/releases/tag/v1.9.0
version: 1.9.10
url: https://github.com/JetBrains/kotlin/releases/tag/v1.9.10

2 changes: 1 addition & 1 deletion data/testimonials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
url: https://www.corda.net/2017/01/10/kotlin/
text: Corda is an open-source distributed ledger platform, supported by major banks, and built entirely in Kotlin
- company: Evernote
url: https://blog.evernote.com/tech/2017/01/26/android-state-library/
url: https://evernote.com/blog/android-state-library/
text: Evernote recently integrated Kotlin into their Android client
- company: Coursera
url: https://building.coursera.org/blog/2016/03/16/becoming-bilingual-coursera/
Expand Down
Binary file modified docs/images/data-science/kotlin-notebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions docs/kr.tree
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

<toc-element toc-title="What's new in Kotlin">
<toc-element id="whatsnew19.md" toc-title="Kotlin 1.9.0" accepts-web-file-names="whatsnew.html"/>
<toc-element id="whatsnew1820.md" toc-title="Kotlin 1.8.20"/>
<toc-element id="whatsnew-eap.md" toc-title="Kotlin 1.9.0-RC" hidden="true"/>
<toc-element id="whatsnew-eap.md" toc-title="Kotlin 1.9.20-Beta"/>
<toc-element toc-title="Earlier versions">
<toc-element id="whatsnew1820.md" toc-title="Kotlin 1.8.20"/>
<toc-element id="whatsnew18.md" toc-title="Kotlin 1.8.0"/>
<toc-element id="whatsnew1720.md" toc-title="Kotlin 1.7.20"/>
<toc-element id="whatsnew17.md" toc-title="Kotlin 1.7.0"/>
Expand Down Expand Up @@ -394,6 +394,7 @@
<toc-element href="https://play.kotlinlang.org/byExample/overview" toc-title="Kotlin by example"/>
<toc-element id="koans.md"/>
<toc-element href="https://hyperskill.org/tracks?category=4&amp;utm_source=jbkotlin_hs&amp;utm_medium=referral&amp;utm_campaign=kotlinlang-docs&amp;utm_content=button_1&amp;utm_term=22.03.23" toc-title="Kotlin Core track"/>
<toc-element id="kotlin-hands-on.md" toc-title="Kotlin hands-on"/>
<toc-element id="kotlin-tips.md"/>
<toc-element id="books.md"/>
<toc-element id="advent-of-code.md" toc-title="Advent of Code puzzles"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/collection-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ It combines 2 actions:
- Maps the collection with the selector function
- Returns the first non-null value in the result

`firstNotNullOf()` throws the `NoSuchElementException` if the resulting collection doesn't have a non-null element.
`firstNotNullOf()` throws the `NoSuchElementException` if the resulting collection doesn't have a non-nullable element.
Use the counterpart [`firstNotNullOfOrNull()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/first-not-null-of-or-null.html)
to return null in this case.

Expand Down
4 changes: 2 additions & 2 deletions docs/topics/collection-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ There are also functions that narrow the element type by filtering elements of a
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}

* [`filterNotNull()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/filter-not-null.html) returns all
non-null elements. Being called on a `List<T?>`, `filterNotNull()` returns a `List<T: Any>`, thus allowing you to treat
the elements as non-null objects.
non-nullable elements. Being called on a `List<T?>`, `filterNotNull()` returns a `List<T: Any>`, thus allowing you to treat
the elements as non-nullable objects.

```kotlin
fun main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/competitive-programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Note the use of Kotlin's
[null-assertion operator](null-safety.md#the-operator) `!!`
after the [readLine()](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/read-line.html) function call.
Kotlin's `readLine()` function is defined to return a
[nullable type](null-safety.md#nullable-types-and-non-null-types)
[nullable type](null-safety.md#nullable-types-and-non-nullable-types)
`String?` and returns `null` on the end of the input, which explicitly forces the developer to handle the
case of missing input.

Expand Down
31 changes: 13 additions & 18 deletions docs/topics/eap.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,33 @@ check [our instructions on how to configure your build to support this version](

## Build details

_No preview versions are currently available._
<!-- _No preview versions are currently available._ -->

<!--
<table>
<tr>
<th>Build info</th>
<th>Build highlights</th>
</tr>
<tr>
<td><strong>1.9.0-RC</strong>
<p>Released: <strong>June 20, 2023</strong></p>
<p><a href="https://github.com/JetBrains/kotlin/releases/tag/v1.9.0-RC" target="_blank">Release on GitHub</a></p>
<td><strong>1.9.20-Beta</strong>
<p>Released: <strong>September 11, 2023</strong></p>
<p><a href="https://github.com/JetBrains/kotlin/releases/tag/v1.9.20-Beta" target="_blank">Release on GitHub</a></p>
</td>
<td>
<ul>
<li>Language: Stable <code>rangeUntil</code> operator, data objects, <code>Enum.entries</code> replacement for <code>Enum.values()</code>, and the <code>@Volatile</code> annotation</li>
<li>K2: basic support for Kotlin/Native and multiplatform projects, support for Kotlin/JS since 1.8.20</li>
<li>Kotlin/JVM: <code>@JvmDefault</code> and old <code>-Xjvm-default</code> modes deprecated with error, support for Java 20 bytecode</li>
<li>Kotlin/Native: new custom memory allocator, no object initialization when accessing <code>const val</code>, partial linkage enabled by default</li>
<li>Kotlin Multiplatform: new name for the <code>android</code> block, new Android source set layout enabled by default, support for Gradle configuration caching in multiplatform libraries, ability to disable sources publication in the Kotlin Multiplatform Gradle plugin, ability to add dependencies between Pods when using the CocoaPods Gradle plugin</li>
<li>Kotlin/Wasm: runtime footprint reduced and performance improved, set system default browser as default for <code>wasmBrowserRun</code> task, improved JS interop, more compiler and IDE diagnostics for JS interop</li>
<li>Kotlin/JS: deprecated legacy backend with error, deprecated external Enum class, extracted DOM API from standard library to module automatically added to builds, partial linkage enabled by default, IR compiler used by default, changed default destination of production distributions, deprecated <code>kotlin-js</code> Gradle plugin that is replaced by <code>kotlin-multiplatform</code> Gradle plugin, experimental support for ES6 classes and modules, reduced memory consumption for production builds</li>
<li>Libraries: Stable standard library functions for open-ended ranges, new common function to get regex capture group by name, new <code>HexFormat</code> to format and parse hexadecimals, Stable time API, new path utility to create parent directories, reviewed and stabilized Kotlin/Native standard library</li>
<li>Gradle: build scans show whether K1 or K2 compiler is used, new Gradle property <code>kotlin.experimental.tryK2</code> to try the K2 compiler, new project-level compiler options for Kotlin/JVM plugin, removed <code>KotlinCompile</code> task's <code>classpath</code> property, exposed <code>jvmTargetValidationMode</code> property in <code>KotlinCompile</code> task, configurable standalone mode for Kotlin/Native iOS simulator tests, removed support for <code>org.gradle.api.internal.HasConvention</code> Gradle element, added <code>optIn</code> and <code>progressiveMode</code> compiler options, compiler plugins are published separately and Gradle plugins add them as compiler arguments, kapt tasks don’t trigger eager task creation, minimum supported Android Gradle plugin version is 4.2.2</li>
<li>Kotlin/JVM: support for Java 21 bytecode</li>
<li>Kotlin/Native: custom allocator enabled by default, full parallel mark available in the GC, deprecated targets disabled, obligatory opt-in for all cinterop declarations (except for platform libraries), the GC scheduler tracking objects in big chunks, legacy memory manager disabled</li>
<li>Kotlin Multiplatform: hierarchy template available by default, full support for Gradle Configuration cache, the default support for third-party cinterop libraries, reworked configuration of compiler settings in multiplatform projects</li>
<li>Kotlin/Wasm: support for WASI, new <code>wasm-wasi</code> target and rename <code>wasm</code> target to <code>wasm-js</code>, compatible with recent updates in Wasm GC</li>
<li>Kotlin/JS: using open-addressing hash map in the JS stdlib, ability to generate one JS file for each Kotlin source file</li>
<li>Libraries: experimental support for <code>enumEntries()</code> function, further stabilization of Kotlin/Native standard library</li>
<li>Gradle: support for Gradle versions 8.0 and 8.1, new build metrics for Kotlin/Native tasks, support for test fixtures to access internal declarations, new property to configure custom path to Konan and its dependencies</li>
</ul>
<p>For more details, please refer to the <a href="https://github.com/JetBrains/kotlin/releases/tag/v1.9.0-RC">changelog</a> or <a href="whatsnew-eap.md">What's new in Kotlin 1.9.0-RC</a>.</p>
<p>For more details, please refer to the <a href="https://github.com/JetBrains/kotlin/releases/tag/v1.9.20-Beta">changelog</a> or <a href="whatsnew-eap.md">What's new in Kotlin 1.9.20-Beta</a>.</p>
</td>
</tr>
</table>

> If the Kotlin EAP plugin can't find the latest EAP build, check that you are using the latest version of [IntelliJ IDEA](https://www.jetbrains.com/help/idea/update.html) or [Android Studio](https://developer.android.com/studio/intro/update).
>
{type="note"}
-->
{type="note"}
2 changes: 1 addition & 1 deletion docs/topics/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ You can call `toString()` in Kotlin without checking for `null`, as the check al
```kotlin
fun Any?.toString(): String {
if (this == null) return "null"
// After the null check, 'this' is autocast to a non-null type, so the toString() below
// After the null check, 'this' is autocast to a non-nullable type, so the toString() below
// resolves to the member function of the Any class
return toString()
}
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ In other words, the wildcard with an _extends_\-bound (_upper_ bound) makes the
The key to understanding why this works is rather simple: if you can only _take_ items from a collection,
then using a collection of `String`s and reading `Object`s from it is fine. Conversely, if you can only _put_ items
into the collection, it's okay to take a collection of `Object`s and put `String`s into it: in Java there is
`List<? super String>`, a _supertype_ of `List<Object>`.
`List<? super String>`, which accepts `String`s or any of its supertypes.

The latter is called _contravariance_, and you can only call methods that take `String` as an argument on `List<? super String>`
(for example, you can call `add(String)` or `set(int, String)`). If you call something that returns `T` in `List<T>`,
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/gradle/gradle-compilation-and-caches.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,5 +542,5 @@ your `gradle.properties`.
## What's next?

Learn more about:
* [Gradle basics and specifics](https://docs.gradle.org/current/userguide/getting_started.html).
* [Gradle basics and specifics](https://docs.gradle.org/current/userguide/userguide.html).
* [Support for Gradle plugin variants](gradle-plugin-variants.md).
18 changes: 9 additions & 9 deletions docs/topics/gradle/gradle-compiler-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ For both the JVM and Android projects, it's possible to define options using the
```kotlin
kotlin {
compilerOptions {
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9)
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.%gradleApiVersion%)
}
}
```
Expand All @@ -70,7 +70,7 @@ kotlin {
```groovy
kotlin {
compilerOptions {
apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.%gradleApiVersion%
}
}
```
Expand Down Expand Up @@ -171,7 +171,7 @@ Here is a complete list of options for Gradle tasks:
| Name | Description | Possible values | Default value |
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|-----------------------------|
| `javaParameters` | Generate metadata for Java 1.8 reflection on method parameters | | false |
| `jvmTarget` | Target version of the generated JVM bytecode | "1.8", "9", "10", ..., "19". Also, see [Types for compiler options](#types-for-compiler-options) | "%defaultJvmTargetVersion%" |
| `jvmTarget` | Target version of the generated JVM bytecode | "1.8", "9", "10", ..., "20". Also, see [Types for compiler options](#types-for-compiler-options) | "%defaultJvmTargetVersion%" |
| `noJdk` | Don't automatically include the Java runtime into the classpath | | false |
| `jvmTargetValidationMode` | <list><li>Validation of the [JVM target compatibility](gradle-configure-project.md#check-for-jvm-target-compatibility-of-related-compile-tasks) between Kotlin and Java</li><li>A property for tasks of the `KotlinCompile` type.</li></list> | `WARNING`, `ERROR`, `INFO` | `ERROR` |

Expand Down Expand Up @@ -237,8 +237,8 @@ tasks.named('compileKotlin', KotlinCompilationTask) {

| Name | Description | Possible values |Default value |
|------|-------------|-----------------|--------------|
| `apiVersion` | Restrict the use of declarations to those from the specified version of bundled libraries | "1.3" (DEPRECATED), "1.4" (DEPRECATED), "1.5", "1.6", "1.7", "1.8", "1.9" (EXPERIMENTAL) | |
| `languageVersion` | Provide source compatibility with the specified version of Kotlin | "1.3" (DEPRECATED), "1.4" (DEPRECATED), "1.5", "1.6", "1.7", "1.8", "1.9" (EXPERIMENTAL) | |
| `apiVersion` | Restrict the use of declarations to those from the specified version of bundled libraries | "1.4" (DEPRECATED), "1.5" (DEPRECATED), "1.6", "1.7", "1.8", "1.9", "2.0" (EXPERIMENTAL), "2.1" (EXPERIMENTAL) | |
| `languageVersion` | Provide source compatibility with the specified version of Kotlin | "1.4" (DEPRECATED), "1.5" (DEPRECATED), "1.6", "1.7", "1.8", "1.9", "2.0" (EXPERIMENTAL), "2.1" (EXPERIMENTAL) | |

#### Example of setting a languageVersion

Expand All @@ -254,7 +254,7 @@ tasks
compilerOptions
.languageVersion
.set(
org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
org.jetbrains.kotlin.gradle.dsl.KotlinVersion.%gradleLanguageVersion%
)
}
```
Expand All @@ -267,7 +267,7 @@ tasks
.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask.class)
.configureEach {
compilerOptions.languageVersion =
org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
org.jetbrains.kotlin.gradle.dsl.KotlinVersion.%gradleLanguageVersion%
}
```

Expand Down Expand Up @@ -299,7 +299,7 @@ Some of the `compilerOptions` use the new types instead of the `String` type:
| Option | Type | Example |
|--------|------|---------|
| `jvmTarget` | [`JvmTarget`](https://github.com/JetBrains/kotlin/blob/1.8.0/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JvmTarget.kt) | `compilerOptions.jvmTarget.set(JvmTarget.JVM_11)` |
| `apiVersion` and `languageVersion` | [`KotlinVersion`](https://github.com/JetBrains/kotlin/blob/1.8.0/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinVersion.kt) | `compilerOptions.languageVersion.set(KotlinVersion.KOTLIN_1_9)` |
| `apiVersion` and `languageVersion` | [`KotlinVersion`](https://github.com/JetBrains/kotlin/blob/1.8.0/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinVersion.kt) | `compilerOptions.languageVersion.set(KotlinVersion.%gradleLanguageVersion%)` |
| `main` | [`JsMainFunctionExecutionMode`](https://github.com/JetBrains/kotlin/blob/1.8.0/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JsMainFunctionExecutionMode.kt) | `compilerOptions.main.set(JsMainFunctionExecutionMode.NO_CALL)` |
| `moduleKind` | [`JsModuleKind`](https://github.com/JetBrains/kotlin/blob/1.8.0/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JsModuleKind.kt) | `compilerOptions.moduleKind.set(JsModuleKind.MODULE_ES)` |
| `sourceMapEmbedSources` | [`JsSourceMapEmbedMode`](https://github.com/JetBrains/kotlin/blob/1.8.0/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JsSourceMapEmbedMode.kt) | `compilerOptions.sourceMapEmbedSources.set(JsSourceMapEmbedMode.SOURCE_MAP_SOURCE_CONTENT_INLINING)` |
Expand All @@ -309,5 +309,5 @@ Some of the `compilerOptions` use the new types instead of the `String` type:

Learn more about:
* [Incremental compilation, caches support, build reports, and the Kotlin daemon](gradle-compilation-and-caches.md).
* [Gradle basics and specifics](https://docs.gradle.org/current/userguide/getting_started.html).
* [Gradle basics and specifics](https://docs.gradle.org/current/userguide/userguide.html).
* [Support for Gradle plugin variants](gradle-plugin-variants.md).
Loading

0 comments on commit 2259427

Please sign in to comment.