Skip to content

Commit

Permalink
Make wrappers generic types non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkadii Ivanov committed May 1, 2020
1 parent 006ebfd commit 918a11a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -11,7 +11,7 @@ import com.badoo.reaktive.maybe.subscribe as subscribeRx
* for more information.
* You can also extend the wrapper class if you need to expose any additional operators.
*/
open class MaybeWrapper<out T>(inner: Maybe<T>) : Maybe<T> by inner {
open class MaybeWrapper<out T : Any>(inner: Maybe<T>) : Maybe<T> by inner {

@UseReturnValue
fun subscribe(
Expand Down Expand Up @@ -66,4 +66,4 @@ open class MaybeWrapper<out T>(inner: Maybe<T>) : Maybe<T> by inner {
)
}

fun <T> Maybe<T>.wrap(): MaybeWrapper<T> = MaybeWrapper(this)
fun <T : Any> Maybe<T>.wrap(): MaybeWrapper<T> = MaybeWrapper(this)
Expand Up @@ -11,7 +11,7 @@ import com.badoo.reaktive.observable.subscribe as subscribeRx
* for more information.
* You can also extend the wrapper class if you need to expose any additional operators.
*/
open class ObservableWrapper<out T>(inner: Observable<T>) : Observable<T> by inner {
open class ObservableWrapper<out T : Any>(inner: Observable<T>) : Observable<T> by inner {

@UseReturnValue
fun subscribe(
Expand Down Expand Up @@ -66,4 +66,4 @@ open class ObservableWrapper<out T>(inner: Observable<T>) : Observable<T> by inn
)
}

fun <T> Observable<T>.wrap(): ObservableWrapper<T> = ObservableWrapper(this)
fun <T : Any> Observable<T>.wrap(): ObservableWrapper<T> = ObservableWrapper(this)
Expand Up @@ -11,7 +11,7 @@ import com.badoo.reaktive.single.subscribe as subscribeRx
* for more information.
* You can also extend the wrapper class if you need to expose any additional operators.
*/
open class SingleWrapper<out T>(inner: Single<T>) : Single<T> by inner {
open class SingleWrapper<out T : Any>(inner: Single<T>) : Single<T> by inner {

@UseReturnValue
fun subscribe(
Expand Down Expand Up @@ -50,4 +50,4 @@ open class SingleWrapper<out T>(inner: Single<T>) : Single<T> by inner {
)
}

fun <T> Single<T>.wrap(): SingleWrapper<T> = SingleWrapper(this)
fun <T : Any> Single<T>.wrap(): SingleWrapper<T> = SingleWrapper(this)

0 comments on commit 918a11a

Please sign in to comment.