Skip to content

Commit 5f73827

Browse files
committed
Get rid of compiler bugs workarounds
1 parent 9d31ffc commit 5f73827

File tree

5 files changed

+1
-29
lines changed

5 files changed

+1
-29
lines changed

binary-compatibility-validator/reference-public-api/kotlinx-coroutines-core.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
public abstract class kotlinx/coroutines/experimental/AbstractCoroutine : kotlin/coroutines/experimental/Continuation, kotlinx/coroutines/experimental/CoroutineScope, kotlinx/coroutines/experimental/Job {
22
public fun <init> (Lkotlin/coroutines/experimental/CoroutineContext;Z)V
33
public synthetic fun <init> (Lkotlin/coroutines/experimental/CoroutineContext;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
4-
public fun cancel (Ljava/lang/Throwable;)Z
54
public final fun getContext ()Lkotlin/coroutines/experimental/CoroutineContext;
65
public final fun getCoroutineContext ()Lkotlin/coroutines/experimental/CoroutineContext;
7-
public fun invokeOnCompletion (ZZLkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/experimental/DisposableHandle;
86
protected fun onCancellation (Ljava/lang/Throwable;)V
97
protected fun onCompleted (Ljava/lang/Object;)V
108
protected fun onCompletedExceptionally (Ljava/lang/Throwable;)V

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

-12
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,5 @@ public abstract class AbstractCoroutine<in T>(
152152
initParentJob()
153153
start(block, receiver, this)
154154
}
155-
156-
// todo: This workaround for KT-21968, should be removed in the future
157-
override fun invokeOnCompletion(
158-
onCancelling: Boolean,
159-
invokeImmediately: Boolean,
160-
handler: CompletionHandler
161-
): DisposableHandle =
162-
super.invokeOnCompletion(onCancelling, invokeImmediately, handler)
163-
164-
// todo: This workaround for KT-21968, should be removed in the future
165-
override fun cancel(cause: Throwable?) =
166-
super.cancel(cause)
167155
}
168156

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

-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ private open class BroadcastCoroutine<E>(
103103
if (!processed && cause != null)
104104
handleCoroutineException(context, cause)
105105
}
106-
107-
// Workaround for KT-23094
108-
override suspend fun send(element: E) = _channel.send(element)
109106
}
110107

111108
private class LazyBroadcastCoroutine<E>(

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

+1-9
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ internal open class ChannelCoroutine<E>(
1212
protected val _channel: Channel<E>,
1313
active: Boolean
1414
) : AbstractCoroutine<Unit>(parentContext, active), Channel<E> by _channel {
15-
val channel: Channel<E>
16-
get() = this
17-
18-
// Workaround for KT-23094
19-
override suspend fun receive(): E = _channel.receive()
20-
21-
override suspend fun send(element: E) = _channel.send(element)
22-
23-
override suspend fun receiveOrNull(): E? = _channel.receiveOrNull()
15+
val channel: Channel<E> get() = this
2416

2517
override fun cancel(cause: Throwable?): Boolean = super.cancel(cause)
2618
}

common/kotlinx-coroutines-core-common/test/channels/TestChannelKind.kt

-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ private class ChannelViaBroadcast<E>(
5555
override val isClosedForReceive: Boolean get() = sub.isClosedForReceive
5656
override val isEmpty: Boolean get() = sub.isEmpty
5757

58-
// Workaround for KT-23094
59-
override suspend fun send(element: E) = broadcast.send(element)
60-
6158
override suspend fun receive(): E = sub.receive()
6259
override suspend fun receiveOrNull(): E? = sub.receiveOrNull()
6360
override fun poll(): E? = sub.poll()

0 commit comments

Comments
 (0)