Skip to content

Commit

Permalink
Fix the initialization order
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed May 19, 2014
1 parent 44efb27 commit 039378f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package rx.lang.scala
trait Subscriber[-T] extends Observer[T] with Subscription {

self =>

private [scala] override val asJavaObserver: rx.Observer[_ >: T] = asJavaSubscriber
private [scala] override val asJavaSubscription: rx.Subscription = asJavaSubscriber


private [scala] val asJavaSubscriber: rx.Subscriber[_ >: T] = new rx.Subscriber[T] {
def onNext(value: T): Unit = self.onNext(value)
def onError(error: Throwable): Unit = self.onError(error)
def onCompleted(): Unit = self.onCompleted()
}


private [scala] override val asJavaObserver: rx.Observer[_ >: T] = asJavaSubscriber
private [scala] override val asJavaSubscription: rx.Subscription = asJavaSubscriber

/**
* Used to register an unsubscribe callback.
*/
Expand Down

0 comments on commit 039378f

Please sign in to comment.