I have a weird issue with the latest RxJava versio...
# announcements
r
I have a weird issue with the latest RxJava version. They added the following change
Copy code
// old : public final <R> Flowable<R> compose(FlowableTransformer<T, R> composer) {}
         public final <R> Flowable<R> compose(FlowableTransformer<? super T, ? extends R> composer) {}
If I call this method in Java 7, then I can pass in the type, so that following subscribers know the correct type, e.g.
Copy code
// every subscriber below will see a String
.compose(Transformers.<String>takeWhileViewAttachedObservable(presenter))
Previously that wasn’t necessary in Kotlin and I could simply call
.compose(Transformers.takeWhileViewAttachedObservable(presenter))
. But with the latest change, that doesn’t work anymore and every subscriber receives
Any
.
Copy code
.compose(Transformers.takeWhileViewAttachedObservable(this))
.subscribe {
    val myString = it // is not a string anymore
}
What’s the best way to solve this? How can I cast the type?