Hi,
I’m trying to use the RxJava library from Silver and am getting the following compiler errors:
var stream: Observable<Int>
stream = Observable.just(1) // Silver error: No such static member
stream = Observable.just(Int(1)) // Silver error: No such static member
stream = Observable<Int>.just(1) // Silver error: Type mismatch, expected "rx.Observable<Long>"
stream = Observable<Int>.just(Int(1))
I can work around the problem with the last variant, which does not produce an error, but I’d prefer not to have to do this and, most importantly, I’d like to understand what’s going on and what the specific limitation is.
As background, I’m trying to create a Java class library from Swift source that can be linked with RxJava. My goal is to share a Functional Reactive Programming “core” that will be the basis for both an Android and iOS app. The library would conditionally compile with either RxJava or RxSwift, depending on the target. This is possible (I’m hoping) because of the similarity in the two Rx implementations in terms of classes and method signatures. Where there are minor differences, I figure I can provide a compatibility layer.