Stream.of(statement)
results in
ambiguous reference to overloaded definition,
both method of in object Stream of type [T](x$1: T*)java.util.stream.Stream[T]
and method of in object Stream of type [T](x$1: T)java.util.stream.Stream[T]
The Scala compiler (version 2.11.12) doesn’t seem to know to use the 2nd method when there’s only one argument. I can disambiguate to use the varargs version with
Stream.of(Seq(statement): _*)
but really I want the other method. I randomly found that
Stream.of[BatchStatement](statement)
also compiles. I decompiled the class and found that it uses the singleton method rather than varargs. Why? Is there a better way to force it to use the one I want?