diff options
author | Dmitry Borodin <mail@DmitryBorodin.com> | 2018-09-18 20:31:17 +0200 |
---|---|---|
committer | Vsevolod Tolstopyatov <qwwdfsad@gmail.com> | 2018-09-26 15:06:04 +0300 |
commit | 54afb196b2897cf27431bd6e0c35955efb63c4e8 (patch) | |
tree | bf754128735367e6f645664f53bf5300af90babe /reactive/kotlinx-coroutines-rx2/src/RxConvert.kt | |
parent | e18b015690a7ec50eb32c0a23a37998cef26869a (diff) | |
download | platform_external_kotlinx.coroutines-54afb196b2897cf27431bd6e0c35955efb63c4e8.tar.gz platform_external_kotlinx.coroutines-54afb196b2897cf27431bd6e0c35955efb63c4e8.tar.bz2 platform_external_kotlinx.coroutines-54afb196b2897cf27431bd6e0c35955efb63c4e8.zip |
Aligned to RxJava2 contract - Observable and Single returns non nullable type <T>.
Fixes #347
Diffstat (limited to 'reactive/kotlinx-coroutines-rx2/src/RxConvert.kt')
-rw-r--r-- | reactive/kotlinx-coroutines-rx2/src/RxConvert.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/reactive/kotlinx-coroutines-rx2/src/RxConvert.kt b/reactive/kotlinx-coroutines-rx2/src/RxConvert.kt index 72de46c1..d8faecea 100644 --- a/reactive/kotlinx-coroutines-rx2/src/RxConvert.kt +++ b/reactive/kotlinx-coroutines-rx2/src/RxConvert.kt @@ -56,7 +56,7 @@ public fun <T> Deferred<T?>.asMaybe(context: CoroutineContext): Maybe<T> = Globa * @param context -- the coroutine context from which the resulting single is going to be signalled */ @ExperimentalCoroutinesApi -public fun <T> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = GlobalScope.rxSingle(context) { +public fun <T : Any> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = GlobalScope.rxSingle(context) { this@asSingle.await() } @@ -72,7 +72,7 @@ public fun <T> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = Glob * @param context -- the coroutine context from which the resulting observable is going to be signalled */ @ObsoleteCoroutinesApi -public fun <T> ReceiveChannel<T>.asObservable(context: CoroutineContext): Observable<T> = GlobalScope.rxObservable(context) { +public fun <T : Any> ReceiveChannel<T>.asObservable(context: CoroutineContext): Observable<T> = GlobalScope.rxObservable(context) { for (t in this@asObservable) send(t) } |