-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Milestone
Description
The following Scala code won't compile
import rx.lang.scala.Observable
object Solution {
def main(args: Array[String]): Unit = {
Observable.create[Int](s => s.onNext(1))
.subscribe(println(_))
}
}While the same thing in Java works fine.
import rx.Observable;
public class Main {
public static void main(String[] args) {
Observable.create(s -> s.onNext(0))
.subscribe(System.out::println);
}
}Also, in the following compilable version, we shouldn't have to explicit add Int as the type param;
import rx.lang.scala.{Observable, Subscriber}
object Solution {
def main(args: Array[String]): Unit = {
Observable.create[Int](
s => {
s.onNext(1)
Subscriber()
}
)
.subscribe(println(_))
}
}
Edit
Remove the redundant call to Scheduers.newThread() in the last snippet. That's related to another issues I reported to Jetbrains (you can find it here).
Metadata
Metadata
Assignees
Labels
No labels