new inference: propagate inference variables from grand ~parents calls

This commit is contained in:
Anna Kozlova
2014-02-04 15:16:28 +04:00
parent 2c85d0fee4
commit 487c78e341
3 changed files with 32 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
import java.util.stream.Stream;
import java.util.*;
public class X1 {
void test(Stream<Integer> stream) {
Function<List<Integer>, List<Integer>> unmodifiableList = Collections::unmodifiableList;
stream.collect(collectingAndThen(toList(), unmodifiableList)).remove(0);
}
public static<T,A1,R,RR> Collector<T,A1,RR> collectingAndThen(Collector<T,A1,R> downstream,
Function<R,RR> finisher) {
return null;
}
static <T> Collector<T, ?, List<T>> toList() {
return null;
}
}