Skip to content

Commit c9ab4fd

Browse files
authored
Update Kotlin to 1.5.20 (#2810)
1 parent bcbcd16 commit c9ab4fd

File tree

10 files changed

+18
-12
lines changed

10 files changed

+18
-12
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
[![official JetBrains project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
44
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
55
[![Download](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.5.0)](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.5.0/pom)
6-
[![Kotlin](https://img.shields.io/badge/kotlin-1.5.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
6+
[![Kotlin](https://img.shields.io/badge/kotlin-1.5.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
77
[![Slack channel](https://img.shields.io/badge/chat-slack-green.svg?logo=slack)](https://kotlinlang.slack.com/messages/coroutines/)
88

99
Library support for Kotlin coroutines with [multiplatform](#multiplatform) support.
10-
This is a companion version for the Kotlin `1.5.0` release.
10+
This is a companion version for the Kotlin `1.5.20` release.
1111

1212
```kotlin
1313
suspend fun main() = coroutineScope {
@@ -91,7 +91,7 @@ And make sure that you use the latest Kotlin version:
9191

9292
```xml
9393
<properties>
94-
<kotlin.version>1.5.0</kotlin.version>
94+
<kotlin.version>1.5.20</kotlin.version>
9595
</properties>
9696
```
9797

@@ -109,7 +109,7 @@ And make sure that you use the latest Kotlin version:
109109

110110
```groovy
111111
buildscript {
112-
ext.kotlin_version = '1.5.0'
112+
ext.kotlin_version = '1.5.20'
113113
}
114114
```
115115

@@ -135,7 +135,7 @@ And make sure that you use the latest Kotlin version:
135135

136136
```groovy
137137
plugins {
138-
kotlin("jvm") version "1.5.0"
138+
kotlin("jvm") version "1.5.20"
139139
}
140140
```
141141

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
# Kotlin
66
version=1.5.0-SNAPSHOT
77
group=org.jetbrains.kotlinx
8-
kotlin_version=1.5.0
8+
kotlin_version=1.5.20
99

1010
# Dependencies
1111
junit_version=4.12
1212
junit5_version=5.7.0
13-
atomicfu_version=0.16.1
13+
atomicfu_version=0.16.2
1414
knit_version=0.3.0-RC
1515
html_version=0.7.2
1616
lincheck_version=2.14

gradle/compile-js-multiplatform.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ compileJsLegacy.configure {
4646
kotlinOptions {
4747
// drop -js suffix from outputFile
4848
def baseName = project.name - "-js"
49-
outputFile = new File(outputFile.parent, baseName + ".js")
49+
outputFile = new File(outputFileProperty.get().parent, baseName + ".js")
5050
}
5151
}
5252

kotlinx-coroutines-core/common/src/Delay.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ internal val CoroutineContext.delay: Delay get() = get(ContinuationInterceptor)
150150
*/
151151
@ExperimentalTime
152152
internal fun Duration.toDelayMillis(): Long =
153-
if (this > Duration.ZERO) toLongMilliseconds().coerceAtLeast(1) else 0
153+
if (this > Duration.ZERO) inWholeMilliseconds.coerceAtLeast(1) else 0

kotlinx-coroutines-core/common/src/channels/ConflatedChannel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ internal open class ConflatedChannel<E>(onUndeliveredElement: OnUndeliveredEleme
123123
undeliveredElementException?.let { throw it } // throw UndeliveredElementException at the end if there was one
124124
}
125125

126+
@Suppress("UNCHECKED_CAST")
126127
private fun updateValueLocked(element: Any?): UndeliveredElementException? {
127128
val old = value
128129
val undeliveredElementException = if (old === EMPTY) null else

kotlinx-coroutines-core/common/src/channels/Deprecated.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public suspend fun <E> ReceiveChannel<E>.elementAt(index: Int): E = consume {
3434
throw IndexOutOfBoundsException("ReceiveChannel doesn't contain element at index $index.")
3535
var count = 0
3636
for (element in this) {
37+
@Suppress("UNUSED_CHANGED_VALUE") // KT-47628
3738
if (index == count++)
3839
return element
3940
}

kotlinx-coroutines-core/common/src/flow/SharingStarted.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public fun SharingStarted.Companion.WhileSubscribed(
140140
stopTimeout: Duration = Duration.ZERO,
141141
replayExpiration: Duration = Duration.INFINITE
142142
): SharingStarted =
143-
StartedWhileSubscribed(stopTimeout.toLongMilliseconds(), replayExpiration.toLongMilliseconds())
143+
StartedWhileSubscribed(stopTimeout.inWholeMilliseconds, replayExpiration.inWholeMilliseconds)
144144

145145
// -------------------------------- implementation --------------------------------
146146

kotlinx-coroutines-core/common/src/flow/operators/Lint.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
@file:Suppress("unused", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
5+
@file:Suppress("unused", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "UNUSED_PARAMETER")
66

77
package kotlinx.coroutines.flow
88

kotlinx-coroutines-core/jvm/src/channels/Actor.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ private class LazyActorCoroutine<E>(
163163
return super.send(element)
164164
}
165165

166+
@Suppress("DEPRECATION_ERROR")
166167
override fun offer(element: E): Boolean {
167168
start()
168169
return super.offer(element)

kotlinx-coroutines-core/jvm/src/internal/MainDispatchers.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ public fun MainCoroutineDispatcher.isMissing(): Boolean = this is MissingMainCor
6767
@Suppress("MayBeConstant")
6868
private val SUPPORT_MISSING = true
6969

70-
@Suppress("ConstantConditionIf")
70+
@Suppress(
71+
"ConstantConditionIf",
72+
"IMPLICIT_NOTHING_TYPE_ARGUMENT_AGAINST_NOT_NOTHING_EXPECTED_TYPE" // KT-47626
73+
)
7174
private fun createMissingDispatcher(cause: Throwable? = null, errorHint: String? = null) =
7275
if (SUPPORT_MISSING) MissingMainCoroutineDispatcher(cause, errorHint) else
7376
cause?.let { throw it } ?: throwMissingMainDispatcherException()

0 commit comments

Comments
 (0)