Skip to content

Commit ccde0c7

Browse files
committed
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.
1 parent cb0b51e commit ccde0c7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

reactive/kotlinx-coroutines-rx3/src/RxMaybe.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ private fun <T> rxMaybeInternal(
3737
coroutine.start(CoroutineStart.DEFAULT, coroutine, block)
3838
}
3939

40-
private class RxMaybeCoroutine<T>(
40+
private class RxMaybeCoroutine<T: Any>(
4141
parentContext: CoroutineContext,
42-
private val subscriber: MaybeEmitter<T & Any>
43-
) : AbstractCoroutine<T>(parentContext, false, true) {
44-
override fun onCompleted(value: T) {
42+
private val subscriber: MaybeEmitter<T>
43+
) : AbstractCoroutine<T?>(parentContext, false, true) {
44+
override fun onCompleted(value: T?) {
4545
try {
46-
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") // KT-54201
4746
if (value == null) subscriber.onComplete() else subscriber.onSuccess(value)
4847
} catch (e: Throwable) {
4948
handleUndeliverableException(e, context)

0 commit comments

Comments
 (0)