gojuno / koptional

Minimalistic Optional type for Kotlin that tries to fit its null-safe type system as smooth as possible.
Apache License 2.0
289 stars 21 forks source link

Observable<out ...> support for extensions #13

Closed nostra13 closed 6 years ago

nostra13 commented 7 years ago

Example:

val stream = if (true) {
    Observable.just(Some(IOException()), None)
} else {
    Observable.just(Some(RuntimeException()), None)
}

stream.filterSome() // Compile error

stream is of type Observable<out Optional<Exception>> and filterSome() (and other RxJava 2 extensions) can't be applied to such streams. Need to fix it.