Skip to content

Commit 25cc6aa

Browse files
committed
Kotlin 2.3 migration: Remove useless cast
1 parent 1cc756f commit 25cc6aa

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ internal open class BufferedChannel<E>(
764764
index: Int,
765765
r: Long
766766
) = suspendCancellableCoroutineReusable { cont ->
767-
val waiter = ReceiveCatching(cont as CancellableContinuationImpl<ChannelResult<E>>)
767+
val waiter = ReceiveCatching(cont)
768768
receiveImplOnNoWaiter(
769769
segment, index, r,
770770
waiter = waiter,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public fun <T> Flow<T>.runningReduce(operation: suspend (accumulator: T, value:
126126
} else {
127127
operation(accumulator as T, value)
128128
}
129-
emit(accumulator as T)
129+
emit(accumulator)
130130
}
131131
}
132132

kotlinx-coroutines-core/js/src/Promise.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ public fun <T> Promise<T>.asDeferred(): Deferred<T> {
6363
public suspend fun <T> Promise<T>.await(): T = suspendCancellableCoroutine { cont: CancellableContinuation<T> ->
6464
this@await.then(
6565
onFulfilled = { cont.resume(it) },
66-
onRejected = { cont.resumeWithException(it as? Throwable ?: Exception("Non-Kotlin exception $it")) })
66+
onRejected = { cont.resumeWithException(it) })
6767
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private fun createStackTrace(continuation: CoroutineStackFrame): ArrayDeque<Stac
180180

181181
var last = continuation
182182
while (true) {
183-
last = (last as? CoroutineStackFrame)?.callerFrame ?: break
183+
last = last.callerFrame ?: break
184184
last.getStackTraceElement()?.let { stack.add(it) }
185185
}
186186
return stack

0 commit comments

Comments
 (0)