Skip to content

Commit 7acccfc

Browse files
DmitriyZaitsevqwwdfsad
authored andcommitted
Align rxFlowable nullability with the Reactive Streams spec
Resolves #347
1 parent 6b2e90b commit 7acccfc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

reactive/kotlinx-coroutines-rx2/src/RxFlowable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import kotlin.coroutines.*
3636
* @param block the coroutine code.
3737
*/
3838
@ExperimentalCoroutinesApi
39-
public fun <T> CoroutineScope.rxFlowable(
39+
public fun <T: Any> CoroutineScope.rxFlowable(
4040
context: CoroutineContext = EmptyCoroutineContext,
4141
@BuilderInference block: suspend ProducerScope<T>.() -> Unit
4242
): Flowable<T> = Flowable.fromPublisher(publish(newCoroutineContext(context), block = block))

reactive/kotlinx-coroutines-rx2/src/RxObservable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private const val OPEN = 0 // open channel, still working
5252
private const val CLOSED = -1 // closed, but have not signalled onCompleted/onError yet
5353
private const val SIGNALLED = -2 // already signalled subscriber onCompleted/onError
5454

55-
private class RxObservableCoroutine<T>(
55+
private class RxObservableCoroutine<T: Any>(
5656
parentContext: CoroutineContext,
5757
private val subscriber: ObservableEmitter<T>
5858
) : AbstractCoroutine<Unit>(parentContext, true), ProducerScope<T>, SelectClause2<T, SendChannel<T>> {

reactive/kotlinx-coroutines-rx2/src/RxSingle.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public fun <T : Any> CoroutineScope.rxSingle(
3636
coroutine.start(CoroutineStart.DEFAULT, coroutine, block)
3737
}
3838

39-
private class RxSingleCoroutine<T>(
39+
private class RxSingleCoroutine<T: Any>(
4040
parentContext: CoroutineContext,
4141
private val subscriber: SingleEmitter<T>
4242
) : AbstractCoroutine<T>(parentContext, true) {

0 commit comments

Comments
 (0)