https://kotlinlang.org logo
#announcements
Title
# announcements
a

apatrida

09/29/2015, 1:25 PM
this works too:
Copy code
class Subscriber<T> {

}

class Observable<out T> {
    public fun get(): T {
        return "" as T
    }

    public fun subscribe(s: Subscriber<T>) {
    }
}

public fun foo() {
    val obs = Observable<String>()
    val sub = Subscriber<CharSequence>()

    val obsView: Observable<CharSequence> = obs
    obsView.subscribe(sub)
}