Skip to content

Commit

Permalink
Update Kotlin to 1.5.20 (Kotlin#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwwdfsad committed Jul 8, 2021
1 parent bcbcd16 commit c9ab4fd
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
[![official JetBrains project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
[![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)
[![Kotlin](https://img.shields.io/badge/kotlin-1.5.0-blue.svg?logo=kotlin)](http:https://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.5.20-blue.svg?logo=kotlin)](http:https://kotlinlang.org)
[![Slack channel](https://img.shields.io/badge/chat-slack-green.svg?logo=slack)](https://kotlinlang.slack.com/messages/coroutines/)

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

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

```xml
<properties>
<kotlin.version>1.5.0</kotlin.version>
<kotlin.version>1.5.20</kotlin.version>
</properties>
```

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

```groovy
buildscript {
ext.kotlin_version = '1.5.0'
ext.kotlin_version = '1.5.20'
}
```

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

```groovy
plugins {
kotlin("jvm") version "1.5.0"
kotlin("jvm") version "1.5.20"
}
```

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
# Kotlin
version=1.5.0-SNAPSHOT
group=org.jetbrains.kotlinx
kotlin_version=1.5.0
kotlin_version=1.5.20

# Dependencies
junit_version=4.12
junit5_version=5.7.0
atomicfu_version=0.16.1
atomicfu_version=0.16.2
knit_version=0.3.0-RC
html_version=0.7.2
lincheck_version=2.14
Expand Down
2 changes: 1 addition & 1 deletion gradle/compile-js-multiplatform.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ compileJsLegacy.configure {
kotlinOptions {
// drop -js suffix from outputFile
def baseName = project.name - "-js"
outputFile = new File(outputFile.parent, baseName + ".js")
outputFile = new File(outputFileProperty.get().parent, baseName + ".js")
}
}

Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/common/src/Delay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ internal val CoroutineContext.delay: Delay get() = get(ContinuationInterceptor)
*/
@ExperimentalTime
internal fun Duration.toDelayMillis(): Long =
if (this > Duration.ZERO) toLongMilliseconds().coerceAtLeast(1) else 0
if (this > Duration.ZERO) inWholeMilliseconds.coerceAtLeast(1) else 0
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ internal open class ConflatedChannel<E>(onUndeliveredElement: OnUndeliveredEleme
undeliveredElementException?.let { throw it } // throw UndeliveredElementException at the end if there was one
}

@Suppress("UNCHECKED_CAST")
private fun updateValueLocked(element: Any?): UndeliveredElementException? {
val old = value
val undeliveredElementException = if (old === EMPTY) null else
Expand Down
1 change: 1 addition & 0 deletions kotlinx-coroutines-core/common/src/channels/Deprecated.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public suspend fun <E> ReceiveChannel<E>.elementAt(index: Int): E = consume {
throw IndexOutOfBoundsException("ReceiveChannel doesn't contain element at index $index.")
var count = 0
for (element in this) {
@Suppress("UNUSED_CHANGED_VALUE") // KT-47628
if (index == count++)
return element
}
Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/common/src/flow/SharingStarted.kt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public fun SharingStarted.Companion.WhileSubscribed(
stopTimeout: Duration = Duration.ZERO,
replayExpiration: Duration = Duration.INFINITE
): SharingStarted =
StartedWhileSubscribed(stopTimeout.toLongMilliseconds(), replayExpiration.toLongMilliseconds())
StartedWhileSubscribed(stopTimeout.inWholeMilliseconds, replayExpiration.inWholeMilliseconds)

// -------------------------------- implementation --------------------------------

Expand Down
2 changes: 1 addition & 1 deletion kotlinx-coroutines-core/common/src/flow/operators/Lint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("unused", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
@file:Suppress("unused", "INVISIBLE_REFERENCE", "INVISIBLE_MEMBER", "UNUSED_PARAMETER")

package kotlinx.coroutines.flow

Expand Down
1 change: 1 addition & 0 deletions kotlinx-coroutines-core/jvm/src/channels/Actor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ private class LazyActorCoroutine<E>(
return super.send(element)
}

@Suppress("DEPRECATION_ERROR")
override fun offer(element: E): Boolean {
start()
return super.offer(element)
Expand Down
5 changes: 4 additions & 1 deletion kotlinx-coroutines-core/jvm/src/internal/MainDispatchers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public fun MainCoroutineDispatcher.isMissing(): Boolean = this is MissingMainCor
@Suppress("MayBeConstant")
private val SUPPORT_MISSING = true

@Suppress("ConstantConditionIf")
@Suppress(
"ConstantConditionIf",
"IMPLICIT_NOTHING_TYPE_ARGUMENT_AGAINST_NOT_NOTHING_EXPECTED_TYPE" // KT-47626
)
private fun createMissingDispatcher(cause: Throwable? = null, errorHint: String? = null) =
if (SUPPORT_MISSING) MissingMainCoroutineDispatcher(cause, errorHint) else
cause?.let { throw it } ?: throwMissingMainDispatcherException()
Expand Down

0 comments on commit c9ab4fd

Please sign in to comment.