java8 / Java8InAction

MIT License
3.19k stars 2.26k forks source link

Cannot infer type argument(s) for <R> map(Function<? super T,? extends R>) #13

Open muralikk9 opened 7 years ago

muralikk9 commented 7 years ago

BestPriceFinder.java

public Stream<CompletableFuture> findPricesStream(String product) { return shops.stream() .map(shop -> CompletableFuture.supplyAsync(() -> shop.getPrice(product), executor)) .map(future -> future.thenApply(Quote::parse)) .map(future -> future.thenCompose(quote -> CompletableFuture.supplyAsync(() -> Discount.applyDiscount(quote), executor))); }

devangghugharawala commented 6 years ago

This issue occurs on eclipse 4.6 version as mentioned here https://bugs.eclipse.org/bugs/show_bug.cgi?id=512486.. Update eclipse version or use Intellij.