Skip to content

Commit beef803

Browse files
lunakolydkhalanskyjb
authored andcommitted
Suppress MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES warnings (#3896)
K2 now detects the cases that K1 misses, and reports warnings, just in case.
1 parent 3d5eadf commit beef803

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,14 @@ private open class BroadcastCoroutine<E>(
147147
override val channel: SendChannel<E>
148148
get() = this
149149

150+
@Suppress("MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING") // do not remove the MULTIPLE_DEFAULTS suppression: required in K2
150151
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Since 1.2.0, binary compatibility with versions <= 1.1.x")
151152
final override fun cancel(cause: Throwable?): Boolean {
152153
cancelInternal(cause ?: defaultCancellationException())
153154
return true
154155
}
155156

157+
@Suppress("MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING") // do not remove the MULTIPLE_DEFAULTS suppression: required in K2
156158
final override fun cancel(cause: CancellationException?) {
157159
cancelInternal(cause ?: defaultCancellationException())
158160
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public class ConflatedBroadcastChannel<E> private constructor(
136136
*
137137
* This channel is created by `BroadcastChannel(capacity)` factory function invocation.
138138
*/
139+
@Suppress("MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING", "MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_WHEN_NO_EXPLICIT_OVERRIDE_DEPRECATION_WARNING") // do not remove the MULTIPLE_DEFAULTS suppression: required in K2
139140
internal class BroadcastChannelImpl<E>(
140141
/**
141142
* Buffer capacity; [Channel.CONFLATED] when this broadcast is conflated.

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

+2
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ internal open class ChannelCoroutine<E>(
2121
cancelInternal(defaultCancellationException())
2222
}
2323

24+
@Suppress("MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING") // do not remove the MULTIPLE_DEFAULTS suppression: required in K2
2425
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Since 1.2.0, binary compatibility with versions <= 1.1.x")
2526
final override fun cancel(cause: Throwable?): Boolean {
2627
cancelInternal(defaultCancellationException())
2728
return true
2829
}
2930

31+
@Suppress("MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING") // do not remove the MULTIPLE_DEFAULTS suppression: required in K2
3032
final override fun cancel(cause: CancellationException?) {
3133
if (isCancelled) return // Do not create an exception if the coroutine (-> the channel) is already cancelled
3234
cancelInternal(cause ?: defaultCancellationException())

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

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ private class LazyActorCoroutine<E>(
178178
return super.trySend(element)
179179
}
180180

181+
@Suppress("MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_DEPRECATION_WARNING") // do not remove the MULTIPLE_DEFAULTS suppression: required in K2
181182
override fun close(cause: Throwable?): Boolean {
182183
// close the channel _first_
183184
val closed = super.close(cause)

0 commit comments

Comments
 (0)