I´m using Scala 2.12.2 and Java 8. For a really bizarre situation I need to use the Scala Futures in Java, and I see that using the Lambdas in the future operator it does not work.
@Test
public void test(){
Future<String> future = new Promise.DefaultPromise();
future.map(value -> value.toUpperCase())
.onComplete(value -> System.out.println(value));
}
The error message said:
Future cannot be applied to lambda expression
But after read the documentation of the scala version 2.12 http://www.scala-lang.org/news/2.12.0/
I understood that from now on, lambda expressions from Java8 were compatible with Scala API.
Did I misunderstood something here?
This here works fine