Fix a suppressed warning
This also fixes the build with the in-development 1.8.0 Kotlin
compiler.
Before, when constructing `Maybe<A & Any>`, we had `T = A?`.
This way, `MaybeEmitter<T & Any>` meant `MaybeEmitter<A? & Any>`.
However, with the new version, type inference must have changed,
so it came to be that `T = A`, breaking the code.
diff --git a/reactive/kotlinx-coroutines-rx3/src/RxMaybe.kt b/reactive/kotlinx-coroutines-rx3/src/RxMaybe.kt
index 39306e2..defb2b7 100644
--- a/reactive/kotlinx-coroutines-rx3/src/RxMaybe.kt
+++ b/reactive/kotlinx-coroutines-rx3/src/RxMaybe.kt
@@ -37,13 +37,12 @@
coroutine.start(CoroutineStart.DEFAULT, coroutine, block)
}
-private class RxMaybeCoroutine<T>(
+private class RxMaybeCoroutine<T: Any>(
parentContext: CoroutineContext,
- private val subscriber: MaybeEmitter<T & Any>
-) : AbstractCoroutine<T>(parentContext, false, true) {
- override fun onCompleted(value: T) {
+ private val subscriber: MaybeEmitter<T>
+) : AbstractCoroutine<T?>(parentContext, false, true) {
+ override fun onCompleted(value: T?) {
try {
- @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") // KT-54201
if (value == null) subscriber.onComplete() else subscriber.onSuccess(value)
} catch (e: Throwable) {
handleUndeliverableException(e, context)